bug with ARM `adrl' directive

Philip Blundell pb@tazenda.demon.co.uk
Fri Sep 8 11:43:00 GMT 2000


I had a report that `adrl' produced bogus output with input like this:

1:
	.space 8192
	adrl	r0, 1b

The patch below seems to fix it.  Is this OK?

p.

2000-09-08  Philip Blundell  <philb@gnu.org>

	* config/tc-arm.c (md_apply_fix3): Correct handling of ADRL when
	offset is negative.

Index: tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.58
diff -u -p -u -p -r1.58 tc-arm.c
--- tc-arm.c	2000/08/18 19:27:30	1.58
+++ tc-arm.c	2000/09/08 18:42:39
@@ -5676,7 +5676,7 @@ md_apply_fix3 (fixP, val, seg)
 	    if (newimm != (unsigned int) FAIL)
 	      newinsn = temp;
 	    /* Still No ?  Try using a negated value.  */
-	    else if (validate_immediate_twopart (- value, & highpart) != (unsigned int) FAIL)
+	    else if ((newimm = validate_immediate_twopart (- value, & highpart)) != (unsigned int) FAIL)
 	      temp = newinsn = (temp & OPCODE_MASK) | OPCODE_SUB << DATA_OP_SHIFT;
 	    /* Otherwise - give up.  */
 	    else




More information about the Binutils mailing list