-
Notifications
You must be signed in to change notification settings - Fork 367
Open
Labels
Description
We've run into an issue where symbols in output sections marked INFO in our linker script show up in our bloaty output with any of -d symbols, -d sections,symbols, or -d segments,symbols.
I think the root cause is that:
- Our executable's VM memory map has valid
SHF_ALLOCregions with low addresses near 0 - In
lld, non-SHF_ALLOCsections always get 0sh_addr. - AFAICT, once bloaty has built up a range map of the memory space, it will assign symbols to a section purely based on the symbol's address. The address of our non-
SHF_ALLOCINFOsection overlaps with ourSHF_ALLOCsection near 0, which confuses Bloaty.
Would it be reasonable to check each symbol's section header index (st_shndx) and discard it from VM space if the corresponding section is not SHF_ALLOC?