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.
|
|
||
240 |
|
240 |
|
241 |
|
241 |
|
242 |
|
242 |
|
243 |
|
|
|
244 |
|
|
|
245 |
|
|
|
246 |
|
|
|
247 |
|
|
|
248 |
|
|
|
249 |
|
|
|
|
243 |
|
|
|
244 |
|
|
|
245 |
|
|
|
246 |
|
|
250 |
|
247 |
|
251 |
|
|
|
|
248 |
|
|
252 |
|
249 |
|
253 |
|
|
|
|
250 |
|
|
|
251 |
|
|
|
252 |
|
|
|
253 |
|
|
|
254 |
|
|
|
255 |
|
|
|
256 |
|
|
|
257 |
|
|
|
258 |
|
|
254 |
|
259 |
|
255 |
|
260 |
|
256 |
|
261 |
|
|
|
||
62 |
|
62 |
|
63 |
|
63 |
|
64 |
|
64 |
|
65 |
|
|
|
|
65 |
|
|
66 |
|
66 |
|
|
67 |
|
|
67 |
|
68 |
|
68 |
|
69 |
|
69 |
|
70 |
|