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

Method calcVirtualLoadAddress

src/symbols_linux.cpp:346–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344}
345
346void ElfParser::calcVirtualLoadAddress() {
347 // Find a difference between the virtual load address (often zero) and the actual DSO base
348 const char* pheaders = (const char*)_header + _header->e_phoff;
349 for (int i = 0; i < _header->e_phnum; i++) {
350 ElfProgramHeader* pheader = (ElfProgramHeader*)(pheaders + i * _header->e_phentsize);
351 if (pheader->p_type == PT_LOAD) {
352 _vaddr_diff = _base - pheader->p_vaddr;
353 return;
354 }
355 }
356 _vaddr_diff = _base;
357}
358
359void ElfParser::parseDynamicSection() {
360 ElfProgramHeader* dynamic = findProgramHeader(PT_DYNAMIC);

Callers 2

parseFileMethod · 0.80
parseProgramHeadersMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected