aboutsummaryrefslogtreecommitdiff
path: root/bfd/reloc.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-07-24 11:27:33 +0100
committerNick Clifton <nickc@redhat.com>2017-07-24 11:27:33 +0100
commit47aeb64c10ec9c9f06d2d2f4451f417d63b023e1 (patch)
treeb29b88b2fe25f814ad01225d316dd28688ca4ca1 /bfd/reloc.c
parent645b28002711eba22e8a4df3733a01206ab7d36d (diff)
downloadgdb-47aeb64c10ec9c9f06d2d2f4451f417d63b023e1.zip
gdb-47aeb64c10ec9c9f06d2d2f4451f417d63b023e1.tar.gz
gdb-47aeb64c10ec9c9f06d2d2f4451f417d63b023e1.tar.bz2
Improve "unrecognized relocation" error messages to add the suggestion that the linker might be out of date.
PR 21803 * reloc.c (_bfd_unrecognized_reloc): New function. Reports an unrecognized reloc and sets the bfd_error value. * libbfd.h: Regenerate. * elf32-arm.c (elf32_arm_final_link_relocate): Use the new function. * elf32-i386.c (elf_i386_relocate_section): Likewise. * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise. * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise. * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise. * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
Diffstat (limited to 'bfd/reloc.c')
-rw-r--r--bfd/reloc.c43
1 files changed, 37 insertions, 6 deletions
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 8512261..97a17f5 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -50,6 +50,7 @@ SECTION
#include "bfd.h"
#include "bfdlink.h"
#include "libbfd.h"
+#include "bfdver.h"
/*
DOCDD
INODE
@@ -8281,13 +8282,43 @@ DESCRIPTION
Installs a new set of internal relocations in SECTION.
*/
-
-void _bfd_generic_set_reloc
- (bfd *abfd ATTRIBUTE_UNUSED,
- sec_ptr section,
- arelent **relptr,
- unsigned int count)
+void
+_bfd_generic_set_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ sec_ptr section,
+ arelent **relptr,
+ unsigned int count)
{
section->orelocation = relptr;
section->reloc_count = count;
}
+
+/*
+INTERNAL_FUNCTION
+ _bfd_unrecognized_reloc
+
+SYNOPSIS
+ bfd_boolean _bfd_unrecognized_reloc
+ (bfd * abfd,
+ sec_ptr section,
+ unsigned int r_type);
+
+DESCRIPTION
+ Reports an unrecognized reloc.
+ Written as a function in order to reduce code duplication.
+ Returns FALSE so that it can be called from a return statement.
+*/
+
+bfd_boolean
+_bfd_unrecognized_reloc (bfd * abfd, sec_ptr section, unsigned int r_type)
+{
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%B: unrecognized relocation (%#x) in section `%A'"),
+ abfd, r_type, section);
+
+ /* PR 21803: Suggest the most likely cause of this error. */
+ _bfd_error_handler (_("Is this version of the linker - %s - out of date ?"),
+ BFD_VERSION_STRING);
+
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+}