am 5c5fe07e: am 364d9ee6: Merge "Don\'t test GNU-style ELF hashes on MIPS."

* commit '5c5fe07e43a20cd28c20bbf7a4a0443062ef144f':
  Don't test GNU-style ELF hashes on MIPS.
This commit is contained in:
Elliott Hughes 2013-01-08 10:27:20 -08:00 committed by Android Git Automerger
commit 5043c376c9
2 changed files with 8 additions and 2 deletions

View File

@ -98,13 +98,15 @@ include $(BUILD_NATIVE_TEST)
# -----------------------------------------------------------------------------
# Build no-elf-hash-table-library.so to test dlopen(3) on a library that
# only has a GNU-style hash table.
# only has a GNU-style hash table. MIPS doesn't support GNU hash style.
ifneq ($(TARGET_ARCH),mips)
include $(CLEAR_VARS)
LOCAL_MODULE := no-elf-hash-table-library
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SRC_FILES := empty.cpp
LOCAL_LDFLAGS := -Wl,--hash-style=gnu
include $(BUILD_SHARED_LIBRARY)
endif
# -----------------------------------------------------------------------------
# Unit tests built against glibc.

View File

@ -188,8 +188,11 @@ TEST(dlfcn, dladdr_invalid) {
ASSERT_TRUE(dlerror() == NULL); // dladdr(3) doesn't set dlerror(3).
}
#if __BIONIC__
// Our dynamic linker doesn't support GNU hash tables.
#if defined(__BIONIC__)
// GNU-style ELF hash tables are incompatible with the MIPS ABI.
// MIPS requires .dynsym to be sorted to match the GOT but GNU-style requires sorting by hash code.
#if !defined(__mips__)
TEST(dlfcn, dlopen_library_with_only_gnu_hash) {
dlerror(); // Clear any pending errors.
void* handle = dlopen("no-elf-hash-table-library.so", RTLD_NOW);
@ -197,6 +200,7 @@ TEST(dlfcn, dlopen_library_with_only_gnu_hash) {
ASSERT_STREQ("dlopen failed: empty/missing DT_HASH in \"no-elf-hash-table-library.so\" (built with --hash-style=gnu?)", dlerror());
}
#endif
#endif
TEST(dlfcn, dlopen_bad_flags) {
dlerror(); // Clear any pending errors.