public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Relax MIPS j/jal out-of-range check
@ 2006-05-09 14:58 Thiemo Seufer
  2006-05-09 15:04 ` Daniel Jacobowitz
  0 siblings, 1 reply; 12+ messages in thread
From: Thiemo Seufer @ 2006-05-09 14:58 UTC (permalink / raw)
  To: binutils

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)

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2006-05-11 14:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-09 14:58 [PATCH] Relax MIPS j/jal out-of-range check Thiemo Seufer
2006-05-09 15:04 ` Daniel Jacobowitz
2006-05-09 16:10   ` Paul Koning
2006-05-09 16:11     ` Daniel Jacobowitz
2006-05-10 15:24       ` Thiemo Seufer
2006-05-10 17:05         ` Daniel Jacobowitz
2006-05-10 17:17           ` Thiemo Seufer
2006-05-10 20:13             ` Daniel Jacobowitz
2006-05-11  3:11               ` Eric Christopher
2006-05-11 12:26                 ` Richard Sandiford
2006-05-11 19:03               ` Thiemo Seufer
2006-05-09 18:26     ` Thiemo Seufer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).