Revert "[LLD] [COFF] Use StringTableBuilder to optimize the string table"
This reverts commit 9ffeaaa0. This fixes debugging large executables with lldb and gdb. When StringTableBuilder is used, the string offsets for any string can point anywhere in the string table - while previously, all strings were inserted in order (without deduplication and tail merging). For symbols, there's no complications in encoding the string offset; the offset is encoded as a raw 32 bit binary number in half of the symbol name field. For sections, the string table offset is written as "/<decimaloffset>", but if the decimal offset would be larger than 7 digits, it's instead written as "//<base64offset>". Tools that operate on object files can handle the base64 offset format, but apparently neither lldb nor gdb expect that syntax when locating the debug information section. Prior to the reverted commit, all long section names were located at the start of the string table, so their offset never exceeded the range for the decimal syntax. Just reverting this change for now, as the actual benefit from it was fairly modest. Longer term, lld could write all long section names unoptimized at the start of the string table, followed by all the strings for symbol names, with deduplication and tail merging. And lldb and gdb could be fixed to handle sections with the base64 offset syntax. This fixes https://github.com/mstorsjo/llvm-mingw/issues/289.
Loading
Please sign in to comment