From b9555a9251467bc2d0b05a4e2f011531c1d3bd4a Mon Sep 17 00:00:00 2001 From: dimitry Date: Wed, 11 Oct 2017 18:04:05 +0200 Subject: [PATCH] Fix dlopen_vdso test arm32 is still missing vdso (at least on some kernels). This commit adds explicit check for it and skip the test if AT_SYSINFO_EHDR is not set. Test: run 32bit bionic-unit-tests --gtest_filter=dlfcn.dlopen_vdso on angler Change-Id: I7fae78c6a4f819601a4ac9e8e1da53ff07c833ff --- tests/dlfcn_test.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp index 66ea0f962..adc5ee4b1 100644 --- a/tests/dlfcn_test.cpp +++ b/tests/dlfcn_test.cpp @@ -21,6 +21,9 @@ #include #include #include +#if __has_include() +#include +#endif #include #include @@ -246,6 +249,12 @@ TEST(dlfcn, dlopen_by_soname) { } TEST(dlfcn, dlopen_vdso) { +#if __has_include() + if (getauxval(AT_SYSINFO_EHDR) == 0) { + GTEST_LOG_(INFO) << "getauxval(AT_SYSINFO_EHDR) == 0, skipping this test."; + return; + } +#endif void* handle = dlopen("linux-vdso.so.1", RTLD_NOW); ASSERT_TRUE(handle != nullptr) << dlerror(); dlclose(handle);