From 9dcab61e1c7d555f1c5555dcb6a69f090fbca33c Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Fri, 11 Feb 2005 01:46:20 +0000 Subject: [PATCH] linux-unwind.h (pa32_fallback_frame_state): Handle misaligned signal trampolines. * pa/linux-unwind.h (pa32_fallback_frame_state): Handle misaligned signal trampolines. From-SVN: r94869 --- gcc/ChangeLog | 5 +++++ gcc/config/pa/linux-unwind.h | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1e4b5f61617..34513ea2e78 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-02-10 John David Anglin + + * pa/linux-unwind.h (pa32_fallback_frame_state): Handle misaligned + signal trampolines. + 2005-02-10 David Daney * config/alpha/linux-unwind.h: Add exception clause to copyright. diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h index 25791e533e2..3e23f62fa32 100644 --- a/gcc/config/pa/linux-unwind.h +++ b/gcc/config/pa/linux-unwind.h @@ -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) -- 2.30.2