Index: lib/libc/arch/x86_64/sys/__sigtramp2.S =================================================================== RCS file: /cvsroot/src/lib/libc/arch/x86_64/sys/__sigtramp2.S,v retrieving revision 1.7 diff -u -r1.7 __sigtramp2.S --- lib/libc/arch/x86_64/sys/__sigtramp2.S 2 Dec 2019 01:38:54 -0000 1.7 +++ lib/libc/arch/x86_64/sys/__sigtramp2.S 12 Oct 2020 00:42:16 -0000 @@ -43,6 +43,36 @@ */ NENTRY(__sigtramp_siginfo_2) .cfi_startproc + .cfi_signal_frame + /* + * Specify the virtual register CFA - call frame address - which is + * pretty much the stack-pointer before entry and then specify the other + * registers as offests from that address. + */ + .cfi_def_cfa 15, 0 /* R15, offset=0 */ + /* + * The Register rN is a raw register number used in CFI. + * The value is the offset of the register in ucontext_t. + * + * For RAX it is: offsetof(ucontext_t, uc_mcontext.__gregs[_REG_RAX]). + */ + .cfi_offset 0,168 /* RAX */ + .cfi_offset 1,72 /* RDX */ + .cfi_offset 2,80 /* RCX */ + .cfi_offset 3,160 /* RBX */ + .cfi_offset 4,64 /* RSI */ + .cfi_offset 5,56 /* RDI */ + .cfi_offset 6,152 /* RBP */ + /* The unwinder will use the CFA to restore RSP. */ + .cfi_offset 8,88 /* R8 */ + .cfi_offset 9,96 /* R9 */ + .cfi_offset 10,104 /* R10 */ + .cfi_offset 11,112 /* R11 */ + .cfi_offset 12,120 /* R12 */ + .cfi_offset 13,128 /* R13 */ + .cfi_offset 14,136 /* R14 */ + .cfi_offset 15,144 /* R15 */ + .cfi_offset 16,224 /* RIP */ .cfi_def_cfa rsp, 8 movq %r15,%rdi movq $SYS_setcontext, %rax