26
26
// abort(). Note th at there is no need to preserve any state before the call ,
27
27
// because the function does not return.
28
28
DEFINE_COMPILERRT_PRIVATE_FUNCTION(do_abort)
29
- .cfi_startproc
30
- .variant_pcs SYMBOL_NAME(do_abort)
31
- stp x29 , x30 , [ sp , # - 32 ] !
29
+ .cfi_startproc
30
+ .variant_pcs SYMBOL_NAME(do_abort)
31
+ BTI_C
32
+ stp x29 , x30 , [ sp , # - 32 ] !
32
33
cntd x0
33
34
// Store VG to a stack location th at we describe with .cfi_offset
34
35
str x0 , [ sp , # 16 ]
35
36
.cfi_def_cfa_offset 32
36
37
.cfi_offset w30 , - 24
37
38
.cfi_offset w29 , - 32
38
39
.cfi_offset 46 , - 16
39
- bl __arm_sme_state
40
- tbz x0, # 0 , 2f
40
+ bl __arm_sme_state
41
+ tbz x0, # 0 , 2f
41
42
1 :
42
- smstop sm
43
+ smstop sm
43
44
2 :
44
45
// We can't make this into a tail - call because the unwinder would
45
46
// need to restore the value of VG.
46
- bl SYMBOL_NAME(abort)
47
- .cfi_endproc
47
+ bl SYMBOL_NAME(abort)
48
+ .cfi_endproc
48
49
END_COMPILERRT_FUNCTION(do_abort)
49
50
50
51
// __arm_sme_state fills the result registers based on a local
51
52
// th at is set as part of the compiler - rt startup code.
52
53
// __aarch64_has_sme_and_tpidr2_el0
53
54
DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(__arm_sme_state)
54
- .variant_pcs __arm_sme_state
55
+ .variant_pcs __arm_sme_state
56
+ BTI_C
55
57
mov x0 , xzr
56
58
mov x1 , xzr
57
59
@@ -68,7 +70,8 @@ DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(__arm_sme_state)
68
70
END_COMPILERRT_OUTLINE_FUNCTION(__arm_sme_state)
69
71
70
72
DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(__arm_tpidr2_restore)
71
- .variant_pcs __arm_tpidr2_restore
73
+ .variant_pcs __arm_tpidr2_restore
74
+ BTI_C
72
75
// If TPIDR2_EL0 is nonnull , the subroutine aborts in some platform - specific
73
76
// manner.
74
77
mrs x14 , TPIDR2_EL0
@@ -103,7 +106,8 @@ DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(__arm_tpidr2_restore)
103
106
END_COMPILERRT_OUTLINE_FUNCTION(__arm_tpidr2_restore)
104
107
105
108
DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(__arm_tpidr2_save)
106
- .variant_pcs __arm_tpidr2_restore
109
+ .variant_pcs __arm_tpidr2_restore
110
+ BTI_C
107
111
// If the current thread does not have access to TPIDR2_EL0 , the subroutine
108
112
// does nothing.
109
113
adrp x14 , TPIDR2_SYMBOL
@@ -143,7 +147,8 @@ DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(__arm_tpidr2_save)
143
147
END_COMPILERRT_OUTLINE_FUNCTION(__arm_tpidr2_save)
144
148
145
149
DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(__arm_za_disable)
146
- .variant_pcs __arm_tpidr2_restore
150
+ .variant_pcs __arm_tpidr2_restore
151
+ BTI_C
147
152
// If the current thread does not have access to SME , the subroutine does
148
153
// nothing.
149
154
adrp x14 , TPIDR2_SYMBOL
@@ -174,3 +179,8 @@ DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(__arm_za_disable)
174
179
0 :
175
180
ret
176
181
END_COMPILERRT_OUTLINE_FUNCTION(__arm_za_disable)
182
+
183
+ NO_EXEC_STACK_DIRECTIVE
184
+
185
+ // GNU property note for BTI and PAC
186
+ GNU_PROPERTY_BTI_PAC
0 commit comments