llvm-project/lld/ELF
George Rimar 69186f82f3 [LLD][ELF] - A fix for "linker script assignment loses relative nature of section" bug.
This is https://bugs.llvm.org//show_bug.cgi?id=39857.
I added the comment with much more details to the bug page,
the short version is below.

The following script and code demonstrates the issue:

aliasto__text = __text;
 SECTIONS {
  .text 0x1000 : { __text = . ; *(.text) }
 }
...
call aliasto__text

LLD fails with "cannot refer to absolute symbol: aliasto__text" error.
It happens because at the moment of scanning the relocations
we do not yet assign the correct/final/any section value for the symbol aliasto__text.
I made a change to Relocations.cpp to fix that.

Also, I had to remove the symbol-location.s test case completely, because now it does not
trigger any error. Since now all linker scripts symbols are resolved to constants, no
errors can be triggered at all it seems. I checked that it is consistent with the behavior
of bfd and gold (they do not trigger errors for the case from symbol-location.s), so it should
be OK. I.e. at least it is probably not the best possible, but natural behavior we obtained.

Differential revision: https://reviews.llvm.org/D55423

llvm-svn: 358652
2019-04-18 10:00:37 +00:00
..
Arch [RISCV] Fix range check for HI20/LO12/RVC_LUI relocations 2019-04-09 11:39:23 +00:00
AArch64ErrataFix.cpp [ELF][MachO][wasm] Simplify range-style std::find{,_if} with STLExtras.h utilities. NFC 2019-03-29 16:21:16 +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 Replace `typedef A B` with `using B = A`. NFC. 2019-04-01 00:11:24 +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] Dump symbols ordered by profiled guided section layout to file. 2019-03-27 23:52:22 +00:00
DWARF.cpp [ELF] Use llvm::bsearch. NFC 2019-04-17 08:00:46 +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 Discard debuginfo for object files empty after GC 2019-04-10 10:37:10 +00:00
Driver.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DriverUtils.cpp Remove a function from header and move the implementation to a .cpp file. NFC. 2019-02-22 23:59:43 +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 COFF, ELF: ICF: Perform 2 rounds of relocation hash propagation. 2019-01-22 23:54:49 +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 Rename a variable and add a comment. 2019-04-10 06:32:05 +00:00
InputFiles.h [ELF] Fix typo: .symtab_shndxr -> .symtab_shndx 2019-04-12 02:20:52 +00:00
InputSection.cpp [ELF] Use llvm::bsearch. NFC 2019-04-17 08:00:46 +00:00
InputSection.h [ELF] Place SectionPiece::{Live,Hash} bit fields together 2019-04-18 07:46:09 +00:00
LTO.cpp Reland "[Remarks] Add -foptimization-record-passes to filter remark emission" 2019-03-12 21:22:27 +00:00
LTO.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LinkerScript.cpp [ELF] Respect NonAlloc when copying flags from the previous sections 2019-04-18 09:22:05 +00:00
LinkerScript.h Replace `typedef A B` with `using B = A`. NFC. 2019-04-01 00:11:24 +00:00
MapFile.cpp Replace `typedef A B` with `using B = A`. NFC. 2019-04-01 00:11:24 +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 Discard debuginfo for object files empty after GC 2019-04-10 10:37:10 +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] Dump symbols ordered by profiled guided section layout to file. 2019-03-27 23:52:22 +00:00
OutputSections.cpp Replace `typedef A B` with `using B = A`. NFC. 2019-04-01 00:11:24 +00:00
OutputSections.h [ELF] Delete unused forward declarations and unused DynamicReloc::getInputSec(). NFC 2019-03-15 07:16:39 +00:00
README.md Update the documents of the new LLD. 2016-03-12 06:06:40 +00:00
Relocations.cpp [LLD][ELF] - A fix for "linker script assignment loses relative nature of section" bug. 2019-04-18 10:00:37 +00:00
Relocations.h Replace `typedef A B` with `using B = A`. NFC. 2019-04-01 00:11:24 +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] Respect NonAlloc when copying flags from the previous sections 2019-04-18 09:22:05 +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 De-template SymbolTable::addShared. 2019-04-09 08:52:00 +00:00
SymbolTable.h De-template SymbolTable::addShared. 2019-04-09 08:52:00 +00:00
Symbols.cpp [ELF] Emit weak-undef symbols in .dynsym of a PIE binary only if linked against shared libs. 2019-03-18 15:32:57 +00:00
Symbols.h ELF: De-template SharedFile. NFCI. 2019-04-08 17:35:55 +00:00
SyntheticSections.cpp [ELF] Place SectionPiece::{Live,Hash} bit fields together 2019-04-18 07:46:09 +00:00
SyntheticSections.h [ELF] Place SectionPiece::{Live,Hash} bit fields together 2019-04-18 07:46:09 +00:00
Target.cpp De-template X86_64TargetInfo. NFC. 2019-03-28 17:31:12 +00:00
Target.h Create an instance of Target after reading all input files. NFC. 2019-03-28 17:38:53 +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 [LLD][ELF] - Fix the different behavior of the linker script symbols on different platforms. 2019-04-18 08:15:54 +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