Check that the base address of the shared object has not changed
| 840 | |
| 841 | // Check that the base address of the shared object has not changed |
| 842 | static bool verifyBaseAddress(const CodeCache* cc, void* lib_handle) { |
| 843 | Dl_info dl_info; |
| 844 | struct link_map* map; |
| 845 | |
| 846 | if (dlinfo(lib_handle, RTLD_DI_LINKMAP, &map) != 0 || dladdr(map->l_ld, &dl_info) == 0) { |
| 847 | return false; |
| 848 | } |
| 849 | |
| 850 | return cc->imageBase() == (const char*)dl_info.dli_fbase; |
| 851 | } |
| 852 | |
| 853 | UnloadProtection::UnloadProtection(const CodeCache *cc) { |
| 854 | if (OS::isMusl() || isMainExecutable(cc->imageBase(), cc->maxAddress()) || isLoader(cc->imageBase())) { |
no test coverage detected