summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2016-06-21 14:06:27 +0100
committerMaciej W. Rozycki <macro@imgtec.com>2016-06-21 14:18:23 +0100
commit5f68df25f869d74f0235276a81536392fd376e6d (patch)
treedd8c7be1f1586b18720cd8c263f13d65ae593e97
parent04d59df6f311bcc20d74ada64a5e15a4bbb40026 (diff)
downloadbinutils-gdb-5f68df25f869d74f0235276a81536392fd376e6d.tar.gz
MIPS/BFD: Don't stop processing on a cross-mode jump conversion error
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.
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elfxx-mips.c12
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/testsuite/ld-mips-elf/mode-change-error-1.d5
-rw-r--r--ld/testsuite/ld-mips-elf/mode-change-error-1a.s3
5 files changed, 27 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2b87660cfc2..fe19a0110da 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,11 @@
+2016-06-21 Maciej W. Rozycki <macro@imgtec.com>
+
+ * 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.
+
2016-06-21 Graham Markall <graham.markall@embecosm.com>
* archures.c: Remove bfd_mach_arc_nps400.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index e2f47499e93..3b7723e3d0e 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -6273,13 +6273,11 @@ mips_elf_perform_relocation (struct bfd_link_info *info,
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. */
diff --git a/ld/ChangeLog b/ld/ChangeLog
index f1c1fe7d1f2..7a2d781fc7b 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2016-06-21 Maciej W. Rozycki <macro@imgtec.com>
+
+ * 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.
+
2016-06-21 Graham Markall <graham.markall@embecosm.com>
* testsuite/ld-arc/nps-1a.d: Use -mcpu=arc700 -mnps400.
diff --git a/ld/testsuite/ld-mips-elf/mode-change-error-1.d b/ld/testsuite/ld-mips-elf/mode-change-error-1.d
index 885c62809dc..cab1ddb3a0f 100644
--- a/ld/testsuite/ld-mips-elf/mode-change-error-1.d
+++ b/ld/testsuite/ld-mips-elf/mode-change-error-1.d
@@ -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
diff --git a/ld/testsuite/ld-mips-elf/mode-change-error-1a.s b/ld/testsuite/ld-mips-elf/mode-change-error-1a.s
index 44bdb1f7229..d52caf5a77c 100644
--- a/ld/testsuite/ld-mips-elf/mode-change-error-1a.s
+++ b/ld/testsuite/ld-mips-elf/mode-change-error-1a.s
@@ -13,5 +13,8 @@ main:
j doit
nop
+ j doit
+ nop
+
.end main
.size main, .-main