This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Bug in ARM unwinding code.
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 20 Sep 2006 18:26:37 +0100
- Subject: Bug in ARM unwinding code.
The patch below fixes a really dumb bug in the ARM unwinding code. The sign
extension routine wasn't clearing the top bit for positive offsets.
It happens that under normal circumstances ld puts the exception tables last,
so this works by chance.
Tested with cross to arm-none-eabi.
Applied to trunk, 4.1 and souceryg++-4_1
Paul
2006-09-20 Paul Brook <paul@codesourcery.com>
gcc/
* config/arm/unwind-arm.c (selfrel_offset31): Clear top bit for
positive offsets.
Index: gcc/config/arm/unwind-arm.c
===================================================================
--- gcc/config/arm/unwind-arm.c (revision 117082)
+++ gcc/config/arm/unwind-arm.c (working copy)
@@ -539,6 +539,8 @@ selfrel_offset31 (const _uw *p)
/* Sign extend to 32 bits. */
if (offset & (1 << 30))
offset |= 1u << 31;
+ else
+ offset &= ~(1u << 31);
return offset + (_uw) p;
}