llvm-project/lld/ELF
Fangrui Song 2fb6b0f2ba [ELF][PPC][X86] Use [-2**(n-1), 2**n) to check overflows for R_PPC_ADDR16, R_PPC64_ADDR{16,32}, R_X86_64_{8,16}
Similar to R_AARCH64_ABS32, R_PPC64_ADDR32 can represent either a signed
value or unsigned value, thus we should use `[-2**(n-1), 2**n)` instead of
`[-2**(n-1), 2**(n-1))` to check overflows.

The issue manifests as a bogus linker error when linking the powerpc64le Linux kernel.
The new behavior is compatible with ld.bfd's complain_overflow_bitfield.

The upper bound of the error message is not correct. Fix it as well.

The changes to R_PPC_ADDR16, R_PPC64_ADDR16, R_X86_64_8 and R_X86_64_16 are similar.

Reviewed By: ruiu

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

llvm-svn: 364164
2019-06-24 05:37:20 +00:00
..
Arch [ELF][PPC][X86] Use [-2**(n-1), 2**n) to check overflows for R_PPC_ADDR16, R_PPC64_ADDR{16,32}, R_X86_64_{8,16} 2019-06-24 05:37:20 +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 [Remarks] Extend -fsave-optimization-record to specify the format 2019-06-17 16:06:00 +00:00
DWARF.cpp Revert "Revert "Reland D61583 [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded"" 2019-06-06 20:16:53 +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 [Remarks] Extend -fsave-optimization-record to specify the format 2019-06-17 16:06:00 +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 ELF: Add basic partition data structures and behaviours. 2019-05-29 03:55:20 +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][AArch64] Support for BTI and PAC 2019-06-07 13:00:17 +00:00
InputFiles.h [PPC32] Improve the 32-bit PowerPC port 2019-06-06 17:03:00 +00:00
InputSection.cpp [ELF][RISCV] Treat R_RISCV_{ADD,SET,SUB}* as link-time constants 2019-06-12 07:53:06 +00:00
InputSection.h ELF: Create synthetic sections for loadable partitions. 2019-06-07 17:57:58 +00:00
LTO.cpp [Remarks] Extend -fsave-optimization-record to specify the format 2019-06-17 16:06:00 +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 ELF: Create synthetic sections for loadable partitions. 2019-06-07 17:57:58 +00:00
LinkerScript.h [ELF] Deleted unused forward declarations. NFC 2019-05-24 09:25:47 +00:00
MapFile.cpp ELF: Add basic partition data structures and behaviours. 2019-05-29 03:55:20 +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: Add basic partition data structures and behaviours. 2019-05-29 03:55:20 +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 [Remarks] Extend -fsave-optimization-record to specify the format 2019-06-17 16:06:00 +00:00
OutputSections.cpp ELF: Introduce a separate bit for tracking whether an output section has ever had an input section added to it. NFCI. 2019-06-03 20:14:25 +00:00
OutputSections.h ELF: Introduce a separate bit for tracking whether an output section has ever had an input section added to it. NFCI. 2019-06-03 20:14:25 +00:00
README.md
Relocations.cpp lld/elf: Deduplicate undefined symbol diagnostics 2019-06-20 18:25:57 +00:00
Relocations.h lld/elf: Deduplicate undefined symbol diagnostics 2019-06-20 18:25:57 +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][RISCV] Parse BFD names elf{32,64}-littleriscv 2019-06-10 08:09:55 +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 ELF: Add basic partition data structures and behaviours. 2019-05-29 03:55:20 +00:00
SymbolTable.h Use SymbolTable::insert() to implement --trace. 2019-05-28 06:33:06 +00:00
Symbols.cpp [ELF][RISCV] Create dummy .sdata for __global_pointer$ if .sdata does not exist 2019-06-14 02:14:53 +00:00
Symbols.h [ELF][RISCV] Create dummy .sdata for __global_pointer$ if .sdata does not exist 2019-06-14 02:14:53 +00:00
SyntheticSections.cpp [ELF][RISCV] Create dummy .sdata for __global_pointer$ if .sdata does not exist 2019-06-14 02:14:53 +00:00
SyntheticSections.h [ELF][RISCV] Create dummy .sdata for __global_pointer$ if .sdata does not exist 2019-06-14 02:14:53 +00:00
Target.cpp [PPC64] toc-indirect to toc-relative relaxation 2019-05-07 04:26:05 +00:00
Target.h [ELF][PPC][X86] Use [-2**(n-1), 2**n) to check overflows for R_PPC_ADDR16, R_PPC64_ADDR{16,32}, R_X86_64_{8,16} 2019-06-24 05:37:20 +00:00
Thunks.cpp ELF: Create synthetic sections for loadable partitions. 2019-06-07 17:57:58 +00:00
Thunks.h [PPC32] Improve the 32-bit PowerPC port 2019-06-06 17:03:00 +00:00
Writer.cpp lld/elf: Deduplicate undefined symbol diagnostics 2019-06-20 18:25:57 +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