diff options
| author | Shengchen Kan <shengchen.kan@intel.com> | 2024-09-24 18:39:48 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-24 18:39:48 +0800 |
| commit | 3d34053af61ff45e05d230d2678eb8e95322eb14 (patch) | |
| tree | 06d230bb5123cee91d3515eddf96d3d413260547 /llvm/lib/Object/ModuleSymbolTable.cpp | |
| parent | ea902d1b36e4e3a7d7bdd0f7bce3c460b6dd6e80 (diff) | |
| download | llvm-3d34053af61ff45e05d230d2678eb8e95322eb14.zip llvm-3d34053af61ff45e05d230d2678eb8e95322eb14.tar.gz llvm-3d34053af61ff45e05d230d2678eb8e95322eb14.tar.bz2 | |
[X86,MC] Add relocation R_X86_64_REX2_GOTPCRELX (#106681)
For
mov name@GOTPCREL(%rip), %reg
test %reg, name@GOTPCREL(%rip)
binop name@GOTPCREL(%rip), %reg
where binop is one of adc, add, and, cmp, or, sbb, sub, xor
instructions, add
`R_X86_64_REX2_GOTPCRELX`/`R_X86_64_CODE_4_GOTPCRELX` = 43
if the instruction starts at 4 bytes before the relocation offset. It
similar to R_X86_64_GOTPCRELX.
Linker can treat `R_X86_64_REX2_GOTPCRELX`/`R_X86_64_CODE_4_GOTPCRELX`
as `R_X86_64_GOTPCREL` or convert the above instructions to
lea name(%rip), %reg
mov $name, %reg
test $name, %reg
binop $name, %reg
if the first byte of the instruction at the relocation `offset - 4` is
`0xd5` (namely, encoded w/ REX2 prefix) when possible.
Binutils patch:
https://github.com/bminor/binutils-gdb/commit/3d5a60de52556f6a53d71d7e607c6696450ae3e4
Binutils mailthread:
https://sourceware.org/pipermail/binutils/2023-December/131462.html
ABI discussion: https://groups.google.com/g/x86-64-abi/c/KbzaNHRB6QU
Blog: https://kanrobert.github.io/rfc/All-about-APX-relocation
Diffstat (limited to 'llvm/lib/Object/ModuleSymbolTable.cpp')
0 files changed, 0 insertions, 0 deletions
