public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@codesourcery.com>
To: <binutils@sourceware.org>
Cc: Richard Sandiford <rdsandiford@googlemail.com>,
	Catherine Moore	<clm@codesourcery.com>
Subject: [PATCH] MIPS/BFD: Update cross-mode jump failure message
Date: Thu, 02 Aug 2012 17:14:00 -0000	[thread overview]
Message-ID: <alpine.DEB.1.10.1208021715560.20608@tp.orcam.me.uk> (raw)

Hi,

 Here's an update to the error message produced whenever the linker fails 
to find a way to convert an immediate jump so that it can switch between 
execution modes.  The message was originally rather cryptic though 
universal, and then converted to the current one before or around the time 
microMIPS support was merged.

 For switching to/from the MIPS16 mode it is indeed quite accurate as in 
that case it is only standard MIPS J direct jump instruction that cannot 
be converted (there's no MIPS16 J instruction).  However in the microMIPS 
mode there is also the JALS call instruction that may not be converted, 
because there's no complementing JALXS instruction.  An ordinary JALX 
cannot be used because the instruction requires a 32-bit delay-slot 
instruction, while JALS requires a 16-bit delay-slot instruction.

 No regressions in testing with the set of 23 MIPS targets mentioned 
before.

 OK to apply?  If not, then I'm open to suggestions as to a better 
message, but in the context of microMIPS code and the JALS instruction I 
find the current one confusing.

2012-08-02  Maciej W. Rozycki  <macro@codesourcery.com>

	bfd/
	* elfxx-mips.c (mips_elf_perform_relocation): Update the 
	cross-mode jump message.

	ld/testsuite/
	* ld-mips-elf/mode-change-error-1.d: Update the error message.

  Maciej

binutils-umips-bfd-jals-err.diff
Index: binutils-fsf-trunk-quilt/bfd/elfxx-mips.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/bfd/elfxx-mips.c	2012-07-26 02:30:37.681785764 +0100
+++ binutils-fsf-trunk-quilt/bfd/elfxx-mips.c	2012-07-26 02:30:42.461785004 +0100
@@ -5938,11 +5938,12 @@ mips_elf_perform_relocation (struct bfd_
 	  jalx_opcode = 0x1d;
 	}
 
-      /* If the opcode is not JAL or JALX, there's a problem.  */
+      /* If the opcode is not JAL or JALX, there's a problem.  We cannot
+         convert J or JALS to JALX.  */
       if (!ok)
 	{
 	  (*_bfd_error_handler)
-	    (_("%B: %A+0x%lx: Direct jumps between ISA modes are not allowed; consider recompiling with interlinking enabled."),
+	    (_("%B: %A+0x%lx: Unsupported jump between ISA modes; consider recompiling with interlinking enabled."),
 	     input_bfd,
 	     input_section,
 	     (unsigned long) relocation->r_offset);
Index: binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/mode-change-error-1.d
===================================================================
--- binutils-fsf-trunk-quilt.orig/ld/testsuite/ld-mips-elf/mode-change-error-1.d	2012-07-26 02:30:32.411787627 +0100
+++ binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/mode-change-error-1.d	2012-07-26 02:30:42.461785004 +0100
@@ -2,4 +2,4 @@
 #source: mode-change-error-1a.s
 #source: mode-change-error-1b.s
 #ld: -e 0x8000000
-#error: .*: Direct jumps between ISA modes are not allowed; consider recompiling with interlinking enabled.
+#error: .*: Unsupported jump between ISA modes; consider recompiling with interlinking enabled.

             reply	other threads:[~2012-08-02 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02 17:14 Maciej W. Rozycki [this message]
2012-08-02 18:50 ` Richard Sandiford
2012-08-03 22:18   ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.1.10.1208021715560.20608@tp.orcam.me.uk \
    --to=macro@codesourcery.com \
    --cc=binutils@sourceware.org \
    --cc=clm@codesourcery.com \
    --cc=rdsandiford@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).