| 31 | void* data) = nullptr; |
| 32 | |
| 33 | static void initChain() { |
| 34 | static std::once_flag flag; |
| 35 | |
| 36 | // Ensure that chain_dl_iterate_phdr points to the "real" function that we are overriding |
| 37 | std::call_once(flag, []() { *(void**)&chain_dl_iterate_phdr = dlsym(RTLD_NEXT, "dl_iterate_phdr"); }); |
| 38 | |
| 39 | if (!chain_dl_iterate_phdr) { |
| 40 | criticalError(FDB_EXIT_ERROR, "SignalSafeUnwindError", "Unable to find dl_iterate_phdr symbol"); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | // This overrides the function in libc! |
| 45 | extern "C" int dl_iterate_phdr(int (*callback)(struct dl_phdr_info* info, size_t size, void* data), void* data) { |
no test coverage detected