Fix base vaddr detection for ELF binaries. PT_LOAD with offset 0 is not
mandatory for ELF binaries so we'll use the segment with offset less then alignment and align it appropriately (which covers pt_offset == 0 case)
This commit is contained in:
@@ -697,8 +697,8 @@ pmcstat_image_get_elf_params(struct pmcstat_image *image)
|
||||
ph.p_offset);
|
||||
break;
|
||||
case PT_LOAD:
|
||||
if (ph.p_offset == 0)
|
||||
image->pi_vaddr = ph.p_vaddr;
|
||||
if ((ph.p_offset & (-ph.p_align)) == 0)
|
||||
image->pi_vaddr = ph.p_vaddr & (-ph.p_align);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user