[all-commits] [llvm/llvm-project] 73d1ab: [X86][LLD] Handle R_X86_64_CODE_4_GOTTPOFF relocat...

Feng Zou via All-commits all-commits at lists.llvm.org
Tue Nov 26 17:25:52 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73d1abb018fdd60664b49c3418572c2e04e18d41
      https://github.com/llvm/llvm-project/commit/73d1abb018fdd60664b49c3418572c2e04e18d41
  Author: Feng Zou <feng.zou at intel.com>
  Date:   2024-11-27 (Wed, 27 Nov 2024)

  Changed paths:
    M lld/ELF/Arch/X86_64.cpp
    M lld/test/ELF/pack-dyn-relocs-tls-x86-64.s
    M lld/test/ELF/tls-opt.s
    M lld/test/ELF/x86-64-tls-ie-local.s

  Log Message:
  -----------
  [X86][LLD] Handle R_X86_64_CODE_4_GOTTPOFF relocation type (#116634)

For

  mov name at GOTTPOFF(%rip), %reg
  add name at GOTTPOFF(%rip), %reg

add

  `R_X86_64_CODE_4_GOTTPOFF` = 44

in #116633.

Linker can treat `R_X86_64_CODE_4_GOTTPOFF` as `R_X86_64_GOTTPOFF` or
convert the instructions above to

  mov $name, %reg
  add $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/a533c8df598b5ef99c54a13e2b137c98b34b043c
Binutils mailthread: https://sourceware.org/pipermail/binutils/2023-December/131463.html
ABI discussion: https://groups.google.com/g/x86-64-abi/c/ACwD-UQXVDs/m/vrgTenKyFwAJ
Blog: https://kanrobert.github.io/rfc/All-about-APX-relocation



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list