llvm-project/lld/COFF
Martin Storsjö 4d2eda2bb3 Revert "[LLD] [COFF] Use StringTableBuilder to optimize the string table"
This reverts commit 9ffeaaa0ea.

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.
2022-06-21 13:25:08 +03:00
..
CMakeLists.txt Reland: Make lld-link work in a non-MSVC shell, add /winsysroot: 2022-02-16 09:22:39 -05:00
COFFLinkerContext.cpp Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
COFFLinkerContext.h Re-land [LLD] Remove global state in lldCommon 2022-01-20 14:53:26 -05:00
CallGraphSort.cpp Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
CallGraphSort.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
Chunks.cpp Revert "Rename llvm::array_lengthof into llvm::size to match std::size from C++17" 2022-01-26 16:55:53 +01:00
Chunks.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
Config.h [LLD][COFF] Add support for /noimplib 2022-04-13 10:32:44 +02:00
DLL.cpp Re-land [LLD] Remove global state in lldCommon 2022-01-20 14:53:26 -05:00
DLL.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
DebugTypes.cpp Rename parallelForEachN to just parallelFor 2022-06-19 17:49:00 -04:00
DebugTypes.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
Driver.cpp Don't use Optional::getValue (NFC) 2022-06-20 23:35:53 -07:00
Driver.h Reland: Make lld-link work in a non-MSVC shell, add /winsysroot: 2022-02-16 09:22:39 -05:00
DriverUtils.cpp Re-land [LLD] Remove global state in lldCommon 2022-01-20 14:53:26 -05:00
ICF.cpp Rename parallelForEachN to just parallelFor 2022-06-19 17:49:00 -04:00
ICF.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
InputFiles.cpp Re-land [LLD] Remove global state in lldCommon 2022-01-20 14:53:26 -05:00
InputFiles.h [lld-link] Replace LazyObjFile with lazy ObjFile/BitcodeFile 2022-01-04 15:11:44 -08:00
LLDMapFile.cpp Rename parallelForEachN to just parallelFor 2022-06-19 17:49:00 -04:00
LLDMapFile.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
LTO.cpp [lld] Remove support for legacy pass manager 2022-04-07 10:17:31 +02:00
LTO.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
MapFile.cpp Rename parallelForEachN to just parallelFor 2022-06-19 17:49:00 -04:00
MapFile.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
MarkLive.cpp Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
MarkLive.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
MinGW.cpp Re-land [LLD] Remove global state in lldCommon 2022-01-20 14:53:26 -05:00
MinGW.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
Options.td [LLD][COFF] Ignore /pdbcompress flag 2022-06-20 16:48:39 -07:00
PDB.cpp Cleanup llvm/DebugInfo/PDB headers 2022-02-23 10:31:34 +01:00
PDB.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
README.md
SymbolTable.cpp Reland: Make lld-link work in a non-MSVC shell, add /winsysroot: 2022-02-16 09:22:39 -05:00
SymbolTable.h [lld-link] Replace LazyObjFile with lazy ObjFile/BitcodeFile 2022-01-04 15:11:44 -08:00
Symbols.cpp [lld] Add support for other demanglers other than Itanium 2022-01-05 03:25:41 +00:00
Symbols.h [lld-link] Replace LazyObjFile with lazy ObjFile/BitcodeFile 2022-01-04 15:11:44 -08:00
TypeMerger.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00
Writer.cpp Revert "[LLD] [COFF] Use StringTableBuilder to optimize the string table" 2022-06-21 13:25:08 +03:00
Writer.h Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures 2021-09-17 17:18:42 -07:00

README.md

See docs/NewLLD.rst