llvm-project/lld/ELF
Peter Smith 0ae7990b60 [ELF][ARM] Support /DISCARD/ of subset of .ARM.exidx sections
Both the .ARM.exidx and .eh_frame sections have a custom SyntheticSection
that acts as a container for the InputSections. The InputSections are added
to the SyntheticSection prior to /DISCARD/ which limits the affect a
/DISCARD/ can have to the whole SyntheticSection. In the majority of cases
this is sufficient as it is not common to discard subsets of the
InputSections. The Linux kernel has one of these scripts which has something
like:
/DISCARD/ : { *(.ARM.exidx.exit.text) *(.ARM.extab.exit.text) ... }
The .ARM.exidx.exit.text are not discarded because the InputSection has been
transferred to the Synthetic Section. The *(.ARM.extab.exit.text) sections
have not so they are discarded. When we come to write out the .ARM.exidx
sections the dangling references from .ARM.exidx.exit.text to
.ARM.extab.exit.text currently cause relocation out of range errors, but
could as easily cause a fatal error message if we check for dangling
references at relocation time.

This patch attempts to respect the /DISCARD/ command by running it on the
.ARM.exidx InputSections stored in the SyntheticSection.

The .eh_frame is in theory affected by this problem, but I don't think that
there is a dangling reference problem that can happen with these sections.

Fixes remaining part of pr44824

Differential Revision: https://reviews.llvm.org/D79687
2020-05-11 14:27:13 +01:00
..
Arch [Hexagon] Add R_HEX_GD_PLT_B22/32_PCREL relocations 2020-05-05 11:47:51 -05:00
AArch64ErrataFix.cpp [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it 2020-01-25 12:00:18 -08:00
AArch64ErrataFix.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
ARMErrataFix.cpp [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it 2020-01-25 12:00:18 -08:00
ARMErrataFix.h [ELF][ARM] Implement --fix-cortex-a8 to fix erratum 657417 2019-09-16 09:38:38 +00:00
CMakeLists.txt [ThinLTO] Pass CodeGenOpts like UnrollLoops/VectorizeLoop/VectorizeSLP 2020-01-09 21:13:11 -08:00
CallGraphSort.cpp [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09: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] Add --print-archive-stats= 2020-04-29 18:04:37 -07:00
DWARF.cpp [ELF] --gdb-index: support .debug_loclists 2020-04-29 15:04:13 -07:00
DWARF.h [ELF] --gdb-index: support .debug_loclists 2020-04-29 15:04:13 -07:00
Driver.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
Driver.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
DriverUtils.cpp Remove unused Endian.h includes, NFC 2020-03-11 15:45:34 -07:00
EhFrame.cpp [ELF] Wrap things in `namespace lld { namespace elf {`, NFC 2019-10-07 08:31:18 +00:00
EhFrame.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
ICF.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07: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] Add --print-archive-stats= 2020-04-29 18:04:37 -07:00
InputFiles.h [ELF] Add --print-archive-stats= 2020-04-29 18:04:37 -07:00
InputSection.cpp [ELF][PPC64] Suppress toc-indirect to toc-relative relaxation if R_PPC64_TOC16_LO is seen 2020-04-30 09:16:51 -07:00
InputSection.h [ELF][PPC64] Suppress toc-indirect to toc-relative relaxation if R_PPC64_TOC16_LO is seen 2020-04-30 09:16:51 -07:00
LTO.cpp [LTO] Suppress emission of empty combined module by default 2020-05-04 18:31:09 -07: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][ARM] Support /DISCARD/ of subset of .ARM.exidx sections 2020-05-11 14:27:13 +01:00
LinkerScript.h [ELF][ARM] Support /DISCARD/ of subset of .ARM.exidx sections 2020-05-11 14:27:13 +01:00
MapFile.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
MapFile.h [ELF] Add --print-archive-stats= 2020-04-29 18:04:37 -07:00
MarkLive.cpp [LLD][ELF] Add time-trace to ELF LLD 2020-02-06 12:14:13 +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] Add convenience TableGen classes to enforce two dashes for options not supported by GNU ld 2020-05-08 07:37:06 -07:00
OutputSections.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
OutputSections.h [ELF] Refactor uses of getInputSections to improve efficiency NFC 2020-01-21 12:27:52 +00:00
README.md
Relocations.cpp [Hexagon] Add R_HEX_GD_PLT_B22/32_PCREL relocations 2020-05-05 11:47:51 -05:00
Relocations.h LLD Support for Basic Block Sections 2020-04-07 06:55:57 -07:00
ScriptLexer.cpp [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09:00
ScriptLexer.h [ELF] For relative paths in INPUT() and GROUP(), search the directory of the current linker script before searching other paths 2020-04-22 12:34:20 -07:00
ScriptParser.cpp [ELF] For relative paths in INPUT() and GROUP(), search the directory of the current linker script before searching other paths 2020-04-22 12:34:20 -07:00
ScriptParser.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
SymbolTable.cpp [ELF] Make --version-script/--dynamic-list work for lazy symbols fetched by LTO libcalls 2020-04-06 09:47:06 -07:00
SymbolTable.h [ELF] Replace SymbolTable::forEachSymbol with iterator_range symbols() 2019-11-26 09:09:32 -08:00
Symbols.cpp [ELF] Add --warn-backrefs-exclude=<glob> 2020-04-20 07:52:15 -07:00
Symbols.h [LLD][ELF] Implement --discard-* for cases when -r or --emit-relocs are used. 2020-04-25 18:59:41 +07:00
SyntheticSections.cpp [ELF][ARM] Support /DISCARD/ of subset of .ARM.exidx sections 2020-05-11 14:27:13 +01:00
SyntheticSections.h [LLD][ELF][ARM] recommit Fix ARM Exidx order for non monotonic section order 2020-04-24 13:47:28 +01:00
Target.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Target.h LLD Support for Basic Block Sections 2020-04-07 06:55:57 -07:00
Thunks.cpp [ELF][PPC64] Enable R_PPC64_REL14 trunks 2020-04-04 10:59:17 -07:00
Thunks.h [ELF][PPC32] Implement IPLT code sequence for non-preemptible IFUNC 2019-12-29 22:42:53 -08:00
Writer.cpp [lld] Add a new output section ".text.unknown" for funtions with unknown hotness 2020-05-08 11:14:48 -07:00
Writer.h Revert "Revert r370635, it caused PR43241." 2019-09-06 15:57:24 +00:00

README.md

See docs/NewLLD.rst