[lld] [lld][COFF] Remove duplicate strtab entries (PR #141197)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Thu May 22 23:58:18 PDT 2025
mstorsjo wrote:
Instead of just using `std::map` to deduplicate whole strings, it's also possible to use the `StringTableBuilder` class for deduplicating and doing tail merging of strings - optimizing the string table even further (at the cost of a little longer link time).
This was attempted before in 9ffeaaa0ea54307db309104696a0b6cce6ddda38, but I had to revert it in 4d2eda2bb3156cee63ea486be34b01164b178e10; see the revert commit for an explanation of the issues I ran into, including a suggestion on what one could do to reapply it.
Anyway, using a `std::map` probably is lower overhead than using `StringTableBuilder`, and it keeps the strings in their current order (i.e. the early section names don't end up too far back in the string table).
Do you have any numbers on how much binary size you save with this? It could be interesting to compare with the `StringTableBuilder` case.
https://github.com/llvm/llvm-project/pull/141197
More information about the llvm-commits
mailing list