blob: cd81e16c1a49fa0d3b3192391e3214577956a3fb [file] [log] [blame]
Evgenii Stepanov68650822015-06-10 13:38:39 -07001#include <dlfcn.h>
2extern "C" void *dlopen_b() {
Dmitriy Ivanov7d09a8c2015-06-23 13:44:18 -07003 // TODO (dimitry): this is to work around http://b/20049306
4 // remove once it is fixed
5 static int dummy = 0;
6
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) {
12 dummy++;
13 return handle;
14 }
15 return nullptr;
Evgenii Stepanov68650822015-06-10 13:38:39 -070016}