public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [SH64 Patch] Add diagnostic messages to gas
@ 2004-12-15 14:39 Andrew STUBBS
  0 siblings, 0 replies; only message in thread
From: Andrew STUBBS @ 2004-12-15 14:39 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 359 bytes --]

SHmedia PT instructions are not permitted to have expressions as
arguments. This is currently tested, but instead of giving an error
message the bad code is just ignored.

The attached patch adds a simple error message. This should be enough to
bring the problem to the user's attention.

-- 
Andrew Stubbs
andrew.stubbs@st.com
(aka. andrew.stubbs@superh.com)

[-- Attachment #2: sh64-diagnostic.patch --]
[-- Type: text/plain, Size: 1023 bytes --]

2004-12-14  Andrew Stubbs  <andrew.stubbs@st.com>

	* config/tc-sh64.c (shmedia_build_Mytes): Emit an error message rather
	than just ignoring bad code.

--- src/gas/config/tc-sh64.c	2004-01-14 21:07:45.000000000 +0000
+++ src/gas/config/tc-sh64.c	2004-12-15 14:17:43.000000000 +0000
@@ -2672,7 +2711,10 @@ shmedia_build_Mytes (shmedia_opcode_info
 
 	    /* Don't allow complex expressions here.  */
 	    if (opjp->immediate.X_op_symbol != NULL)
-	      return 0;
+	      {
+		as_bad(_("invalid operand: expression in PT target"));
+		return 0;
+	      }
 
 	    if (opjp->reloctype == BFD_RELOC_32_PLT_PCREL)
 	      init = max = min = SH64PCRELPLT;
@@ -2709,7 +2751,10 @@ shmedia_build_Mytes (shmedia_opcode_info
 
 	    /* Don't allow complex expressions here.  */
 	    if (opjp->immediate.X_op_symbol != NULL)
-	      return 0;
+	      {
+		as_bad(_("invalid operand: expression in PT target"));
+		return 0;
+	      }
 
 	    if (opjp->reloctype == BFD_RELOC_32_PLT_PCREL)
 	      init = max = min = SH64PCRELPLT;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-15 14:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-15 14:39 [SH64 Patch] Add diagnostic messages to gas Andrew STUBBS

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).