llvm-project/lld/test
Fangrui Song 03ffe58605 [ELF][PPC64] Don't perform toc-indirect to toc-relative relaxation for R_PPC64_TOC16_HA not followed by R_PPC64_TOC16_LO_DS
The current implementation assumes that R_PPC64_TOC16_HA is always followed
by R_PPC64_TOC16_LO_DS. This can break with:

// Load the address of the TOC entry, instead of the value stored at that address
  addis 3, 2, .LC0@tloc@ha  # R_PPC64_TOC16_HA
  addi  3, 3, .LC0@tloc@l   # R_PPC64_TOC16_LO
  blr

which is used by boringssl's util/fipstools/delocate/delocate.go
https://github.com/google/boringssl/blob/master/crypto/fipsmodule/FIPS.md has some documentation.
In short, this tool converts an assembly file to avoid any potential relocations.
The distance to an input .toc is not a constant after linking, so the assembly cannot use an `addis;ld` pair.
Instead, delocate changes the code to jump to a stub (`addis;addi`) which loads the TOC entry address.

Reviewed By: sfertile

Differential Revision: https://reviews.llvm.org/D78431
2020-04-28 12:13:27 -07:00
..
COFF [COFF] Assign unique identifiers to ObjFiles from LTO 2020-04-17 17:15:12 -07:00
Driver/Inputs
ELF [ELF][PPC64] Don't perform toc-indirect to toc-relative relaxation for R_PPC64_TOC16_HA not followed by R_PPC64_TOC16_LO_DS 2020-04-28 12:13:27 -07:00
MachO Revert "[lld-macho] Add basic symbol table output" 2020-04-28 11:34:03 -07:00
MinGW Use error instead of fatal to report usage errors 2019-10-10 09:46:41 +00:00
Unit build: use `find_package(Python3)` if available 2020-04-28 09:24:27 -07:00
darwin
mach-o [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09:00
wasm [lld][WebAssembly] Fix crash on function signature mismatch with --relocatable 2020-04-25 10:26:11 -07:00
CMakeLists.txt Stop passing site cfg files via --param to llvm-lit. 2020-04-07 08:20:40 -04: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 build: use `find_package(Python3)` if available 2020-04-28 09:24:27 -07:00