[all-commits] [llvm/llvm-project] a760d7: [LLD] [COFF] Fix handling of immediates in ARM64_S...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Mon Jun 1 00:17:54 PDT 2026


  Branch: refs/heads/release/22.x
  Home:   https://github.com/llvm/llvm-project
  Commit: a760d7c07024feaf3b58212edd388a4f016a71ce
      https://github.com/llvm/llvm-project/commit/a760d7c07024feaf3b58212edd388a4f016a71ce
  Author: Martin Storsjö <martin at martin.st>
  Date:   2026-06-01 (Mon, 01 Jun 2026)

  Changed paths:
    M lld/COFF/Chunks.cpp
    M lld/test/COFF/arm64-relocs-imports.test

  Log Message:
  -----------
  [LLD] [COFF] Fix handling of immediates in ARM64_SECREL_HIGH12A (#200060)

Just like for PAGEBASE_REL21, the immediate in SECREL_HIGH12A is the
byte offset, not a page offset. The byte level offset is added to the
symbol offset, which only then after that gets shifted right by 12. This
makes the handling of this immediate consistent with what MS link.exe
does.

The existing testcase had a zero immediate in the instruction for this
relocation.

This makes it clear that immediate offsets with SECREL_HIGH12A do work
fine, where the byte level offsets end up carrying over to the upper
bits.

(cherry picked from commit 5c95f6a859394757b92b0d63ff90b9175056deb6)



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