[llvm] [MC][ELF] Eliminate some hash maps from ELFObjectWriter (PR #97421)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 09:47:44 PDT 2024


MaskRay wrote:

> > Store signature group index in MCSymbolELF: This removes the need for a reverse lookup map.
> > I'm unsure about the third part, it increases the size of MCSymbolELF and therefore max-rss. On the other hand, MCSymbol currently has 28 padding bits and an extra four padding bytes (if I counted correctly, the bit fields sum up to 36), but this seems unintended. @MaskRay what do you think? Use padding bytes in MCSymbol or drop the third commit and fix MCSymbol bit fields later?
> 
> Perhaps we should not make the MCSymbolELF change. Only a small portion of symbols are used as section group signatures. The `mutable` member is also a bit strange.

(
Additional notes, but maybe unrelated:

Local symbols need less attributes than non-local symbols. gas uses this property to save space but the indirection might harm performance. 

Group signature symbols are strange: `.section x,"aG", at progbits,xxx` defines a local symbol `xxx` if it is not explicitly declared as .weak/.globl .
)

https://github.com/llvm/llvm-project/pull/97421


More information about the llvm-commits mailing list