llvm-capstone/lld/ELF/Arch
Fangrui Song a05384dc89 [ELF] Make --no-relax disable R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX GOT optimization
This brings back the original version of D81359.
I have found several use cases now.

* Unlike GNU ld, LLD's relocation processing is one pass. If we decide to
  optimize(relax) R_X86_64_{,REX_}GOTPCRELX, we will suppress GOT generation and
  cannot undo the decision later. Optimizing R_X86_64_REX_GOTPCRELX can usually
  make it easy to hit `relocation R_X86_64_REX_GOTPCRELX out of range` because
  the distance to GOT is usually shorter. Without --no-relax, the user has to
  recompile with `-Wa,-mrelax-relocations=no`.
* The option would help during my investigationg of the root cause of https://git.kernel.org/linus/09e43968db40c33a73e9ddbfd937f46d5c334924
* There is need for relaxation for AArch64 & RISC-V. Implementing this for
  x86-64 improves consistency with little target-specific cost (two-line
  X86_64.cpp change).

Reviewed By: alexander-shaposhnikov

Differential Revision: https://reviews.llvm.org/D113615
2021-11-12 09:47:31 -08:00
..
AArch64.cpp [ELF] Replace noneRel = R_*_NONE with static constexpr. NFC 2021-09-25 15:16:44 -07:00
AMDGPU.cpp [ELF] Replace noneRel = R_*_NONE with static constexpr. NFC 2021-09-25 15:16:44 -07:00
ARM.cpp [lld][ELF] Support for R_ARM_THM_JUMP8 2021-11-11 09:06:52 -08:00
AVR.cpp [ELF] Replace noneRel = R_*_NONE with static constexpr. NFC 2021-09-25 15:16:44 -07:00
Hexagon.cpp [ELF] Replace noneRel = R_*_NONE with static constexpr. NFC 2021-09-25 15:16:44 -07:00
Mips.cpp [ELF][Mips] Use R_DTPREL for R_MIPS_TLS_DTPREL* 2021-10-30 21:58:43 -07:00
MipsArchTree.cpp [lib/Object] - Refine interface of ELFFile<ELFT>. NFCI. 2020-09-15 11:38:31 +03:00
MSP430.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of namespace lld { namespace elf { 2020-05-15 08:49:53 -07:00
PPC64.cpp [ELF] Inline isPPC64SmallCodeModelTocReloc which is only called once. NFC 2021-11-09 20:41:05 -08:00
PPC.cpp [ELF] Replace noneRel = R_*_NONE with static constexpr. NFC 2021-09-25 15:16:44 -07:00
PPCInsns.def [LLD][PowerPC] Implement GOT to PC-Rel relaxation 2020-08-17 09:36:09 -05:00
RISCV.cpp [ELF] Replace noneRel = R_*_NONE with static constexpr. NFC 2021-09-25 15:16:44 -07:00
SPARCV9.cpp [ELF] Replace noneRel = R_*_NONE with static constexpr. NFC 2021-09-25 15:16:44 -07:00
X86_64.cpp [ELF] Make --no-relax disable R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX GOT optimization 2021-11-12 09:47:31 -08:00
X86.cpp [ELF] Implement TLSDESC for x86-32 2021-10-28 17:52:03 -07:00