Reject .so files with no sysv hash table.
Also ensure that dlopen(3) errors always include the name of the library we failed to open. Also fix a bug where we'd fall back to searching LD_LIBRARY_PATH and the built-in paths for names that include slashes. Bug: http://code.google.com/p/android/issues/detail?id=38479 Change-Id: Ib2c009ed083344a7a012749d58f8679db2f26c78
This commit is contained in:
@@ -181,3 +181,13 @@ TEST(dlopen, dladdr_invalid) {
|
||||
ASSERT_EQ(dladdr(&info, &info), 0); // Zero on error, non-zero on success.
|
||||
ASSERT_TRUE(dlerror() == NULL); // dladdr(3) doesn't set dlerror(3).
|
||||
}
|
||||
|
||||
#if __BIONIC__
|
||||
// Our dynamic linker doesn't support GNU hash tables.
|
||||
TEST(dlopen, library_with_only_gnu_hash) {
|
||||
dlerror(); // Clear any pending errors.
|
||||
void* handle = dlopen("empty-library.so", RTLD_NOW);
|
||||
ASSERT_TRUE(handle == NULL);
|
||||
ASSERT_STREQ("dlopen failed: empty/missing DT_HASH in \"empty-library.so\" (built with --hash-style=gnu?)", dlerror());
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user