This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Incorrect Thumb-2 czb encoding


The patch below fixes a typo in the offset mask for the 
BFD_RELOC_THUMB_PCREL_BRANCH7 relocatiosns used by the Thumb-2 CBZ and CBNZ 
instructions.

Tested with cross to arm-none-eabi.
Applied as obvious.

Paul

2006-03-21  Paul Brook  <paul@codesourcery.com>

	* config/tc-arm.c (md_apply_fix): Fix typo in offset mask.

Index: gas/config/tc-arm.c
===================================================================
RCS file: /var/cvsroot/src-cvs/src/gas/config/tc-arm.c,v
retrieving revision 1.250.2.5
diff -u -p -r1.250.2.5 tc-arm.c
--- gas/config/tc-arm.c	20 Mar 2006 23:35:40 -0000	1.250.2.5
+++ gas/config/tc-arm.c	21 Mar 2006 22:38:33 -0000
@@ -11964,7 +11964,7 @@ md_apply_fix (fixS *	fixP,
       if (fixP->fx_done || !seg->use_rela_p)
 	{
 	  newval = md_chars_to_number (buf, THUMB_SIZE);
-	  newval |= ((value & 0x2e) << 2) | ((value & 0x40) << 3);
+	  newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3);
 	  md_number_to_chars (buf, newval, THUMB_SIZE);
 	}
       break;


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