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]

[PATCH] Relax MIPS j/jal out-of-range check


Hello All,

I applied the appended patch. It relaxes the range checking for j and
jal addresses to a warning, since there are a few cases where the
effect of an out of range jump can be the intended result.


Thiemo


2006-05-09  David Ung  <davidu@mips.com>

	[ gas/ChangeLog ]
	* config/tc-mips.c (append_insn): Only warn about an out-of-range
	j or jal address.

	[ gas/testsuite/ChangeLog ]
	* gas/mips/jal-range.l: Only warn about an out-of-range j or jal
	address.


Index: gas/testsuite/gas/mips/jal-range.l
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mips/jal-range.l,v
retrieving revision 1.2
diff -u -p -r1.2 jal-range.l
--- gas/testsuite/gas/mips/jal-range.l	26 Sep 2002 09:00:08 -0000	1.2
+++ gas/testsuite/gas/mips/jal-range.l	2 May 2006 14:58:20 -0000
@@ -1,4 +1,4 @@
 .*: Assembler messages:
 .*:4: Error: jump to misaligned address \(0x1\)
 .*:6: Error: jump to misaligned address \(0xfffffff\)
-.*:7: Error: jump address range overflow \(0x10000000\)
+.*:7: Warning: jump address range overflow \(0x10000000\)
Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.330
diff -u -p -r1.330 tc-mips.c
--- gas/config/tc-mips.c	30 Apr 2006 18:34:39 -0000	1.330
+++ gas/config/tc-mips.c	2 May 2006 14:58:19 -0000
@@ -2407,8 +2772,8 @@ append_insn (struct mips_cl_insn *ip, ex
 		as_bad (_("jump to misaligned address (0x%lx)"),
 			(unsigned long) address_expr->X_add_number);
 	      if (address_expr->X_add_number & ~0xfffffff)
-		as_bad (_("jump address range overflow (0x%lx)"),
-			(unsigned long) address_expr->X_add_number);
+		as_warn (_("jump address range overflow (0x%lx)"),
+			 (unsigned long) address_expr->X_add_number);
 	      ip->insn_opcode |= (address_expr->X_add_number >> 2) & 0x3ffffff;
 	      break;
 
@@ -2417,8 +2782,8 @@ append_insn (struct mips_cl_insn *ip, ex
 		as_bad (_("jump to misaligned address (0x%lx)"),
 			(unsigned long) address_expr->X_add_number);
 	      if (address_expr->X_add_number & ~0xfffffff)
-		as_bad (_("jump address range overflow (0x%lx)"),
-			(unsigned long) address_expr->X_add_number);
+		as_warn (_("jump address range overflow (0x%lx)"),
+			 (unsigned long) address_expr->X_add_number);
 	      ip->insn_opcode |=
 		(((address_expr->X_add_number & 0x7c0000) << 3)
 		 | ((address_expr->X_add_number & 0xf800000) >> 7)


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