[all-commits] [llvm/llvm-project] 8d5909: [LLD][AArch64] Make adrp+ldr relaxation per-symbol...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Jul 10 00:09:32 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8d590969badd9f3fed18a99fffbd9afdf3a975c6
      https://github.com/llvm/llvm-project/commit/8d590969badd9f3fed18a99fffbd9afdf3a975c6
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2026-07-10 (Fri, 10 Jul 2026)

  Changed paths:
    M bolt/test/AArch64/got-load-symbolization.s
    M bolt/test/AArch64/lite-mode.s
    M lld/ELF/Arch/AArch64.cpp
    M lld/test/ELF/aarch64-adrp-ldr-got.s

  Log Message:
  -----------
  [LLD][AArch64] Make adrp+ldr relaxation per-symbol all-or-nothing (#208396)

We can't relax only some adrp+ldr pairs for a symbol, because there may
be a branch target between the adrp and ldr of this form:

        adrp    x1, :got:sym
    .Lfoo:
        ldr     x1, [x1, :got_lo12:sym]
        # ...

        adrp    x1, :got:sym
        ldr     x2, [x1, :got_lo12:sym]
        b       .Lfoo

Relaxing the first adrp+ldr here would be invalid. This was clarified in
the ARM ABI in:
https://github.com/ARM-software/abi-aa/commit/11fb4ef42898060189d6a34ee96966e696ecbd20.

The implementation already performed a pre-scan to check that the
relevant relocations occur in pairs. Change this scan to a) check all
the preconditions for the relaxation and b) make the decision per
symbol.

Fixes https://github.com/llvm/llvm-project/issues/138254.



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