Skip to content

Ignore SHF_ALLOC sections in VM memory map #469

@kesyog

Description

@kesyog

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions