blob: 092c96c9539c1b18efdb56a3e1f316b941b87ee2 [file] [log] [blame]
Evgenii Stepanov68650822015-06-10 13:38:39 -07001#include <dlfcn.h>
2extern "C" void *dlopen_b() {
Elliott Hughes68ae6ad2020-07-21 16:11:30 -07003 // Work around for http://b/20049306, which isn't going to be fixed.
4 static int defeat_sibling_call_optimization = 0;
Dmitriy Ivanov7d09a8c2015-06-23 13:44:18 -07005
Dmitriy Ivanova1feb112015-10-01 18:41:57 -07006 // This is supposed to succeed because this library has DT_RUNPATH
7 // for libtest_dt_runpath_x.so which should be taken into account
8 // by dlopen.
Evgenii Stepanov68650822015-06-10 13:38:39 -07009 void *handle = dlopen("libtest_dt_runpath_x.so", RTLD_NOW);
Dmitriy Ivanov7d09a8c2015-06-23 13:44:18 -070010 if (handle != nullptr) {
Elliott Hughes68ae6ad2020-07-21 16:11:30 -070011 defeat_sibling_call_optimization++;
Dmitriy Ivanov7d09a8c2015-06-23 13:44:18 -070012 return handle;
13 }
14 return nullptr;
Evgenii Stepanov68650822015-06-10 13:38:39 -070015}