aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dlfcn_test.cpp
diff options
context:
space:
mode:
authorRyan Prichard <rprichard@google.com>2019-01-15 00:11:37 -0800
committerRyan Prichard <rprichard@google.com>2019-01-17 00:45:55 -0800
commitfb8730d49586f29868b5697d6a8c74aa9a4847d0 (patch)
tree2900d8f03068efb6a069eb6b579460855b43627b /tests/dlfcn_test.cpp
parent1988350d1ccd1a99c628178612e1c9ce0f7858a3 (diff)
downloadandroid_bionic-fb8730d49586f29868b5697d6a8c74aa9a4847d0.tar.gz
android_bionic-fb8730d49586f29868b5697d6a8c74aa9a4847d0.tar.bz2
android_bionic-fb8730d49586f29868b5697d6a8c74aa9a4847d0.zip
Handle R_GENERIC_TLS_TPREL relocations
This relocation is used for static TLS's initial-exec (IE) accesses. A TLS symbol's value is its offset from the start of the ELF module's TLS segment. It doesn't make sense to add the load_bias to this value, so skip the call to soinfo::resolve_symbol_address. Allow TLS relocations to refer to an unresolved weak symbol. In that case, sym will be non-zero, but lsi will be nullptr. The dynamic linker resolves the TPREL relocation to 0, making &missing_weak_symbol equal the thread pointer. Recognize Gold-style relocations to STB_LOCAL TLS symbols/sections and issue an error. Remove the "case R_AARCH64_TLS_TPREL64", because the R_GENERIC_TLS_TPREL case handles it. Remove the no-op R_AARCH64_TLSDESC handler. It's better to issue an error. dlopen_library_with_ELF_TLS now fails with a consistent error about an unimplemented dynamic TLS relocation. Bug: http://b/78026329 Test: bionic unit tests (elftls tests are added in a later CL) Change-Id: Ia08e1b5c8098117e12143d3b4ebb4dfaa5ca46ec
Diffstat (limited to 'tests/dlfcn_test.cpp')
-rw-r--r--tests/dlfcn_test.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index 5f48e675f..176a6f809 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -1086,7 +1086,7 @@ TEST(dlfcn, dlopen_library_with_ELF_TLS) {
dlerror(); // Clear any pending errors.
void* handle = dlopen("libelf-tls-library.so", RTLD_NOW);
ASSERT_TRUE(handle == nullptr);
- ASSERT_SUBSTR("unsupported ELF TLS", dlerror());
+ ASSERT_SUBSTR("unknown reloc type ", dlerror());
}
TEST(dlfcn, dlopen_bad_flags) {