1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
; RUN: rm -rf %t && split-file %s %t && cd %t
; RUN: cat common.ll authflag.ll > auth.ll
; RUN: cat common.ll noauthflag.ll > noauth1.ll
; RUN: cat common.ll > noauth2.ll
; RUN: llc -mtriple=aarch64-linux -filetype=asm auth.ll -o - | \
; RUN: FileCheck --check-prefix=AUTH-ASM %s
; RUN: llc -mtriple=aarch64-linux -filetype=obj auth.ll -o - | \
; RUN: llvm-readelf -r -x .data.DW.ref.__gxx_personality_v0 - | \
; RUN: FileCheck --check-prefix=AUTH-RELOC %s
; AUTH-ASM: DW.ref.__gxx_personality_v0:
; AUTH-ASM-NEXT: .xword __gxx_personality_v0@AUTH(ia,32429,addr)
; AUTH-RELOC: Relocation section '.rela.data.DW.ref.__gxx_personality_v0' at offset 0x2a0 contains 1 entries:
; AUTH-RELOC-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend
; AUTH-RELOC-NEXT: 0000000000000000 0000000f00000244 R_AARCH64_AUTH_ABS64 0000000000000000 __gxx_personality_v0 + 0
; AUTH-RELOC: Hex dump of section '.data.DW.ref.__gxx_personality_v0':
; AUTH-RELOC-NEXT: 0x00000000 00000000 ad7e0080
; ^^^^ 0x7EAD = discriminator
; ^^ 0b10000000: bit 63 = 1 -> address diversity enabled, bits 61:60 = 0b00 -> key is IA
; RUN: llc -mtriple=aarch64-linux -filetype=asm noauth1.ll -o - | \
; RUN: FileCheck --check-prefix=NOAUTH-ASM %s
; RUN: llc -mtriple=aarch64-linux -filetype=obj noauth1.ll -o - | \
; RUN: llvm-readelf -r -x .data.DW.ref.__gxx_personality_v0 - | \
; RUN: FileCheck --check-prefix=NOAUTH-RELOC %s
; RUN: llc -mtriple=aarch64-linux -filetype=asm noauth2.ll -o - | \
; RUN: FileCheck --check-prefix=NOAUTH-ASM %s
; RUN: llc -mtriple=aarch64-linux -filetype=obj noauth2.ll -o - | \
; RUN: llvm-readelf -r -x .data.DW.ref.__gxx_personality_v0 - | \
; RUN: FileCheck --check-prefix=NOAUTH-RELOC %s
; NOAUTH-ASM: DW.ref.__gxx_personality_v0:
; NOAUTH-ASM-NEXT: .xword __gxx_personality_v0{{$}}
; NOAUTH-RELOC: Relocation section '.rela.data.DW.ref.__gxx_personality_v0' at offset 0x2a0 contains 1 entries:
; NOAUTH-RELOC-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend
; NOAUTH-RELOC-NEXT: 0000000000000000 0000000f00000101 R_AARCH64_ABS64 0000000000000000 __gxx_personality_v0 + 0
; NOAUTH-RELOC: Hex dump of section '.data.DW.ref.__gxx_personality_v0':
; NOAUTH-RELOC-NEXT: 0x00000000 00000000 00000000
;--- common.ll
@_ZTISt9exception = external constant ptr
define i32 @main() personality ptr @__gxx_personality_v0 {
entry:
invoke void @foo() to label %cont unwind label %lpad
lpad:
%0 = landingpad { ptr, i32 }
catch ptr null
catch ptr @_ZTISt9exception
ret i32 0
cont:
ret i32 0
}
declare i32 @__gxx_personality_v0(...)
declare void @foo()
;--- authflag.ll
!llvm.module.flags = !{!0}
!0 = !{i32 8, !"ptrauth-sign-personality", i32 1}
;--- noauthflag.ll
!llvm.module.flags = !{!0}
!0 = !{i32 8, !"ptrauth-sign-personality", i32 0}
|