MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / verifyBaseAddress

Function verifyBaseAddress

src/symbols_linux.cpp:842–851  ·  view source on GitHub ↗

Check that the base address of the shared object has not changed

Source from the content-addressed store, hash-verified

840
841// Check that the base address of the shared object has not changed
842static 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
853UnloadProtection::UnloadProtection(const CodeCache *cc) {
854 if (OS::isMusl() || isMainExecutable(cc->imageBase(), cc->maxAddress()) || isLoader(cc->imageBase())) {

Callers 1

UnloadProtectionMethod · 0.85

Calls 1

imageBaseMethod · 0.80

Tested by

no test coverage detected