llvm-project/lld/ELF
Fangrui Song 8ffb2097cc [ELF] Refine LMA offset propagation rule in D76995
If neither AT(lma) nor AT>lma_region is specified,
D76995 keeps `lmaOffset` (LMA - VMA) if the previous section is in the
default LMA region.

This patch additionally checks that the two sections are in the same
memory region.

Add a test case derived from https://bugs.llvm.org/show_bug.cgi?id=45313

  .mdata : AT(0xfb01000) { *(.data); } > TCM
  // It is odd to make .bss inherit lmaOffset, because the two sections
  // are in different memory regions.
  .bss : { *(.bss) } > DDR

With this patch, section VMA/LMA match GNU ld. Note, GNU ld supports
out-of-order (w.r.t sh_offset) sections and places .text and .bss in the
same PT_LOAD. We don't have that behavior.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D81986
2020-06-19 09:11:33 -07:00
..
Arch [ELF][PPC64] Synthesize _savegpr[01]_{14..31} and _restgpr[01]_{14..31} 2020-05-26 09:35:41 -07:00
AArch64ErrataFix.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07:00
AArch64ErrataFix.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
ARMErrataFix.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07: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 [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07: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 [LLD][ThinLTO] Add --thinlto-single-module to allow compiling partial modules. 2020-06-10 15:32:30 -07:00
DWARF.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07:00
DWARF.h [ELF] --gdb-index: support .debug_loclists 2020-04-29 15:04:13 -07:00
Driver.cpp [ELF] Improve --export-dynamic-symbol performance by checking whether wildcard is really used 2020-06-17 17:12:10 -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 [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07:00
EhFrame.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07: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] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -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] Refactor ObjFile<ELFT>::initializeSymbols to enforce the invariant: InputFile::symbols has non null entry 2020-06-19 09:05:37 -07:00
InputFiles.h [ELF] Demote lazy symbols relative to a discarded section to Undefined 2020-06-09 11:27:34 -07:00
InputSection.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -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 [LLD][ThinLTO] Add --thinlto-single-module to allow compiling partial modules. 2020-06-10 15:32:30 -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] Refine LMA offset propagation rule in D76995 2020-06-19 09:11:33 -07:00
LinkerScript.h [ELF][ARM] Support /DISCARD/ of subset of .ARM.exidx sections 2020-05-11 14:27:13 +01:00
MapFile.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07:00
MapFile.h [ELF] Add --print-archive-stats= 2020-04-29 18:04:37 -07:00
MarkLive.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07: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 [LLD][ThinLTO] Add --thinlto-single-module to allow compiling partial modules. 2020-06-10 15:32:30 -07:00
OutputSections.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -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 [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07:00
Relocations.h LLD Support for Basic Block Sections 2020-04-07 06:55:57 -07:00
ScriptLexer.cpp [ELF] Don't cause assertion failure if --dynamic-list or --version-script takes an empty file 2020-06-05 15:59:54 -07: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] Improve --export-dynamic-symbol performance by checking whether wildcard is really used 2020-06-17 17:12:10 -07:00
ScriptParser.h [ELF] Improve --export-dynamic-symbol performance by checking whether wildcard is really used 2020-06-17 17:12:10 -07:00
SymbolTable.cpp [ELF] --wrap: don't error `undefined reference to __real_foo` (--no-allow-shlib-undefined) if foo is a wrapped definition 2020-06-01 23:00:51 -07:00
SymbolTable.h [ELF] Replace SymbolTable::forEachSymbol with iterator_range symbols() 2019-11-26 09:09:32 -08:00
Symbols.cpp [ELF] Refine --export-dynamic-symbol semantics to be compatible GNU ld 2.35 2020-06-01 11:30:03 -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] Set DF_1_PIE for -pie 2020-06-01 10:19:41 -07: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 [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07:00
Target.h [ELF][PPC64] Synthesize _savegpr[01]_{14..31} and _restgpr[01]_{14..31} 2020-05-26 09:35:41 -07:00
Thunks.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07:00
Thunks.h [ELF][PPC32] Implement IPLT code sequence for non-preemptible IFUNC 2019-12-29 22:42:53 -08:00
Writer.cpp [ELF] Refactor ObjFile<ELFT>::initializeSymbols to enforce the invariant: InputFile::symbols has non null entry 2020-06-19 09:05:37 -07:00
Writer.h Revert "Revert r370635, it caused PR43241." 2019-09-06 15:57:24 +00:00

README.md

See docs/NewLLD.rst