llvm/lld/COFF
Martin Storsjö 9dd2d50984 [LLD] [COFF] Use the new encodeSectionName() helper for long section names
The previous code used an unbounded sprintf, which in theory can
overflow, writing either the null terminator or the last digits
into the next struct member.

In practice, in LLD, all long section names are written sequentially
first at the start of the string table, followed by all the long
symbol names. Due to this, even if the total string table would
end up large, the long section names have fairly short offsets,
which is why this hasn't been an issue in practice.

I don't think it's worth trying to write a test that produces an
executable with enough long section names to make the section names
themselves exceed 10^6 bytes, which is currently necessary to trigger
faults with the previous form.

Differential Revision: https://reviews.llvm.org/D120676
2022-03-01 11:33:02 +02:00
..
CallGraphSort.cpp
CallGraphSort.h
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
CMakeLists.txt Reland: Make lld-link work in a non-MSVC shell, add /winsysroot: 2022-02-16 09:22:39 -05:00
COFFLinkerContext.cpp
COFFLinkerContext.h Re-land [LLD] Remove global state in lldCommon 2022-01-20 14:53:26 -05:00
Config.h [LLD][COFF] Support GNU style == aliases 2022-01-19 14:22:13 +01:00
DebugTypes.cpp
DebugTypes.h
DLL.cpp Re-land [LLD] Remove global state in lldCommon 2022-01-20 14:53:26 -05:00
DLL.h
Driver.cpp Reland: Make lld-link work in a non-MSVC shell, add /winsysroot: 2022-02-16 09:22:39 -05: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
ICF.h
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
LLDMapFile.h
LTO.cpp Re-land [LLD] Remove global state in lldCommon 2022-01-20 14:53:26 -05:00
LTO.h
MapFile.cpp
MapFile.h
MarkLive.cpp
MarkLive.h
MinGW.cpp Re-land [LLD] Remove global state in lldCommon 2022-01-20 14:53:26 -05:00
MinGW.h
Options.td Reland: Make lld-link work in a non-MSVC shell, add /winsysroot: 2022-02-16 09:22:39 -05:00
PDB.cpp Cleanup llvm/DebugInfo/PDB headers 2022-02-23 10:31:34 +01:00
PDB.h
README.md
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
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
TypeMerger.h
Writer.cpp [LLD] [COFF] Use the new encodeSectionName() helper for long section names 2022-03-01 11:33:02 +02:00
Writer.h

See docs/NewLLD.rst