diff --git a/src/rt/arch/x86_64/morestack.S b/src/rt/arch/x86_64/morestack.S index 6686071361b9..c85f2e142dba 100644 --- a/src/rt/arch/x86_64/morestack.S +++ b/src/rt/arch/x86_64/morestack.S @@ -71,6 +71,20 @@ MORESTACK: leaq 16(%rbp), %rax pushq %rax + // During unwinding we want to skip our caller since it's not + // a complete frame and will make the unwinder sad +#if defined(__linux__) + // Don't understand this line + .cfi_offset 16, 0 + // Tell the unwinding where to get the stack pointer for + // our grandparent frame + .cfi_offset %rsp, -24 +#endif + + // Save the grandparent stack pointer for the unwinder + leaq 16(%rbp), %rax + pushq %rax + // FIXME: libgcc also saves rax. not sure if we need to // Save argument registers