[all-commits] [llvm/llvm-project] 636beb: [X86][LLD] Handle R_X86_64_CODE_6_GOTTPOFF relocat...

Feng Zou via All-commits all-commits at lists.llvm.org
Thu Dec 5 00:26:48 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 636beb6a2833ee0290935f679252c1b662721b31
      https://github.com/llvm/llvm-project/commit/636beb6a2833ee0290935f679252c1b662721b31
  Author: Feng Zou <feng.zou at intel.com>
  Date:   2024-12-05 (Thu, 05 Dec 2024)

  Changed paths:
    M lld/ELF/Arch/X86_64.cpp
    M lld/test/ELF/invalid/broken-relaxation-x64.test
    M lld/test/ELF/pack-dyn-relocs-tls-x86-64.s
    M lld/test/ELF/tls-opt.s
    A lld/test/ELF/x86-64-tls-ie-err.s
    M lld/test/ELF/x86-64-tls-ie-local.s

  Log Message:
  -----------
  [X86][LLD] Handle R_X86_64_CODE_6_GOTTPOFF relocation type (#117675)

For

    add %reg1, name at GOTTPOFF(%rip), %reg2
    add name at GOTTPOFF(%rip), %reg1, %reg2
    {nf} add %reg1, name at GOTTPOFF(%rip), %reg2
    {nf} add name at GOTTPOFF(%rip), %reg1, %reg2
    {nf} add name at GOTTPOFF(%rip), %reg

add

    R_X86_64_CODE_6_GOTTPOFF = 50

in #117277.

Linker can treat R_X86_64_CODE_6_GOTTPOFF as R_X86_64_GOTTPOFF or
convert the instructions above to

    add $name at tpoff, %reg1, %reg2
    add $name at tpoff, %reg1, %reg2
    {nf} add $name at tpoff, %reg1, %reg2
    {nf} add $name at tpoff, %reg1, %reg2
    {nf} add $name at tpoff, %reg

if the first byte of the instruction at the relocation offset - 6 is
0x62 (namely, encoded w/EVEX prefix) when possible.

Binutils patch: bminor/binutils-gdb at 5bc71c2
Binutils mailthread:
https://sourceware.org/pipermail/binutils/2024-February/132351.html
ABI discussion:
https://groups.google.com/g/x86-64-abi/c/FhEZjCtDLFw/m/VHDjN4orAgAJ
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