Evgenii Stepanov | 6865082 | 2015-06-10 13:38:39 -0700 | [diff] [blame] | 1 | #include <dlfcn.h> |
Dmitriy Ivanov | 7d09a8c | 2015-06-23 13:44:18 -0700 | [diff] [blame] | 2 | |
Elliott Hughes | 3f7be22 | 2024-02-14 21:32:56 +0000 | [diff] [blame] | 3 | // Work around for http://b/20049306, which isn't going to be fixed. |
| 4 | int defeat_sibling_call_optimization = 0; |
| 5 | |
| 6 | extern "C" void* dlopen_b() { |
Dmitriy Ivanov | a1feb11 | 2015-10-01 18:41:57 -0700 | [diff] [blame] | 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. |
Evgenii Stepanov | 6865082 | 2015-06-10 13:38:39 -0700 | [diff] [blame] | 10 | void *handle = dlopen("libtest_dt_runpath_x.so", RTLD_NOW); |
Dmitriy Ivanov | 7d09a8c | 2015-06-23 13:44:18 -0700 | [diff] [blame] | 11 | if (handle != nullptr) { |
Elliott Hughes | 68ae6ad | 2020-07-21 16:11:30 -0700 | [diff] [blame] | 12 | defeat_sibling_call_optimization++; |
Dmitriy Ivanov | 7d09a8c | 2015-06-23 13:44:18 -0700 | [diff] [blame] | 13 | return handle; |
| 14 | } |
| 15 | return nullptr; |
Evgenii Stepanov | 6865082 | 2015-06-10 13:38:39 -0700 | [diff] [blame] | 16 | } |