drgn icon indicating copy to clipboard operation
drgn copied to clipboard

Avoid indexing/parsing function dies with pc=0

Open jgkamat opened this issue 3 years ago • 1 comments

This idea comes from Greg Clayton, the author of LLDB.

Due to a quirk in linkers, apparently many functions get placed outside the executable range in dwarf (from dead/stripped functions) - and these functions can probably be excluded from the index and avoid being parsed completely. However, to my knowledge we currently don't parse PCs at all in the first pass, so we will need to see if excluding these dies is worth it - so this overall needs some investigation.

To keep things simple, we can try just dropping functions with a pc of 0 to start.

jgkamat avatar Feb 08 '22 00:02 jgkamat

Zero can be a valid address for some binaries. If you have access to your section list for your binary, you can determine the lowest address that is in a section with execute permissions just to be safe. Zero happens to be what most linkers will fill in, but some put in 0xFFFFFFFFFFFFFFFF (-1)

clayborg avatar Feb 08 '22 00:02 clayborg