OSDN Git Service

* pa/linux-unwind.h (pa32_fallback_frame_state): Handle misaligned
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Feb 2005 01:46:20 +0000 (01:46 +0000)
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Feb 2005 01:46:20 +0000 (01:46 +0000)
signal trampolines.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94869 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 1e4b5f6..34513ea 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.
 2005-02-10  David Daney  <ddaney@avtrex.com>
 
        * config/alpha/linux-unwind.h: Add exception clause to copyright.
index 25791e5..3e23f62 100644 (file)
@@ -86,7 +86,22 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
       off = 10 * 4;
     }
   else
       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)
   if (pc[1] != 0x3414015a
       || pc[2] != 0xe4008200
       || pc[3] != 0x08000240)