summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-01-07 14:18:22 -0800
committerElliott Hughes <enh@google.com>2013-01-07 14:44:36 -0800
commita43e906221a3e9c70a66118a8692cd46f77e144e (patch)
tree1fd6b3a2cdd50c15291c991644dd295371712c35 /tests
parent7e22db037e6d9ab117bf5d50c7aca85fe74941a0 (diff)
downloadbionic-a43e906221a3e9c70a66118a8692cd46f77e144e.zip
bionic-a43e906221a3e9c70a66118a8692cd46f77e144e.tar.gz
bionic-a43e906221a3e9c70a66118a8692cd46f77e144e.tar.bz2
Don't test GNU-style ELF hashes on MIPS.
The MIPS toolchain can't generate them because they're incompatible with the MIPS ABI (which requires .dynsym match the GOT, while GNU-style requires .dynsym to be sorted by hash code), so there's nothing to test. Change-Id: I2220f452fe6fe595ec1312544cc741dd390a36a5
Diffstat (limited to 'tests')
-rw-r--r--tests/Android.mk4
-rw-r--r--tests/dlfcn_test.cpp6
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/Android.mk b/tests/Android.mk
index 083bb70..a50232e 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -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.
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index 0c40eb7..938b8a5 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -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.