llvm-project/lld/test
Fangrui Song bf535ac4a2 [ELF][AArch64] Support R_AARCH64_{CALL26,JUMP26} range extension thunks with addends
Fixes AArch64 part of PR40438

The current range extension thunk framework does not handle a relocation
relative to a STT_SECTION symbol with a non-zero addend, which may be
used by jumps/calls to local functions on some RELA targets (AArch64,
powerpc ELFv1, powerpc64 ELFv2, etc).  See PR40438 and the following
code for examples:

  // clang -target $target a.cc
  // .text.cold may be placed in a separate output section.
  // The distance between bar in .text.cold and foo in .text may be larger than 128MiB.
  static void foo() {}
  __attribute__((section(".text.cold"))) static int bar() { foo(); return
  0; }
  __attribute__((used)) static int dummy = bar();

This patch makes such thunks with addends work for AArch64. The target
independent part can be reused by PPC in the future.

On REL targets (ARM, MIPS), jumps/calls are not represented as
STT_SECTION + non-zero addend (see
MCELFObjectTargetWriter::needsRelocateWithSymbol), so they don't need
this feature, but we need to make sure this patch does not affect them.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D70637
2019-12-02 10:07:24 -08:00
..
COFF [COFF] Don't error if the only inputs are from /wholearchive: 2019-11-15 16:09:07 -08:00
Driver/Inputs
ELF [ELF][AArch64] Support R_AARCH64_{CALL26,JUMP26} range extension thunks with addends 2019-12-02 10:07:24 -08:00
MinGW Use error instead of fatal to report usage errors 2019-10-10 09:46:41 +00:00
Unit
darwin [Darwin] Do not error on '-lto_library' option 2018-06-13 18:59:14 +00:00
mach-o [LLD] - Fix a test after obj2yaml change. 2019-10-30 18:28:52 +03:00
wasm [WebAssembly][lld] Fix for static linking of PIC code 2019-10-29 18:58:56 -07:00
CMakeLists.txt lld-link: Reject more than one resource .obj file 2019-06-11 15:22:28 +00:00
lit.cfg.py ELF: Change FileSize back to a uint64_t. 2019-03-01 18:53:41 +00:00
lit.site.cfg.py.in ELF: Change FileSize back to a uint64_t. 2019-03-01 18:53:41 +00:00