159 lines · plain
1# RUN: llvm-mc -triple=arm64e-apple-macosx -filetype=obj -o %t.o %s2# RUN: llvm-jitlink %t.o3#4# REQUIRES: system-darwin && host=arm64{{.*}}5#6# Check that arm64e ptrauth relocations are handled correctly.7#8# This test contains eight global pointers with different signing schemes9# (IA vs DA key, with and without address diversity, and with 0 or 0xa5a5 as10# the additional diversity value). If all pointers pass authentication at11# runtime then the test returns zero.12#13# This test requires execution since the signed pointers are written by a14# signing function attached to the graph.15#16# TODO: Write an out-of-process version. This will probably need to be added to17# the ORC runtime.18 19 .section __TEXT,__text,regular,pure_instructions20 .build_version macos, 13, 0 sdk_version 13, 321 .globl _main22 .p2align 223_main:24 adrp x8, _p1@PAGE25 ldr x16, [x8, _p1@PAGEOFF]26 autiza x1627 28 adrp x9, _p2@PAGE29 add x9, x9, _p2@PAGEOFF30 ldr x16, [x9]31 autia x16, x932 33 adrp x10, _p3@PAGE34 ldr x16, [x10, _p3@PAGEOFF]35 mov x17, #2313036 autia x16, x1737 38 adrp x9, _p4@PAGE39 add x9, x9, _p4@PAGEOFF40 ldr x16, [x9]41 mov x17, x942 movk x17, #23130, lsl #4843 autia x16, x1744 45 adrp x10, _p5@PAGE46 ldr x10, [x10, _p5@PAGEOFF]47 ldraa x10, [x10]48 49 adrp x9, _p6@PAGE50 add x9, x9, _p6@PAGEOFF51 ldr x16, [x9]52 autda x16, x953 54 adrp x10, _p7@PAGE55 ldr x16, [x10, _p7@PAGEOFF]56 mov x17, #2313057 autda x16, x1758 59 adrp x9, _p8@PAGE60 add x9, x9, _p8@PAGEOFF61 ldr x16, [x9]62 mov x17, x963 movk x17, #23130, lsl #4864 autda x16, x1765 66 mov w0, #067 ret68 69 .private_extern _a70 .section __DATA,__data71 .globl _a72 .p2align 373_a:74 .quad 175 76 .private_extern _b77 .globl _b78 .p2align 379_b:80 .quad 281 82 .private_extern _c83 .globl _c84 .p2align 385_c:86 .quad 387 88 .private_extern _d89 .globl _d90 .p2align 391_d:92 .quad 493 94 .private_extern _e95 .globl _e96 .p2align 397_e:98 .quad 599 100 .private_extern _f101 .globl _f102 .p2align 3103_f:104 .quad 6105 106 .private_extern _g107 .globl _g108 .p2align 3109_g:110 .quad 7111 112 .private_extern _h113 .globl _h114 .p2align 3115_h:116 .quad 8117 118 .globl _p1119 .p2align 3120_p1:121 .quad _a@AUTH(ia,0)122 123 .globl _p2124 .p2align 3125_p2:126 .quad _b@AUTH(ia,0,addr)127 128 .globl _p3129 .p2align 3130_p3:131 .quad _c@AUTH(ia,23130)132 133 .globl _p4134 .p2align 3135_p4:136 .quad _d@AUTH(ia,23130,addr)137 138 .globl _p5139 .p2align 3140_p5:141 .quad _e@AUTH(da,0)142 143 .globl _p6144 .p2align 3145_p6:146 .quad _f@AUTH(da,0,addr)147 148 .globl _p7149 .p2align 3150_p7:151 .quad _g@AUTH(da,23130)152 153 .globl _p8y154 .p2align 3155_p8:156 .quad _h@AUTH(da,23130,addr)157 158.subsections_via_symbols159