This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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;
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]