bionic/tests/libs/dlopen_b.cpp
Evgenii Stepanov 6865082ca6 Support DT_RUNPATH in the linker.
Only $ORIGIN substitution is supported, but not linux-specific $LIB
or $PLATFORM.

Change-Id: I5814a016c7c91afba080230a547a863686e7c2b9
2015-06-10 16:44:22 -07:00

8 lines
283 B
C++

#include <dlfcn.h>
extern "C" void *dlopen_b() {
// This is not supposed to succeed. Even though this library has DT_RUNPATH
// for libtest_dt_runpath_x.so, it is not taked into account for dlopen.
void *handle = dlopen("libtest_dt_runpath_x.so", RTLD_NOW);
return handle;
}