summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDmitriy Ivanov <dimitry@google.com>2014-11-03 22:12:19 -0800
committerDmitriy Ivanov <dimitry@google.com>2014-11-03 22:15:29 -0800
commit9d3382d97a2cdc8c8f78c7825ece16f09292fc36 (patch)
treee257b71f2b37be720ec7eb483135e97100e732f1 /tests
parent69c5d108a5cb44167a04d42ffdad6a39648ed235 (diff)
downloadbionic-9d3382d97a2cdc8c8f78c7825ece16f09292fc36.zip
bionic-9d3382d97a2cdc8c8f78c7825ece16f09292fc36.tar.gz
bionic-9d3382d97a2cdc8c8f78c7825ece16f09292fc36.tar.bz2
Revert "Fix dlsym() to take into account RTLD_GLOBAL/LOCAL"
This reverts commit c85e82dde5c4b2accc50a9e17740b9005dfbae6a. Bug: 18222321 Bug: 18211780 Change-Id: I32f4048bd5ea85dc8a3dfccce8cf141b241ab692
Diffstat (limited to 'tests')
-rw-r--r--tests/dlfcn_test.cpp36
-rw-r--r--tests/libs/dlopen_testlib_simple.cpp2
2 files changed, 1 insertions, 37 deletions
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index c9c856a..e24af13 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -202,42 +202,6 @@ TEST(dlfcn, dlopen_check_order) {
dlclose(handle);
}
-TEST(dlfcn, dlopen_check_rtld_local) {
- void* sym = dlsym(RTLD_DEFAULT, "dlopen_testlib_simple_func");
- ASSERT_TRUE(sym == nullptr);
-
- // implicit RTLD_LOCAL
- void* handle = dlopen("libtest_simple.so", RTLD_NOW);
- sym = dlsym(RTLD_DEFAULT, "dlopen_testlib_simple_func");
- ASSERT_TRUE(sym == nullptr);
- ASSERT_SUBSTR("undefined symbol: dlopen_testlib_simple_func", dlerror());
- sym = dlsym(handle, "dlopen_testlib_simple_func");
- ASSERT_TRUE(sym != nullptr);
- ASSERT_TRUE(reinterpret_cast<bool (*)(void)>(sym)());
- dlclose(handle);
-
- // explicit RTLD_LOCAL
- handle = dlopen("libtest_simple.so", RTLD_NOW | RTLD_LOCAL);
- sym = dlsym(RTLD_DEFAULT, "dlopen_testlib_simple_func");
- ASSERT_TRUE(sym == nullptr);
- ASSERT_SUBSTR("undefined symbol: dlopen_testlib_simple_func", dlerror());
- sym = dlsym(handle, "dlopen_testlib_simple_func");
- ASSERT_TRUE(sym != nullptr);
- ASSERT_TRUE(reinterpret_cast<bool (*)(void)>(sym)());
- dlclose(handle);
-}
-
-TEST(dlfcn, dlopen_check_rtld_global) {
- void* sym = dlsym(RTLD_DEFAULT, "dlopen_testlib_simple_func");
- ASSERT_TRUE(sym == nullptr);
-
- void* handle = dlopen("libtest_simple.so", RTLD_NOW | RTLD_GLOBAL);
- sym = dlsym(RTLD_DEFAULT, "dlopen_testlib_simple_func");
- ASSERT_TRUE(sym != nullptr) << dlerror();
- ASSERT_TRUE(reinterpret_cast<bool (*)(void)>(sym)());
- dlclose(handle);
-}
-
// libtest_with_dependency_loop.so -> libtest_with_dependency_loop_a.so ->
// libtest_with_dependency_loop_b.so -> libtest_with_dependency_loop_c.so ->
// libtest_with_dependency_loop_a.so
diff --git a/tests/libs/dlopen_testlib_simple.cpp b/tests/libs/dlopen_testlib_simple.cpp
index 3226955..bf750b2 100644
--- a/tests/libs/dlopen_testlib_simple.cpp
+++ b/tests/libs/dlopen_testlib_simple.cpp
@@ -19,6 +19,6 @@
uint32_t dlopen_testlib_taxicab_number = 1729;
-extern "C" bool dlopen_testlib_simple_func() {
+bool dlopen_testlib_simple_func() {
return true;
}