[LLD] [COFF] Use StringTableBuilder to optimize the string table
authorMartin Storsjö <martin@martin.st>
Mon, 28 Feb 2022 11:01:51 +0000 (13:01 +0200)
committerMartin Storsjö <martin@martin.st>
Tue, 1 Mar 2022 16:44:03 +0000 (18:44 +0200)
commit9ffeaaa0ea54307db309104696a0b6cce6ddda38
tree216c129ef51b263d35744750f193f7846b783b00
parentf9c545e1e2250e8a428730416a7e90f0a0ebe2ea
[LLD] [COFF] Use StringTableBuilder to optimize the string table

This does tail merging (and deduplication) of the strings.

On a statically linked clang.exe, this shrinks the ~17 MB string
table by around 0.5 MB. This adds ~160 ms to the linking time
which originally was around 950 ms.

For cases where `-debug:symtab` or `-debug:dwarf` isn't set, the
string table is only used for long section names, where this
shouldn't make any difference at all.

Differential Revision: https://reviews.llvm.org/D120677
lld/COFF/Writer.cpp