[committed] MIPS/BFD: Don't stop processing on a cross-mode jump conversion error

Maciej W. Rozycki macro@imgtec.com
Tue Jun 21 13:19:00 GMT 2016


As with commit ed53407eec9e ("MIPS/BFD: Don't stop processing on 
`bfd_reloc_outofrange'") don't bail out right away and instead continue 
processing on a cross-mode jump conversion error, so that any further 
issues are also reported.  Adjust message formatting accordingly, using 
`%X' to abort processing at conclusion.  Remove the full stop from the 
end of the message, for consistency across error reporting.

Adjust the corresponding test case accordingly and make it trigger the 
error twice.

	bfd/
	* elfxx-mips.c (mips_elf_perform_relocation): Call 
	`info->callbacks->einfo' rather than `*_bfd_error_handler' and 
	use the `%X%H' format for the cross-mode jump conversion error 
	message.  Remove the full stop from the end of the message.  
	Continue processing rather than returning failure.

	ld/
	* testsuite/ld-mips-elf/mode-change-error-1a.s: Trigger an error 
	twice rather than once.
	* testsuite/ld-mips-elf/mode-change-error-1.d: Adjust 
	accordingly.  Remove the full stop from the end of the message. 
---
 I have committed this change.

  Maciej

binutils-mips-bfd-cross-mode-jump-msg-error.diff
Index: binutils/bfd/elfxx-mips.c
===================================================================
--- binutils.orig/bfd/elfxx-mips.c	2016-06-17 22:50:19.291237991 +0100
+++ binutils/bfd/elfxx-mips.c	2016-06-17 23:09:54.105847940 +0100
@@ -6273,13 +6273,11 @@ mips_elf_perform_relocation (struct bfd_
          convert J or JALS to JALX.  */
       if (!ok)
 	{
-	  (*_bfd_error_handler)
-	    (_("%B: %A+0x%lx: Unsupported jump between ISA modes; consider recompiling with interlinking enabled."),
-	     input_bfd,
-	     input_section,
-	     (unsigned long) relocation->r_offset);
-	  bfd_set_error (bfd_error_bad_value);
-	  return FALSE;
+	  info->callbacks->einfo
+	    (_("%X%H: Unsupported jump between ISA modes; "
+	       "consider recompiling with interlinking enabled\n"),
+	     input_bfd, input_section, relocation->r_offset);
+	  return TRUE;
 	}
 
       /* Make this the JALX opcode.  */
Index: binutils/ld/testsuite/ld-mips-elf/mode-change-error-1.d
===================================================================
--- binutils.orig/ld/testsuite/ld-mips-elf/mode-change-error-1.d	2016-01-05 00:05:35.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/mode-change-error-1.d	2016-06-17 23:26:50.663371867 +0100
@@ -2,4 +2,7 @@
 #source: mode-change-error-1a.s
 #source: mode-change-error-1b.s
 #ld: -e 0x8000000
-#error: .*: Unsupported jump between ISA modes; consider recompiling with interlinking enabled.
+#error: \A[^\n]*: In function `main':\n
+#error:   \(\.text\+0x0\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n
+#error:   [^\n]*: In function `main':\n
+#error:   \(\.text\+0x8\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\Z
Index: binutils/ld/testsuite/ld-mips-elf/mode-change-error-1a.s
===================================================================
--- binutils.orig/ld/testsuite/ld-mips-elf/mode-change-error-1a.s	2016-01-05 00:05:35.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/mode-change-error-1a.s	2016-06-17 23:20:03.466238148 +0100
@@ -13,5 +13,8 @@
 	j	doit
 	nop
 
+	j	doit
+	nop
+
 	.end	main
 	.size	main, .-main



More information about the Binutils mailing list