public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] MIPS/BFD: Update cross-mode jump failure message
@ 2012-08-02 17:14 Maciej W. Rozycki
  2012-08-02 18:50 ` Richard Sandiford
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2012-08-02 17:14 UTC (permalink / raw)
  To: binutils; +Cc: Richard Sandiford, Catherine Moore

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.

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

* Re: [PATCH] MIPS/BFD: Update cross-mode jump failure message
  2012-08-02 17:14 [PATCH] MIPS/BFD: Update cross-mode jump failure message Maciej W. Rozycki
@ 2012-08-02 18:50 ` Richard Sandiford
  2012-08-03 22:18   ` Maciej W. Rozycki
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Sandiford @ 2012-08-02 18:50 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: binutils, Catherine Moore

"Maciej W. Rozycki" <macro@codesourcery.com> writes:
> 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.

OK, thanks.

Richard

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

* Re: [PATCH] MIPS/BFD: Update cross-mode jump failure message
  2012-08-02 18:50 ` Richard Sandiford
@ 2012-08-03 22:18   ` Maciej W. Rozycki
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2012-08-03 22:18 UTC (permalink / raw)
  To: Richard Sandiford; +Cc: binutils, Catherine Moore

On Thu, 2 Aug 2012, Richard Sandiford wrote:

> > 	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.
> 
> OK, thanks.

 Applied, thanks.

  Maciej

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

end of thread, other threads:[~2012-08-03 22:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-02 17:14 [PATCH] MIPS/BFD: Update cross-mode jump failure message Maciej W. Rozycki
2012-08-02 18:50 ` Richard Sandiford
2012-08-03 22:18   ` Maciej W. Rozycki

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