Merge "Fix dlopen_vdso test" am: 1d297d2654

am: c46b602403

Change-Id: I9e7ce728b318b609edcc069b6e4b705b5862a651
This commit is contained in:
dimitry 2017-10-11 19:30:45 +00:00 committed by android-build-merger
commit ab0a1d5cd6

View file

@ -21,6 +21,9 @@
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#if __has_include(<sys/auxv.h>)
#include <sys/auxv.h>
#endif
#include <string>
#include <thread>
@ -246,6 +249,12 @@ TEST(dlfcn, dlopen_by_soname) {
}
TEST(dlfcn, dlopen_vdso) {
#if __has_include(<sys/auxv.h>)
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);