[llvm] [BOLT][AArch64] Support for pointer authentication (v2) (PR #120064)

Paschalis Mpeis via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 17 08:00:03 PDT 2025


================
@@ -0,0 +1,41 @@
+# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
+# RUN: %clang %cflags  %t.o -o %t.exe -Wl,-q
+# RUN: llvm-bolt %t.exe -o %t.exe.bolt | FileCheck %s
+# check that the output is listing foo as incorrect
+# CHECK: BOLT-INFO: inconsistent RAStates in function foo
+
+# check that foo got Ignored, so it's not in the new .text section
+# llvm-objdump %t.exe -d -j .text > %t.exe.dump
+# RUN: not grep "<foo>:" %t.exe.dump
+
+
+  .text
+  .globl  foo
+  .p2align        2
+  .type   foo, at function
+foo:
+  .cfi_startproc
+  hint    #25
+  .cfi_negate_ra_state
+  sub     sp, sp, #16
+  stp     x29, x30, [sp, #16]             // 16-byte Folded Spill
+  .cfi_def_cfa_offset 16
+  str     w0, [sp, #12]
+  ldr     w8, [sp, #12]
+  .cfi_negate_ra_state
+  add     w0, w8, #1
+  ldp     x29, x30, [sp, #16]             // 16-byte Folded Reload
+  add     sp, sp, #16
+  hint    #29
+  .cfi_negate_ra_state
+  ret
+.Lfunc_end1:
+  .size   foo, .Lfunc_end1-foo
+  .cfi_endproc
+
+  .global _start
+  .type _start, %function
+_start:
+  b foo
+
----------------
paschalis-mpeis wrote:

nit: add the usual comment:

```
# Force relocation mode.
```

However, I don't think relocation mode is needed for this test, so you could drop it instead.

https://github.com/llvm/llvm-project/pull/120064


More information about the llvm-commits mailing list