[llvm] [AArch64] emitAddress: Handle signed GOT. (PR #172926)
Harald van Dijk via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 30 11:24:50 PST 2025
================
@@ -127,3 +132,56 @@ $comdat = comdat any
; CHECK: comdat:
; CHECK-NEXT: [[PLACE:.*]]:
; CHECK-NEXT: .section .text.startup,"axG", at progbits,comdat,comdat
+
+;--- signed-got.ll
+
+ at global = external global i8
+
+; CHECK: globalref:
+; CHECK-NEXT: [[PLACE:.*]]:
+; CHECK-NEXT: .section .text.startup
+; CHECK-NEXT: [[FUNC:.*]]:
+; CHECK-NEXT: adrp x16, :got_auth:global
+; CHECK-NEXT: add x16, x16, :got_auth_lo12:global
+; CHECK-NEXT: ldr x0, [x16]
+; CHECK-NEXT: autda x0, x16
----------------
hvdijk wrote:
In #171648, pcc had written "I think we should do the simpler thing of only having a condition for IFUNC, especially given that no current target supports both, so the question of what we should do then is theoretical. If a target supports both and needs the slight code size improvement then we can consider adding code to prefer PAuth relocations in that case."
Basically, yes, you're right, but this is a tradeoff where we keep LLVM's logic simpler as long as the code still works.
https://github.com/llvm/llvm-project/pull/172926
More information about the llvm-commits
mailing list