Commit 47a78b3
Mark CXX module initializer with PACBTI attributes (llvm#133716)
The CXX module initializer function, which is called at program startup,
needs to be tagged with Pointer Authentication and Branch Target
Identification marks whenever relevant.
Before this patch, in CPUs set up for PACBTI execution, the function
wasn't protected with return address signing and no BTI instruction was
inserted at the start of it, thus leading to an execution fault.
This patch fixes the issue by marking the function with the function
attributes related to PAC and BTI if relevant.1 parent ae31e85 commit 47a78b3
File tree
4 files changed
+34
-12
lines changed- clang
- lib/CodeGen
- Targets
- test/CodeGenCXX
4 files changed
+34
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
451 | 456 | | |
452 | 457 | | |
453 | 458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
| 139 | + | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | | - | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
155 | | - | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
| 138 | + | |
138 | 139 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 140 | + | |
143 | 141 | | |
144 | | - | |
| 142 | + | |
| 143 | + | |
145 | 144 | | |
146 | 145 | | |
147 | 146 | | |
| |||
174 | 173 | | |
175 | 174 | | |
176 | 175 | | |
177 | | - | |
178 | | - | |
| 176 | + | |
179 | 177 | | |
180 | 178 | | |
| 179 | + | |
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments