aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2018-11-27 16:34:03 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2018-11-27 16:34:03 +0000
commitaff68bd0415c6f834cf1717865b5b44dea6b9ef5 (patch)
tree56c35189c5c0b549fe18fd4a264a2915b26ab24b /bfd
parenta5990ada637d978c43c6ff07941c56e97a3e6965 (diff)
downloadgdb-aff68bd0415c6f834cf1717865b5b44dea6b9ef5.zip
gdb-aff68bd0415c6f834cf1717865b5b44dea6b9ef5.tar.gz
gdb-aff68bd0415c6f834cf1717865b5b44dea6b9ef5.tar.bz2
MIPS/LD: Continue processing with refused relocations in PIC code
Switch from `_bfd_error_handler' to `info->callbacks->einfo' with error reporting concerning the use of position-dependent relocations such as R_MIPS_HI16 or R_MIPS_26 in PIC code and continue processing so that any subsequent link errors are also shown rather than the linker terminating right away. This can reduce user frustration where correcting one error only reveals another one; instead all are shown together making them all possible to investigate at once. The use of the `%X' specifier causes the linker to terminate unsuccessfully at the end of processing. Also fix the message to say `cannot' rather than `can not'. bfd/ * elfxx-mips.c (_bfd_mips_elf_check_relocs) <R_MIPS16_26> <R_MIPS_26, R_MICROMIPS_26_S1>: Use `info->callbacks->einfo' rather than `_bfd_error_handler' to report refused relocations in PIC code and continue processing. Fix error message: `can not' -> `cannot'.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elfxx-mips.c11
2 files changed, 13 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 272ae0e..e737f35 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,11 @@
+2018-11-27 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * elfxx-mips.c (_bfd_mips_elf_check_relocs) <R_MIPS16_26>
+ <R_MIPS_26, R_MICROMIPS_26_S1>: Use `info->callbacks->einfo'
+ rather than `_bfd_error_handler' to report refused relocations
+ in PIC code and continue processing. Fix error message: `can
+ not' -> `cannot'.
+
2018-11-27 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/23919
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index dfb3601..298f465 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -9077,14 +9077,13 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_MIPS_26:
case R_MICROMIPS_26_S1:
howto = MIPS_ELF_RTYPE_TO_HOWTO (abfd, r_type, FALSE);
- _bfd_error_handler
+ info->callbacks->einfo
/* xgettext:c-format */
- (_("%pB: relocation %s against `%s' can not be used"
- " when making a shared object; recompile with -fPIC"),
- abfd, howto->name,
+ (_("%X%H: relocation %s against `%s' cannot be used"
+ " when making a shared object; recompile with -fPIC\n"),
+ abfd, sec, rel->r_offset, howto->name,
(h) ? h->root.root.string : "a local symbol");
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
+ break;
default:
break;
}