blob: 5b3624292b540e35f7e06c4d290d8aec8b50e69d [file] [log] [blame]
Evgenii Stepanov68650822015-06-10 13:38:39 -07001#include <dlfcn.h>
Dmitriy Ivanov7d09a8c2015-06-23 13:44:18 -07002
Elliott Hughes3f7be222024-02-14 21:32:56 +00003// Work around for http://b/20049306, which isn't going to be fixed.
4int defeat_sibling_call_optimization = 0;
5
6extern "C" void* dlopen_b() {
Dmitriy Ivanova1feb112015-10-01 18:41:57 -07007 // 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.
Evgenii Stepanov68650822015-06-10 13:38:39 -070010 void *handle = dlopen("libtest_dt_runpath_x.so", RTLD_NOW);
Dmitriy Ivanov7d09a8c2015-06-23 13:44:18 -070011 if (handle != nullptr) {
Elliott Hughes68ae6ad2020-07-21 16:11:30 -070012 defeat_sibling_call_optimization++;
Dmitriy Ivanov7d09a8c2015-06-23 13:44:18 -070013 return handle;
14 }
15 return nullptr;
Evgenii Stepanov68650822015-06-10 13:38:39 -070016}