aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dlfcn_test.cpp
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2016-08-15 23:23:26 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-08-15 23:23:26 +0000
commit3b2d331e77143ce63ad7f404ab6669c03178eff4 (patch)
tree9e22d232e0fae6f84fd31d8f5b8b890296d12399 /tests/dlfcn_test.cpp
parent52848b02b37eae075fd5f3cbc9087f49cd0173d4 (diff)
parent559583469cd6425cdf3f63bcfc453d7d885ce131 (diff)
downloadandroid_bionic-3b2d331e77143ce63ad7f404ab6669c03178eff4.tar.gz
android_bionic-3b2d331e77143ce63ad7f404ab6669c03178eff4.tar.bz2
android_bionic-3b2d331e77143ce63ad7f404ab6669c03178eff4.zip
Merge "linker: add test for zeroed out shdr_table_"
Diffstat (limited to 'tests/dlfcn_test.cpp')
-rw-r--r--tests/dlfcn_test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index 8c9052bc4..ecc2a12ae 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -1202,4 +1202,12 @@ TEST(dlfcn, dlopen_invalid_zero_shdr_table_offset) {
ASSERT_SUBSTR(expected_dlerror.c_str(), dlerror());
}
+TEST(dlfcn, dlopen_invalid_zero_shdr_table_content) {
+ std::string libpath = std::string(getenv("ANDROID_DATA")) + PREBUILT_ELF_PATH + "/libtest_invalid-zero_shdr_table_content.so";
+ void* handle = dlopen(libpath.c_str(), RTLD_NOW);
+ ASSERT_TRUE(handle == nullptr);
+ std::string expected_dlerror = std::string("dlopen failed: \"") + libpath + "\" .dynamic section header was not found";
+ ASSERT_SUBSTR(expected_dlerror.c_str(), dlerror());
+}
+
#endif