diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-12-05 12:10:55 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-12-05 12:10:55 -0800 |
| commit | 1720bc2e81c274b463d84bec7484dbc5da87333f (patch) | |
| tree | 746dda7919e7efcbd521ae089eae1fa917a021ac /src/rt | |
| parent | 12e401cc7e7e2ab341300e02dc07d7eacd8569cb (diff) | |
| download | rust-1720bc2e81c274b463d84bec7484dbc5da87333f.tar.gz rust-1720bc2e81c274b463d84bec7484dbc5da87333f.zip | |
rt: Unwind through __morestack on 32-bit linux
Diffstat (limited to 'src/rt')
| -rw-r--r-- | src/rt/arch/i386/morestack.S | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/rt/arch/i386/morestack.S b/src/rt/arch/i386/morestack.S index 5ed305d9590..7b5446ae235 100644 --- a/src/rt/arch/i386/morestack.S +++ b/src/rt/arch/i386/morestack.S @@ -46,9 +46,25 @@ #if defined(__linux__) || defined(__APPLE__) MORESTACK: +#ifdef __linux__ + .cfi_startproc + + // Some magic that explains to the unwinder the unusal nature + // of this stack frame. Copied verbatim from libgcc, which + // has comments explaining it. + .cfi_offset 8, 8 + .cfi_escape 0x15, 4, 0x7d +#endif pushl %ebp +#ifdef __linux__ + .cfi_def_cfa_offset 8 + .cfi_offset %ebp, -8 +#endif movl %esp, %ebp +#ifdef __linux__ + .cfi_def_cfa_register %ebp +#endif // FIXME (1226): main is compiled with the split-stack prologue, // causing it to call __morestack, so we have to jump back out @@ -105,7 +121,12 @@ MORESTACK: call UPCALL_CALL_C addl $16,%esp + popl %ebp +#ifdef __linux__ + .cfi_restore %ebp + .cfi_def_cfa %esp, 4 +#endif retl $8 .L$bail: @@ -118,6 +139,9 @@ MORESTACK: jmpl *%edx +#ifdef __linux__ + .cfi_endproc +#endif #else MORESTACK: |
