[lld] [llvm] [LTO] Move section names from symbol table to module summary. (PR #210856)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 15:53:14 PDT 2026


efriedma-quic wrote:

There's a few different dimensions here in terms of overhead:

- Instead of putting the input section names into the ModuleSummaryIndex, we can keep them in the symbol table.  I'm not sure that's inherently faster, but the symbol table has a pretty efficient sparse representation for the symbol names, and I'm not sure how to do something equivalent in the module summary.
- Iterating over sections in a separate loop could be more expensive?  Inherently, supporting __start/__stop requires a map lookup per section name in the linker, no matter how we organize it, but reorganizing the code to iterate over sections separately could have some cost.
- Output section names have to go in the summary, inherently, but that imposes no overhead outside LTO-with-linker-script mode.

-----

Going fully symbol-oriented, like the current patch in #204282, is simpler: the code is more closely aligned with the underlying datastructures.  The downside is mostly just that we're exposing more of the internals of how LTO works to the linker: we have "symbols" which wouldn't exist in an equivalent ELF file.

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


More information about the llvm-commits mailing list