This is the mail archive of the
mailing list for the GCC project.
[csl-arm] Fix unwinding corner case.
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 7 May 2005 01:01:46 +0100
- Subject: [csl-arm] Fix unwinding corner case.
It's possible for the last instruction in a function to be a call to a
function that throws an exception. This typically happens for noreturn
In this case the return address (used while unwinding) will point to the start
of the next function.
The attached patch fixes this by adjusting the address backwards by two bytes
before doing the lookup. This should place it inside the call instruction for
both arm and thumb modes.
Tested with cross to arm-none-eabi.
Applied to csl-arm-branch.
2005-05-06 Paul Brook <firstname.lastname@example.org>
* config/arm/unwind-arm.c (get_eit_entry): Adjust address to throwing
call, not following instruction.
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/Attic/unwind-arm.c,v
retrieving revision 126.96.36.199
diff -u -p -r188.8.131.52 unwind-arm.c
--- config/arm/unwind-arm.c 16 Feb 2005 01:46:04 -0000 184.108.40.206
+++ config/arm/unwind-arm.c 6 May 2005 17:05:44 -0000
@@ -380,6 +380,13 @@ get_eit_entry (_Unwind_Control_Block *uc
const __EIT_entry * eitp;
+ /* The return address is the address of the instruction following the
+ call instruction (plus one in thumb mode). If this was the last
+ instruction in the function the address will lie in the following
+ function. Subtract 2 from the address so that it points within the call
+ instruction itself. */
+ return_address -= 2;
eitp = (const __EIT_entry *) __gnu_Unwind_Find_exidx (return_address,