[all-commits] [llvm/llvm-project] 13838e: [ELF] Adjust allowed dynamic relocation types for ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Feb 23 18:27:17 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 13838efa3c8f8861ae98de9f0deec2c6c13d0728
      https://github.com/llvm/llvm-project/commit/13838efa3c8f8861ae98de9f0deec2c6c13d0728
  Author: Fangrui Song <i at maskray.me>
  Date:   2026-02-23 (Mon, 23 Feb 2026)

  Changed paths:
    M lld/ELF/Arch/X86_64.cpp
    R lld/test/ELF/Inputs/ztext.s
    A lld/test/ELF/x86-x32-abs.s
    M lld/test/ELF/ztext.s

  Log Message:
  -----------
  [ELF] Adjust allowed dynamic relocation types for x86-64 (#182905)

First, disallow R_X86_64_PC64 - generally only absolute relocations are
allowed in getDynRel. glibc and musl don't support R_X86_64_PC64 as
dynamic relocations.

Second, support R_X86_64_32 as dynamic relocation for the ILP32 ABI
(x32). GNU ld's behavior looks like:

- R_X86_64_32 => R_X86_64_RELATIVE
- R_X86_64_64 with addend 0 => R_X86_64_RELATIVE
- R_X86_64_64 with non-zero addend => R_X86_64_RELATIVE64 (unsupported
  by musl; compilers do not generate such constructs to the best of my
  knowledge)

For now we require R_X86_64_64 to be resolved at link-time for x32.

Fix #140465



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