llvm-project/lld/ELF
Fangrui Song 88d66f6ed1 [ELF] Move duplicate symbol check after input file parsing
https://discourse.llvm.org/t/parallel-input-file-parsing/60164

To decouple symbol initialization and section initialization, `Defined::section`
assignment should be postponed after input file parsing. To avoid spurious
duplicate definition error due to two definitions in COMDAT groups of the same
signature, we should postpone the duplicate symbol check.

The function is called postScan instead of a more specific name like
checkDuplicateSymbols, because we may merge Symbol::mergeProperties into
postScan. It is placed after compileBitcodeFiles to apply to ET_REL files
produced by LTO. This causes minor diagnostic regression
for skipLinkedOutput configurations: ld.lld --thinlto-index-only a.bc b.o
(bitcode definition prevails) won't detect duplicate symbol error. I think this
is an acceptable compromise. The important cases where (a) both files are
bitcode or (b) --thinlto-index-only is unused are still detected.

Reviewed By: ikudrin

Differential Revision: https://reviews.llvm.org/D119908
2022-02-22 10:07:58 -08:00
..
Arch [ELF] Replace uncompressed InputSectionBase::data() with rawData. NFC 2022-02-21 00:39:26 -08:00
AArch64ErrataFix.cpp [ELF] Replace uncompressed InputSectionBase::data() with rawData. NFC 2022-02-21 00:39:26 -08:00
AArch64ErrataFix.h [ELF] AArch64ErrataFix: replace std::map with DenseMap. NFC 2022-02-07 22:02:25 -08:00
ARMErrataFix.cpp [ELF] Replace uncompressed InputSectionBase::data() with rawData. NFC 2022-02-21 00:39:26 -08:00
ARMErrataFix.h [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
CMakeLists.txt [ELF] Parallelize --compress-debug-sections=zlib 2022-01-25 10:29:04 -08:00
CallGraphSort.cpp [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
CallGraphSort.h
Config.h [ELF] Remove obscure -dp and GNU ld incompatible --[no-]define-common, ignore -d/-dc 2022-02-09 10:35:53 -08:00
DWARF.cpp [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
DWARF.h [ELF] --gdb-index: skip SHF_GROUP .debug_info 2020-08-13 09:11:01 -07:00
Driver.cpp [ELF] Move duplicate symbol check after input file parsing 2022-02-22 10:07:58 -08:00
Driver.h [ELF] Parse archives as --start-lib object files 2022-02-15 09:38:00 -08:00
DriverUtils.cpp [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
EhFrame.cpp [ELF] Replace uncompressed InputSectionBase::data() with rawData. NFC 2022-02-21 00:39:26 -08:00
EhFrame.h [ELF] Simplify/optimize EhInputSection::split 2022-01-18 17:03:23 -08:00
ICF.cpp [ELF] Replace uncompressed InputSectionBase::data() with rawData. NFC 2022-02-21 00:39:26 -08:00
ICF.h
InputFiles.cpp [ELF] Move duplicate symbol check after input file parsing 2022-02-22 10:07:58 -08:00
InputFiles.h [ELF] Move duplicate symbol check after input file parsing 2022-02-22 10:07:58 -08:00
InputSection.cpp [ELF] Replace uncompressed InputSectionBase::data() with rawData. NFC 2022-02-21 00:39:26 -08:00
InputSection.h [ELF] Replace uncompressed InputSectionBase::data() with rawData. NFC 2022-02-21 00:39:26 -08:00
LTO.cpp [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
LTO.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
LinkerScript.cpp [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
LinkerScript.h [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
MapFile.cpp [ELF] Parse archives as --start-lib object files 2022-02-15 09:38:00 -08:00
MapFile.h [ELF] --cref: If -Map is specified, print to the map file 2021-11-29 14:14:53 -08:00
MarkLive.cpp [ELF] Replace uncompressed InputSectionBase::data() with rawData. NFC 2022-02-21 00:39:26 -08:00
MarkLive.h
Options.td [ELF] Remove obscure -dp and GNU ld incompatible --[no-]define-common, ignore -d/-dc 2022-02-09 10:35:53 -08:00
OutputSections.cpp [ELF] Change (NOLOAD) section type mismatch error to warning 2022-02-18 11:20:36 -08:00
OutputSections.h [ELF] Support (TYPE=<value>) to customize the output section type 2022-02-17 12:10:58 -08:00
README.md
Relocations.cpp [ELF] Replace uncompressed InputSectionBase::data() with rawData. NFC 2022-02-21 00:39:26 -08:00
Relocations.h [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
ScriptLexer.cpp [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
ScriptLexer.h [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
ScriptParser.cpp [ELF] Support (TYPE=<value>) to customize the output section type 2022-02-17 12:10:58 -08:00
ScriptParser.h [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
SymbolTable.cpp [ELF] Move duplicate symbol check after input file parsing 2022-02-22 10:07:58 -08:00
SymbolTable.h [ELF] Move duplicate symbol check after input file parsing 2022-02-22 10:07:58 -08:00
Symbols.cpp [ELF] Move duplicate symbol check after input file parsing 2022-02-22 10:07:58 -08:00
Symbols.h [ELF] Move duplicate symbol check after input file parsing 2022-02-22 10:07:58 -08:00
SyntheticSections.cpp [ELF] Replace uncompressed InputSectionBase::data() with rawData. NFC 2022-02-21 00:39:26 -08:00
SyntheticSections.h [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
Target.cpp [ELF] De-template getErrorPlace. NFC 2022-01-29 23:05:54 -08:00
Target.h [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
Thunks.cpp [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
Thunks.h [lld] Add missing includes (NFC) 2021-06-03 18:55:18 +02:00
Writer.cpp [ELF] Replace uncompressed InputSectionBase::data() with rawData. NFC 2022-02-21 00:39:26 -08:00
Writer.h [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00

README.md

See docs/NewLLD.rst