Move dlsym and dladdr implementation to linker.cpp

Bug: http://b/25716705
Bug: http://b/22865643
Change-Id: If22fc1eda219f676b5fcc06490f7901d21d1749c
This commit is contained in:
Dimitry Ivanov
2015-12-10 16:08:14 -08:00
parent 9d8632e1a7
commit 4a2c5aa30c
4 changed files with 137 additions and 96 deletions

View File

@@ -760,7 +760,7 @@ TEST(dlfcn, dlsym_failures) {
// so it can be distinguished from the NULL handle.
sym = dlsym(nullptr, "test");
ASSERT_TRUE(sym == nullptr);
ASSERT_SUBSTR("dlsym library handle is null", dlerror());
ASSERT_STREQ("dlsym failed: library handle is null", dlerror());
#endif
// NULL symbol name.
@@ -768,7 +768,7 @@ TEST(dlfcn, dlsym_failures) {
// glibc marks this parameter non-null and SEGVs if you cheat.
sym = dlsym(self, nullptr);
ASSERT_TRUE(sym == nullptr);
ASSERT_SUBSTR("", dlerror());
ASSERT_STREQ("dlsym failed: symbol name is null", dlerror());
#endif
// Symbol that doesn't exist.