llvm-project/lld/ELF
Peter Collingbourne 0bb825d208 ELF: Add .interp synthetic sections first in createSyntheticSections().
Our .interp section is not a SyntheticSection. As a result, it terminates the
loop in removeUnusedSyntheticSections(). This has at least two consequences:

- The synthetic .bss and .bss.rel.ro sections are always present in
  dynamically linked executables, even when they are not needed.
- The synthetic .ARM.exidx (and possibly other) sections are always present
  in partitions other than the last one, even when not needed.
  .ARM.exidx in particular is problematic because it assumes that its
  list of code sections is non-empty in getLinkOrderDep(), which can
  lead to a crash if the partition does not have any code sections.

Fix these problems by moving the creation of the .interp sections to the
top of createSyntheticSections(). While here, make the code a little less
error-prone by changing the add() lambdas to take a SyntheticSection instead
of an InputSectionBase.

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

llvm-svn: 373347
2019-10-01 16:10:13 +00:00
..
Arch [mips] Relax jalr/jr instructions using R_MIPS_JALR relocation 2019-09-26 09:13:20 +00:00
AArch64ErrataFix.cpp [ELF][AARCH64] Refactor AArchErrataFix to match changes in ARMErrataFix NFC. 2019-09-17 09:49:30 +00:00
AArch64ErrataFix.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
ARMErrataFix.cpp [ELF][ARM] Fix -Werror buildbots NFC. 2019-09-16 10:07:53 +00:00
ARMErrataFix.h [ELF][ARM] Implement --fix-cortex-a8 to fix erratum 657417 2019-09-16 09:38:38 +00:00
CMakeLists.txt [ELF][ARM] Implement --fix-cortex-a8 to fix erratum 657417 2019-09-16 09:38:38 +00:00
CallGraphSort.cpp Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +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] Add -z separate-loadable-segments to complement separate-code and noseparate-code 2019-09-25 03:39:31 +00:00
DWARF.cpp gdb-index: Wire up str_offsets section to avoid incorrect error message about offsets_base 2019-08-07 22:49:14 +00:00
DWARF.h gdb-index: Wire up str_offsets section to avoid incorrect error message about offsets_base 2019-08-07 22:49:14 +00:00
Driver.cpp [ELF] Add -z separate-loadable-segments to complement separate-code and noseparate-code 2019-09-25 03:39:31 +00: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 Re-submit r367649: Improve raw_ostream so that you can "write" colors using operator<< 2019-08-07 08:08:17 +00:00
EhFrame.cpp [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +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 [ELF] ICF: change a dyn_cast<InputSection> to cast 2019-09-12 16:46:19 +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] Set `referenced` bit of Undefined created by BitcodeFile 2019-08-30 07:10:30 +00:00
InputFiles.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
InputSection.cpp [ELF][PPC] Allow PT_LOAD to have overlapping p_offset ranges 2019-08-20 08:34:25 +00:00
InputSection.h [ELF] Delete SectionBase::assigned 2019-09-24 11:48:46 +00:00
LTO.cpp [LLD] Migrate llvm::make_unique to std::make_unique 2019-08-14 22:28:17 +00: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: Don't merge SHF_LINK_ORDER sections for different output sections in relocatable links. 2019-09-30 20:23:00 +00:00
LinkerScript.h [ELF] Make MergeInputSection merging aware of output sections 2019-09-24 11:48:31 +00:00
MapFile.cpp Fight a bit against global initializers. NFC. 2019-08-22 19:43:27 +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: Move sections referred to by __start_/__stop_ symbols into the main partition. 2019-08-09 00:57:54 +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] accept thinlto options without --plugin-opt= prefix 2019-09-25 01:19:48 +00:00
OutputSections.cpp [ELF] Make MergeInputSection merging aware of output sections 2019-09-24 11:48:31 +00:00
OutputSections.h [ELF] Make MergeInputSection merging aware of output sections 2019-09-24 11:48:31 +00:00
README.md
Relocations.cpp [ELF] Make MergeInputSection merging aware of output sections 2019-09-24 11:48:31 +00:00
Relocations.h [ELF][Hexagon] Replace R_HEXAGON_GOT with R_GOTPLT 2019-08-16 17:01:56 +00:00
ScriptLexer.cpp [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
ScriptLexer.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
ScriptParser.cpp [ELF] Replace error() with errorOrWarn() for the ASSERT command 2019-09-06 16:30:22 +00:00
ScriptParser.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
SymbolTable.cpp [LLD] Simplify the demangleItanium function. NFC. 2019-09-27 12:24:18 +00:00
SymbolTable.h [ELF] Rename odd variable names "New" after r365730. NFC 2019-08-13 06:19:39 +00:00
Symbols.cpp [LLD] Simplify the demangleItanium function. NFC. 2019-09-27 12:24:18 +00:00
Symbols.h [ELF] Initialize 2 fields of Symbol in SymbolTable::insert 2019-08-14 01:52:47 +00:00
SyntheticSections.cpp ELF: Add .interp synthetic sections first in createSyntheticSections(). 2019-10-01 16:10:13 +00:00
SyntheticSections.h [ELF][ARM] Fix crash when discarding InputSections that have .ARM.exidx 2019-09-24 21:44:14 +00:00
Target.cpp [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
Target.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
Thunks.cpp [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
Thunks.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
Writer.cpp ELF: Add .interp synthetic sections first in createSyntheticSections(). 2019-10-01 16:10:13 +00:00
Writer.h Revert "Revert r370635, it caused PR43241." 2019-09-06 15:57:24 +00:00

README.md

See docs/NewLLD.rst