[all-commits] [llvm/llvm-project] fad5ed: [X86][LLD] Handle R_X86_64_CODE_4_GOTPC32_TLSDESC ...

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


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fad5ed6e908aafe03e47032611a6e836bbcc4d5a
      https://github.com/llvm/llvm-project/commit/fad5ed6e908aafe03e47032611a6e836bbcc4d5a
  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/invalid/x86-64-tlsdesc-gd.s
    M lld/test/ELF/x86-64-tlsdesc-gd.s

  Log Message:
  -----------
  [X86][LLD] Handle R_X86_64_CODE_4_GOTPC32_TLSDESC relocation type (#116909)

For

  lea name at tlsdesc(%rip), %reg

add

  R_X86_64_CODE_4_GOTPC32_TLSDESC = 45

in #116908.

Linker can treat R_X86_64_CODE_4_GOTPC32_TLSDESC as
R_X86_64_GOTPC32_TLSDESC or convert the instruction above to

  mov $name at tpoff, %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