[PATCH] MIPS/BFD: Update cross-mode jump failure message

Maciej W. Rozycki macro@codesourcery.com
Thu Aug 2 17:14:00 GMT 2012


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.



More information about the Binutils mailing list