[llvm-branch-commits] [lld] ELF: Introduce R_AARCH64_FUNCINIT64 relocation type. (PR #133531)
Peter Smith via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jul 11 08:58:10 PDT 2025
================
@@ -0,0 +1,19 @@
+# REQUIRES: aarch64
+
+# RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o
+# RUN: ld.lld %t.o -o %t
+# RUN: llvm-readelf -s -r %t | FileCheck %s
+# RUN: ld.lld %t.o -o %t -pie
+# RUN: llvm-readelf -s -r %t | FileCheck %s
+# RUN: not ld.lld %t.o -o %t -shared 2>&1 | FileCheck --check-prefix=ERR %s
+
+.data
+# CHECK: R_AARCH64_IRELATIVE [[FOO:[0-9a-f]*]]
+# ERR: relocation R_AARCH64_FUNCINIT64 cannot be used against preemptible symbol 'foo'
+.8byte foo at FUNCINIT
----------------
smithp35 wrote:
Although not this patch, MaskRay is proposing that we use a different syntax for relocation specifiers to avoid ambiguity with the addend: https://maskray.me/blog/2025-03-16-relocation-generation-in-assemblers
I'm proposing that aarch64 ELF follows this for data relocation specifiers (first one in https://github.com/ARM-software/abi-aa/pull/330/files#diff-c74a0dce6771ac7b499e84c140122aaa972bd9d63aed84863e675ecc9b4b2c32R659)
I'm assuming that we could migrate to this syntax at a later date if needed.
https://github.com/llvm/llvm-project/pull/133531
More information about the llvm-branch-commits
mailing list