You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/arm64-exception-handling.md
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -313,6 +313,7 @@ The unwind codes are encoded according to the table below. All unwind codes are
313
313
|| 11101010: Custom stack for MSFT_OP_CONTEXT |
314
314
|| 11101100: Custom stack for MSFT_OP_CLEAR_UNWOUND_TO_CALL |
315
315
|| 1111xxxx: reserved |
316
+
|`sign_ra`| 11111100: sign the return address in `x30` with `pacibsp`|
316
317
317
318
In instructions with large values covering multiple bytes, the most significant bits are stored first. This design makes it possible to find the total size in bytes of the unwind code by looking up only the first byte of the code. Since each unwind code is exactly mapped to an instruction in a prolog or epilog, you can compute the size of the prolog or epilog. Walk from the sequence start to the end, and use a lookup table or similar device to determine the length of the corresponding opcode.
318
319
@@ -345,7 +346,7 @@ The fields are as follows:
345
346
-**CR** is a 2-bit flag indicating whether the function includes extra instructions to set up a frame chain and return link:
- 01 = unchained function, \<lr> is saved in stack
348
-
- 10 = reserved;
349
+
- 10 = chained function with signed return address
349
350
- 11 = chained function, a store/load pair instruction is used in prolog/epilog \<x29,lr>
350
351
-**H** is a 1-bit flag indicating whether the function homes the integer parameter registers (x0-x7) by storing them at the very start of the function. (0 = doesn't home registers, 1 = homes registers).
351
352
-**RegI** is a 4-bit field indicating the number of non-volatile INT registers (x19-x28) saved in the canonical stack location.
@@ -355,6 +356,8 @@ Canonical prologs that fall into categories 1, 2 (without outgoing parameter are
355
356
356
357
Step 0: Pre-compute of the size of each area.
357
358
359
+
Step 0.5: Sign the return address.
360
+
358
361
Step 1: Save Int callee-saved registers.
359
362
360
363
Step 2: This step is specific for type 4 in early sections. lr is saved at the end of Int area.
@@ -368,13 +371,14 @@ Step 5: Allocate remaining stack, including local area, \<x29,lr> pair, and outg
368
371
| Step # | Flag values | # of instructions | Opcode | Unwind code |
0 commit comments