linux-unwind.h (pa32_fallback_frame_state): Handle misaligned signal trampolines.
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Fri, 11 Feb 2005 01:46:20 +0000 (01:46 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 11 Feb 2005 01:46:20 +0000 (01:46 +0000)
* pa/linux-unwind.h (pa32_fallback_frame_state): Handle misaligned
signal trampolines.

From-SVN: r94869

gcc/ChangeLog
gcc/config/pa/linux-unwind.h

index 1e4b5f61617e0ff28449421b16abe2423ef8c949..34513ea2e78db16da0824b768863a9cdb15a10ae 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-10  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       * pa/linux-unwind.h (pa32_fallback_frame_state): Handle misaligned
+       signal trampolines.
+
 2005-02-10  David Daney  <ddaney@avtrex.com>
 
        * config/alpha/linux-unwind.h: Add exception clause to copyright.
index 25791e533e28490023e9cb1a4ca9257f22518858..3e23f62fa32ee87bebbad9be1c022643240666f3 100644 (file)
@@ -86,7 +86,22 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
       off = 10 * 4;
     }
   else
-    return _URC_END_OF_STACK;
+    {
+      /* We may have to unwind through an alternate signal stack.
+        We assume that the alignment of the alternate signal stack
+        is BIGGEST_ALIGNMENT (i.e., that it has been allocated using
+        malloc).  As a result, we can't distinguish trampolines
+        used prior to 2.6.5-rc2-pa4.  However after 2.6.5-rc2-pa4,
+        the return address of a signal trampoline will be on an odd
+        word boundary and we can then determine the frame offset.  */
+      sp = (unsigned long)context->ra;
+      pc = (unsigned int *)sp;
+      if ((pc[0] == 0x34190000 || pc[0] == 0x34190002) && (sp & 4))
+       off = 5 * 4;
+      else
+       return _URC_END_OF_STACK;
+    }
+
   if (pc[1] != 0x3414015a
       || pc[2] != 0xe4008200
       || pc[3] != 0x08000240)