llvm-project/lld/ELF
Fangrui Song 5d3b3188f7 Reland D61583 [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded
This is implemented by creating Undefined (instead of Defined) for such
local STT_SECTION symbols. It allows us to catch errors when there are
relocations to such discarded sections (e.g. in PR41693, ld.bfd and gold
error but we don't). Updated comdat-discarded-error.s checks we emit
friendly error message.

For relocatable-eh-frame.s, ld.lld -r a.o a.o will now error
"STT_SECTION symbol should be defined" because the section .eh_frame
refers to is now an Undefined instead of a Defined.
So I have to change `error()` to `warn()` to retain the output.

rLLD361144 inadvertently enabled the error for --gdb-index
(in LLDDwarfObj<ELFT>::findAux()).

Relocations from .debug_info (not in comdat) to .text.* (in comdat) for
DW_AT_low_pc are common. If an .text.* was discarded, rLLD361144 would error,
which was unexpected. (Note, if we don't error as this patch does,
InputSection::relocateNonAlloc() will resolve such relocations).

llvm-svn: 361830
2019-05-28 14:34:28 +00:00
..
Arch [LLD][ELF] - Improve diagnostic about unrecognized relocations. 2019-05-23 09:50:18 +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
CMakeLists.txt Fail early if an output file is not writable 2019-03-11 16:30:55 +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
Config.h [ELF] Implement Dependent Libraries Feature 2019-05-17 03:44:15 +00:00
DWARF.cpp Reland D61583 [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded 2019-05-28 14:34:28 +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
Driver.cpp Use SymbolTable::insert() to implement --trace. 2019-05-28 06:33:06 +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
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 Use llvm::stable_sort 2019-04-23 02:42:06 +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 Reland D61583 [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded 2019-05-28 14:34:28 +00:00
InputFiles.h Merge ELFFileBase::{initSymtab,parseHeader} as ELFFileBase:init. NFC. 2019-05-28 05:17:21 +00:00
InputSection.cpp Reland D61583 [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded 2019-05-28 14:34:28 +00:00
InputSection.h Revert r358069 "Discard debuginfo for object files empty after GC" 2019-05-16 23:33:06 +00:00
LTO.cpp Use SymbolTable::insert() to implement --trace. 2019-05-28 06:33:06 +00:00
LTO.h [ELF] Reorder BitcodeFiles.empty() to call thinLTOCreateEmptyIndexFiles() in only one place 2019-05-07 10:40:26 +00:00
LinkerScript.cpp Move code for symbol resolution from SymbolTable.cpp to Symbols.cpp. 2019-05-23 09:58:08 +00:00
LinkerScript.h [ELF] Deleted unused forward declarations. NFC 2019-05-24 09:25:47 +00:00
MapFile.cpp ELF: Remove a comparison against In.EhFrame. NFCI. 2019-05-23 21:30:30 +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 Use SymbolTable::insert() to implement --trace. 2019-05-28 06:33:06 +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 [ELF] Implement Dependent Libraries Feature 2019-05-17 03:44:15 +00:00
OutputSections.cpp Use llvm::stable_sort 2019-04-23 02:42:06 +00:00
OutputSections.h [LLD][ELF] - Do not remove empty sections referenced in LOADADDR/ADDR commands. 2019-04-26 06:59:30 +00:00
README.md Update the documents of the new LLD. 2016-03-12 06:06:40 +00:00
Relocations.cpp Reland D61583 [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded 2019-05-28 14:34:28 +00:00
Relocations.h [PPC64] toc-indirect to toc-relative relaxation 2019-05-07 04:26:05 +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] Full support for -n (--nmagic) and -N (--omagic) via common page 2019-05-13 16:01:26 +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
SymbolTable.cpp Use SymbolTable::insert() to implement --trace. 2019-05-28 06:33:06 +00:00
SymbolTable.h Use SymbolTable::insert() to implement --trace. 2019-05-28 06:33:06 +00:00
Symbols.cpp [lld] Trace all references with lld --trace-symbol 2019-05-24 13:29:17 +00:00
Symbols.h [lld] Trace all references with lld --trace-symbol 2019-05-24 13:29:17 +00:00
SyntheticSections.cpp [ELF] -z combreloc: sort dynamic relocations by (!is_relative,symbol_index,r_offset) 2019-05-20 15:25:01 +00:00
SyntheticSections.h ELF: Remove a comparison against In.EhFrame. NFCI. 2019-05-23 21:30:30 +00:00
Target.cpp [PPC64] toc-indirect to toc-relative relaxation 2019-05-07 04:26:05 +00:00
Target.h [ELF] Full support for -n (--nmagic) and -N (--omagic) via common page 2019-05-13 16:01:26 +00:00
Thunks.cpp [mips] Remove redundant setup of less-significant bit. NFC 2019-03-13 16:00:35 +00:00
Thunks.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Writer.cpp [ELF] Replace two addSymbol() call sites with Symbol::resolve(). NFC 2019-05-28 10:12:06 +00:00
Writer.h [ELF] Delete unused forward declarations and unused DynamicReloc::getInputSec(). NFC 2019-03-15 07:16:39 +00:00

README.md

See docs/NewLLD.rst