From 44adf93b8eddb3a7965a3e9abc189408a1f5a7ea Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Thu, 22 May 2014 09:49:24 -0700 Subject: [PATCH] Fix dlsym_failure NULL handle test * RTLD_DEFAULT != (void*)0 only for bionic32 Change-Id: I3b3758835cf4085b0f899e2b62861591411aec13 --- tests/dlfcn_test.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp index 3459a562e..49cbb7d17 100644 --- a/tests/dlfcn_test.cpp +++ b/tests/dlfcn_test.cpp @@ -101,17 +101,13 @@ TEST(dlfcn, dlsym_failures) { void* sym; - // lp64 RTLD_DEFAULT=(void*)0 -#if !defined(__LP64__) - // NULL handle. +#if defined(__BIONIC__) && !defined(__LP64__) + // RTLD_DEFAULT in lp32 bionic is not (void*)0 + // so it can be distinguished from the NULL handle. sym = dlsym(NULL, "test"); ASSERT_TRUE(sym == NULL); -#if defined(__BIONIC__) ASSERT_SUBSTR("dlsym library handle is null", dlerror()); -#else - ASSERT_SUBSTR("undefined symbol: test", dlerror()); // glibc isn't specific about the failure. #endif -#endif // !defined(__LP64__) // NULL symbol name. #if defined(__BIONIC__)