gmarin13
a613757740
Handle shared libraries with nonzero program headers. (#119)
Generalize GetBase for shared libraries to handle cases when both process
mapping offset and program header addresses are non-zero.
Based on process mapping information, a sample at a virtual address x maps to
a file offset fx = x - map_start + map_offset.
The program header for the segment with the .text section may have non-zero
mapping information. Thus, a file offset fx maps to a symbol address
sx = fx - ph_offset + ph_virt_addr.
Thus, sx = x - map_start + map_offset - ph_offset + ph_virt_addr, and the base
address for symbolization is map_start - map_offset + ph_offset - ph_virt_addr.