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_ALLOC regions with low addresses near 0
- In
lld, non-SHF_ALLOC sections always get 0 sh_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_ALLOC INFO section overlaps with our SHF_ALLOC section 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?
We've run into an issue where symbols in output sections marked
INFOin 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:
SHF_ALLOCregions with low addresses near 0lld, non-SHF_ALLOCsections always get 0sh_addr.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 notSHF_ALLOC?