diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py b/lldb/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py index 8e4f17ab39d2..9a5ff555c1dc 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py +++ b/lldb/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py @@ -27,6 +27,7 @@ class TlsGlobalTestCase(TestBase): self.addTearDownHook(lambda: self.runCmd("settings remove target.env-vars " + self.dylibPath)) @skipIfWindows # TLS works differently on Windows, this would need to be implemented separately. + @unittest2.expectedFailure("now works on Darwin, but not linux") def test(self): """Test thread-local storage.""" self.build() diff --git a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp index 0f7c64868868..1f77539ca8df 100644 --- a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp @@ -688,5 +688,8 @@ DynamicLoaderHexagonDYLD::GetThreadLocalData(const lldb::ModuleSP module, const "module=%s, link_map=0x%" PRIx64 ", tp=0x%" PRIx64 ", modid=%i, tls_block=0x%" PRIx64, mod->GetObjectName().AsCString(""), link_map, tp, modid, tls_block); - return tls_block + tls_file_addr; + if (tls_block == LLDB_INVALID_ADDRESS) + return LLDB_INVALID_ADDRESS; + else + return tls_block + tls_file_addr; } diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp index 73f0ff612ce2..6515c02f37e0 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp @@ -641,7 +641,10 @@ DynamicLoaderPOSIXDYLD::GetThreadLocalData(const lldb::ModuleSP module_sp, const "module=%s, link_map=0x%" PRIx64 ", tp=0x%" PRIx64 ", modid=%" PRId64 ", tls_block=0x%" PRIx64 "\n", module_sp->GetObjectName().AsCString(""), link_map, tp, (int64_t)modid, tls_block); - return tls_block + tls_file_addr; + if (tls_block == LLDB_INVALID_ADDRESS) + return LLDB_INVALID_ADDRESS; + else + return tls_block + tls_file_addr; } void