[Patch] MIPS: Fix unwinding through signal frames.

David Daney ddaney@avtrex.com
Wed Nov 14 21:45:00 GMT 2007


Certain MIPS processors have an errata workaround that changes the stack
layout for signal handlers.  The current MD_FALLBACK_FRAME_STATE_FOR for
mips/Linux assumes that the signal context is at a constant offset from
the signal trampoline.  When the workaround is in effect, the signal
context is not in the expected location, so unwinding fails.

I discovered this problem while running the testsuite on an SGI O2
system.  All the other mips systems I test with don't have the
workaround so were not effected by the bug.

The patch changes the calculation of the signal context so that it uses
the CFA of the unwind context to find the signal context.  This has the
advantage of working on system either with or without the workaround.

Tested on mipsel-linux (without workaround) and spot checked on
mips64-linux n32 ABI (with workaround) with full mips64-linux test in
progress.

OK to commit?

2007-11-14  David Daney  <ddaney@avtrex.com>

    * config/mips/linux-unwind.h (mips_fallback_frame_state): Use CFA
    to find sigcontext.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: uw.diff
Type: text/x-patch
Size: 869 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20071114/a13e9559/attachment.bin>


More information about the Gcc-patches mailing list