1 #include <dlfcn.h> 2 extern "C" void *dlopen_b() { 3 // TODO (dimitry): this is to work around http://b/20049306 4 // remove once it is fixed 5 static int dummy = 0; 6 7 // This is supposed to succeed because this library has DT_RUNPATH 8 // for libtest_dt_runpath_x.so which should be taken into account 9 // by dlopen. 10 void *handle = dlopen("libtest_dt_runpath_x.so", RTLD_NOW); 11 if (handle != nullptr) { 12 dummy++; 13 return handle; 14 } 15 return nullptr; 16 } 17