llvm-capstone/lld/ELF
Nico Weber 2c45043415 lld/elf: Deduplicate undefined symbol diagnostics
Before:

```
ld.lld: error: undefined symbol: f()
>>> referenced by test.cc:3
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-9c0808.o:(g())

ld.lld: error: undefined symbol: f()
>>> referenced by test.cc:4
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-9c0808.o:(h())

ld.lld: error: undefined symbol: f()
>>> referenced by test.cc:5
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-9c0808.o:(j())

ld.lld: error: undefined symbol: k()
>>> referenced by test.cc:5
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-9c0808.o:(j())

ld.lld: error: undefined symbol: f()
>>> referenced by test2.cc:2
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test2-07b391.o:(asdf())
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

Now:

```
ld.lld: error: undefined symbol: f()
>>> referenced by test.cc:3
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-0e07ba.o:(g())
>>> referenced by test.cc:4
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-0e07ba.o:(h())
>>> referenced by test.cc:5
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-0e07ba.o:(j())
>>> referenced by test2.cc:2
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test2-6bdb24.o:(asdf())

ld.lld: error: undefined symbol: k()
>>> referenced by test.cc:5
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-0e07ba.o:(j())
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

If there are more than 10 references to an undefined symbol, only the
first 10 are printed.

Fixes PR42260.

Differential Revision: https://reviews.llvm.org/D63344

llvm-svn: 363962
2019-06-20 18:25:57 +00:00
..
Arch [ELF][ARM][AARCH64][MIPS][PPC] Simplify the logic to create R_*_RELATIVE for absolute relocation types in writable sections 2019-06-20 14:00:08 +00:00
AArch64ErrataFix.cpp Use llvm::stable_sort 2019-04-23 02:42:06 +00:00
AArch64ErrataFix.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CallGraphSort.cpp Use llvm::stable_sort 2019-04-23 02:42:06 +00:00
CallGraphSort.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt Fail early if an output file is not writable 2019-03-11 16:30:55 +00:00
Config.h [Remarks] Extend -fsave-optimization-record to specify the format 2019-06-17 16:06:00 +00:00
Driver.cpp [Remarks] Extend -fsave-optimization-record to specify the format 2019-06-17 16:06:00 +00:00
Driver.h Move SymbolTable::addCombinedLTOObject() to LinkerDriver. 2019-05-23 09:26:27 +00:00
DriverUtils.cpp [ELF] Implement Dependent Libraries Feature 2019-05-17 03:44:15 +00:00
DWARF.cpp Revert "Revert "Reland D61583 [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded"" 2019-06-06 20:16:53 +00:00
DWARF.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
EhFrame.cpp [ELF][MachO][wasm] Simplify range-style std::find{,_if} with STLExtras.h utilities. NFC 2019-03-29 16:21:16 +00:00
EhFrame.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ICF.cpp ELF: Add basic partition data structures and behaviours. 2019-05-29 03:55:20 +00:00
ICF.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InputFiles.cpp [ELF][AArch64] Support for BTI and PAC 2019-06-07 13:00:17 +00:00
InputFiles.h [PPC32] Improve the 32-bit PowerPC port 2019-06-06 17:03:00 +00:00
InputSection.cpp [ELF][RISCV] Treat R_RISCV_{ADD,SET,SUB}* as link-time constants 2019-06-12 07:53:06 +00:00
InputSection.h ELF: Create synthetic sections for loadable partitions. 2019-06-07 17:57:58 +00:00
LinkerScript.cpp ELF: Create synthetic sections for loadable partitions. 2019-06-07 17:57:58 +00:00
LinkerScript.h [ELF] Deleted unused forward declarations. NFC 2019-05-24 09:25:47 +00:00
LTO.cpp [Remarks] Extend -fsave-optimization-record to specify the format 2019-06-17 16:06:00 +00:00
LTO.h [ELF] Reorder BitcodeFiles.empty() to call thinLTOCreateEmptyIndexFiles() in only one place 2019-05-07 10:40:26 +00:00
MapFile.cpp ELF: Add basic partition data structures and behaviours. 2019-05-29 03:55:20 +00:00
MapFile.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MarkLive.cpp ELF: Add basic partition data structures and behaviours. 2019-05-29 03:55:20 +00:00
MarkLive.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Options.td [Remarks] Extend -fsave-optimization-record to specify the format 2019-06-17 16:06:00 +00:00
OutputSections.cpp ELF: Introduce a separate bit for tracking whether an output section has ever had an input section added to it. NFCI. 2019-06-03 20:14:25 +00:00
OutputSections.h ELF: Introduce a separate bit for tracking whether an output section has ever had an input section added to it. NFCI. 2019-06-03 20:14:25 +00:00
README.md Update the documents of the new LLD. 2016-03-12 06:06:40 +00:00
Relocations.cpp lld/elf: Deduplicate undefined symbol diagnostics 2019-06-20 18:25:57 +00:00
Relocations.h lld/elf: Deduplicate undefined symbol diagnostics 2019-06-20 18:25:57 +00:00
ScriptLexer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ScriptLexer.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ScriptParser.cpp [ELF][RISCV] Parse BFD names elf{32,64}-littleriscv 2019-06-10 08:09:55 +00:00
ScriptParser.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Symbols.cpp [ELF][RISCV] Create dummy .sdata for __global_pointer$ if .sdata does not exist 2019-06-14 02:14:53 +00:00
Symbols.h [ELF][RISCV] Create dummy .sdata for __global_pointer$ if .sdata does not exist 2019-06-14 02:14:53 +00:00
SymbolTable.cpp ELF: Add basic partition data structures and behaviours. 2019-05-29 03:55:20 +00:00
SymbolTable.h Use SymbolTable::insert() to implement --trace. 2019-05-28 06:33:06 +00:00
SyntheticSections.cpp [ELF][RISCV] Create dummy .sdata for __global_pointer$ if .sdata does not exist 2019-06-14 02:14:53 +00:00
SyntheticSections.h [ELF][RISCV] Create dummy .sdata for __global_pointer$ if .sdata does not exist 2019-06-14 02:14:53 +00:00
Target.cpp [PPC64] toc-indirect to toc-relative relaxation 2019-05-07 04:26:05 +00:00
Target.h [ELF][ARM][AARCH64][MIPS][PPC] Simplify the logic to create R_*_RELATIVE for absolute relocation types in writable sections 2019-06-20 14:00:08 +00:00
Thunks.cpp ELF: Create synthetic sections for loadable partitions. 2019-06-07 17:57:58 +00:00
Thunks.h [PPC32] Improve the 32-bit PowerPC port 2019-06-06 17:03:00 +00:00
Writer.cpp lld/elf: Deduplicate undefined symbol diagnostics 2019-06-20 18:25:57 +00:00
Writer.h [ELF] Delete unused forward declarations and unused DynamicReloc::getInputSec(). NFC 2019-03-15 07:16:39 +00:00

See docs/NewLLD.rst