Skip to content

Commit d8d2f48

Browse files
committed
Switch to a shorter canonical opcode name for PAC return address signing
The previous name wasn't ever used officially anywhere, and is long and unwieldy. Switch over to a shorter one suggested by Pedro Miguel Justo. Also fix up one leftover instance of an initial tentative placeholder name.
1 parent 2b97485 commit d8d2f48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/build/arm64-exception-handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ The unwind codes are encoded according to the table below. All unwind codes are
313313
| | 11101010: Custom stack for `MSFT_OP_CONTEXT` |
314314
| | 11101100: Custom stack for `MSFT_OP_CLEAR_UNWOUND_TO_CALL` |
315315
| | 1111xxxx: reserved |
316-
| `pac_sign_return_address` | 11111100: sign the return address in `lr` with `pacibsp` |
316+
| `pac_sign_lr` | 11111100: sign the return address in `lr` with `pacibsp` |
317317

318318
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.
319319

@@ -371,7 +371,7 @@ Step 6: Allocate remaining stack, including local area, `<x29,lr>` pair, and out
371371
| Step # | Flag values | # of instructions | Opcode | Unwind code |
372372
|--|--|--|--|--|
373373
| 0 | | | `#intsz = RegI * 8;`<br/>`if (CR==01) #intsz += 8; // lr`<br/>`#fpsz = RegF * 8;`<br/>`if(RegF) #fpsz += 8;`<br/>`#savsz=((#intsz+#fpsz+8*8*H)+0xf)&~0xf)`<br/>`#locsz = #famsz - #savsz` |
374-
| 1 | **CR** == 11 | 1 | `pacibsp` | `sign_ra` |
374+
| 1 | **CR** == 11 | 1 | `pacibsp` | `pac_sign_lr` |
375375
| 2 | 0 < **RegI** <= 10 | **RegI** / 2 +<br/> **RegI** % 2 | `stp x19,x20,[sp,#savsz]!`<br/>`stp x21,x22,[sp,#16]`<br/>`...` | `save_regp_x`<br/>`save_regp`<br/>`...` |
376376
| 3 | **CR** == 01\* | 1 | `str lr,[sp,#(intsz-8)]`\* | `save_reg` |
377377
| 4 | 0 < **RegF** <= 7 | (**RegF** + 1) / 2 +<br/>(**RegF** + 1) % 2) | `stp d8,d9,[sp,#intsz]`\*\*<br/>`stp d10,d11,[sp,#(intsz+16)]`<br/>`...`<br/>`str d(8+RegF),[sp,#(intsz+fpsz-8)]` | `save_fregp`<br/>`...`<br/>`save_freg` |

0 commit comments

Comments
 (0)