This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/8] unrecognized/unsupported reloc message


It must get boring translating all the variants we have of
unrecognized/unsupported/invalid/unexpected reloc number.  This patch
cuts down on the number of variations.

	* aoutx.h, * coff-alpha.c, * coff-i860.c, * coff-m68k.c,
	* coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
	* coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-w65.c,
	* elf-bfd.h, * elf-m10300.c, * elf.c, * elf32-avr.c, * elf32-bfin.c,
	* elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c,
	* elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
	* elf32-fr30.c, * elf32-frv.c, * elf32-i370.c, * elf32-i386.c,
	* elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c,
	* elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
	* elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
	* elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c,
	* elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-or1k.c,
	* elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-rx.c,
	* elf32-s390.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
	* elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
	* elf32-xgate.c, * elf32-xtensa.c, * elf64-alpha.c,
	* elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
	* elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
	* elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
	* elfnn-riscv.c, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-riscv.h,
	* elfxx-sparc.c, * elfxx-sparc.h, * reloc.c: Standardize
	unrecognized/unsupported reloc message.

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ab44a01..8d89b13 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,30 @@
 2018-02-23  Alan Modra  <amodra@gmail.com>
 
+	* aoutx.h, * coff-alpha.c, * coff-i860.c, * coff-m68k.c,
+	* coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
+	* coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-w65.c,
+	* elf-bfd.h, * elf-m10300.c, * elf.c, * elf32-avr.c, * elf32-bfin.c,
+	* elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c,
+	* elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
+	* elf32-fr30.c, * elf32-frv.c, * elf32-i370.c, * elf32-i386.c,
+	* elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c,
+	* elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
+	* elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
+	* elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c,
+	* elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-or1k.c,
+	* elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-rx.c,
+	* elf32-s390.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
+	* elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
+	* elf32-xgate.c, * elf32-xtensa.c, * elf64-alpha.c,
+	* elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
+	* elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
+	* elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
+	* elfnn-riscv.c, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-riscv.h,
+	* elfxx-sparc.c, * elfxx-sparc.h, * reloc.c: Standardize
+	unrecognized/unsupported reloc message.
+
+2018-02-23  Alan Modra  <amodra@gmail.com>
+
 	* elf32-ppc.c: Standardize error/warning messages.  Use
 	_bfd_error_handler rather than einfo when einfo features not used.
 	* elf64-ppc.c: Likewise.
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 16a4034..402b602 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -4089,8 +4089,8 @@ aout_link_input_section_std (struct aout_final_link_info *flaginfo,
 
       if (howto == NULL)
 	{
-	  (*flaginfo->info->callbacks->einfo)
-	    (_("%P: %pB: unexpected relocation type\n"), input_bfd);
+	  _bfd_error_handler (_("%pB: unsupported relocation type"),
+			      input_bfd);
 	  bfd_set_error (bfd_error_bad_value);
 	  return FALSE;
 	}
@@ -4410,8 +4410,8 @@ aout_link_input_section_ext (struct aout_final_link_info *flaginfo,
 
       if (r_type >= TABLE_SIZE (howto_table_ext))
 	{
-	  (*flaginfo->info->callbacks->einfo)
-	    (_("%P: %pB: unexpected relocation type\n"), input_bfd);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      input_bfd, r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  return FALSE;
 	}
diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c
index 75060bb..2d89035 100644
--- a/bfd/coff-alpha.c
+++ b/bfd/coff-alpha.c
@@ -598,9 +598,8 @@ alpha_adjust_reloc_in (bfd *abfd,
   if (intern->r_type > ALPHA_R_GPVALUE)
     {
       /* xgettext:c-format */
-      _bfd_error_handler
-	(_("%pB: unknown/unsupported relocation type %d"),
-	 abfd, intern->r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, intern->r_type);
       bfd_set_error (bfd_error_bad_value);
       rptr->addend = 0;
       rptr->howto  = NULL;
@@ -1499,24 +1498,21 @@ alpha_relocate_section (bfd *output_bfd,
       switch (r_type)
 	{
 	case ALPHA_R_GPRELHIGH:
-	  _bfd_error_handler
-	    (_("%pB: unsupported relocation: ALPHA_R_GPRELHIGH"),
-	     input_bfd);
+	  _bfd_error_handler (_("%pB: %s unsupported"),
+			      input_bfd, "ALPHA_R_GPRELHIGH");
 	  bfd_set_error (bfd_error_bad_value);
 	  continue;
 
 	case ALPHA_R_GPRELLOW:
-	  _bfd_error_handler
-	    (_("%pB: unsupported relocation: ALPHA_R_GPRELLOW"),
-	     input_bfd);
+	  _bfd_error_handler (_("%pB: %s unsupported"),
+			      input_bfd, "ALPHA_R_GPRELLOW");
 	  bfd_set_error (bfd_error_bad_value);
 	  continue;
 
 	default:
-	  _bfd_error_handler
-	    /* xgettext:c-format */
-	    (_("%pB: unknown relocation type %d"),
-	     input_bfd, (int) r_type);
+	  /* xgettext:c-format */
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      input_bfd, (int) r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  continue;
 
diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c
index f5d8e88..9ff96ea 100644
--- a/bfd/coff-i860.c
+++ b/bfd/coff-i860.c
@@ -139,7 +139,7 @@ coff_i860_reloc (bfd *abfd,
    these relocations.  */
 
 static bfd_reloc_status_type
-coff_i860_reloc_nyi (bfd *abfd ATTRIBUTE_UNUSED,
+coff_i860_reloc_nyi (bfd *abfd,
 		     arelent *reloc_entry,
 		     asymbol *symbol ATTRIBUTE_UNUSED,
 		     void *data ATTRIBUTE_UNUSED,
@@ -148,7 +148,7 @@ coff_i860_reloc_nyi (bfd *abfd ATTRIBUTE_UNUSED,
 		     char **error_message ATTRIBUTE_UNUSED)
 {
   reloc_howto_type *howto = reloc_entry->howto;
-  _bfd_error_handler (_("relocation `%s' not yet implemented"), howto->name);
+  _bfd_error_handler (_("%pB: %s unsupported"), abfd, howto->name);
   return bfd_reloc_notsupported;
 }
 
diff --git a/bfd/coff-m68k.c b/bfd/coff-m68k.c
index 0fbff22..f7777a1 100644
--- a/bfd/coff-m68k.c
+++ b/bfd/coff-m68k.c
@@ -485,7 +485,7 @@ bfd_m68k_coff_create_embedded_relocs (bfd *abfd,
       /* We can only relocate absolute longword relocs at run time.  */
       if (irel->r_type != R_RELLONG)
 	{
-	  *errmsg = _("unsupported reloc type");
+	  *errmsg = _("unsupported relocation type");
 	  bfd_set_error (bfd_error_bad_value);
 	  return FALSE;
 	}
diff --git a/bfd/coff-mcore.c b/bfd/coff-mcore.c
index fccd4ad..c962db6 100644
--- a/bfd/coff-mcore.c
+++ b/bfd/coff-mcore.c
@@ -470,7 +470,7 @@ coff_mcore_relocate_section (bfd * output_bfd,
 	{
 	default:
 	  /* xgettext: c-format */
-	  _bfd_error_handler (_("%pB: unsupported relocation type 0x%02x"),
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			      input_bfd, r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  return FALSE;
diff --git a/bfd/coff-ppc.c b/bfd/coff-ppc.c
index a27b8b6..375ed18 100644
--- a/bfd/coff-ppc.c
+++ b/bfd/coff-ppc.c
@@ -1038,9 +1038,9 @@ coff_ppc_relocate_section (bfd *output_bfd,
       switch (r_type)
 	{
 	default:
-	  _bfd_error_handler
-	    /* xgettext: c-format */
-	    (_("%pB: unsupported relocation type 0x%02x"), input_bfd, r_type);
+	  /* xgettext: c-format */
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      input_bfd, r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  return FALSE;
 	case IMAGE_REL_PPC_TOCREL16:
@@ -1240,7 +1240,7 @@ coff_ppc_relocate_section (bfd *output_bfd,
 
 	    _bfd_error_handler
 	      /* xgettext: c-format */
-	      (_("Warning: unsupported reloc %s <file %pB, section %pA>\n"
+	      (_("warning: unsupported reloc %s <file %pB, section %pA>\n"
 		 "sym %ld (%s), r_vaddr %" PRId64 " (%#" PRIx64 ")"),
 	       howto->name, input_bfd, input_section,
 	       rel->r_symndx, my_name,
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index d1253df..d8db1f3 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -2770,7 +2770,7 @@ xcoff_reloc_type_fail (bfd *input_bfd,
 {
   _bfd_error_handler
     /* xgettext: c-format */
-    (_("%pB: unsupported relocation type 0x%02x"),
+    (_("%pB: unsupported relocation type %#x"),
      input_bfd, (unsigned int) rel->r_type);
   bfd_set_error (bfd_error_bad_value);
   return FALSE;
diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c
index c4ad234..3251d41 100644
--- a/bfd/coff-sh.c
+++ b/bfd/coff-sh.c
@@ -492,7 +492,7 @@ static const struct shcoff_reloc_map sh_reloc_map[] =
 #define coff_bfd_reloc_name_lookup sh_coff_reloc_name_lookup
 
 static reloc_howto_type *
-sh_coff_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
+sh_coff_reloc_type_lookup (bfd *abfd,
 			   bfd_reloc_code_real_type code)
 {
   unsigned int i;
@@ -501,7 +501,8 @@ sh_coff_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
     if (sh_reloc_map[i].bfd_reloc_val == code)
       return &sh_coff_howtos[(int) sh_reloc_map[i].shcoff_reloc_val];
 
-  _bfd_error_handler (_("SH Error: unknown reloc type %d"), code);
+  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+		      abfd, (unsigned int) code);
   return NULL;
 }
 
diff --git a/bfd/coff-tic4x.c b/bfd/coff-tic4x.c
index 0be90de..cb0f6a4 100644
--- a/bfd/coff-tic4x.c
+++ b/bfd/coff-tic4x.c
@@ -165,7 +165,8 @@ tic4x_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
    Called after some initial checking by the tic4x_rtype_to_howto fn
    below.  */
 static void
-tic4x_lookup_howto (arelent *internal,
+tic4x_lookup_howto (bfd *abfd,
+		    arelent *internal,
 		    struct internal_reloc *dst)
 {
   unsigned int i;
@@ -180,13 +181,13 @@ tic4x_lookup_howto (arelent *internal,
 	}
     }
 
-  _bfd_error_handler (_("Unrecognized reloc type 0x%x"),
-		      (unsigned int) dst->r_type);
+  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+		      abfd, (unsigned int) dst->r_type);
   abort();
 }
 
 static reloc_howto_type *
-coff_tic4x_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+coff_tic4x_rtype_to_howto (bfd *abfd,
 			   asection *sec,
 			   struct internal_reloc *rel,
 			   struct coff_link_hash_entry *h ATTRIBUTE_UNUSED,
@@ -201,7 +202,7 @@ coff_tic4x_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
        in the output section.  */
     *addendp = (sec->output_section->vma + sec->output_offset) - sec->vma;
 
-  tic4x_lookup_howto (&genrel, rel);
+  tic4x_lookup_howto (abfd, &genrel, rel);
 
   return genrel.howto;
 }
@@ -256,7 +257,7 @@ tic4x_reloc_processing (arelent *relent,
   /* !!     relent->section = (asection *) NULL;  */
 
   /* Fill in the relent->howto field from reloc->r_type.  */
-  tic4x_lookup_howto (relent, reloc);
+  tic4x_lookup_howto (abfd, relent, reloc);
 }
 
 
diff --git a/bfd/coff-tic54x.c b/bfd/coff-tic54x.c
index 2489d2f..75b9fb8 100644
--- a/bfd/coff-tic54x.c
+++ b/bfd/coff-tic54x.c
@@ -260,7 +260,8 @@ tic54x_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
    Called after some initial checking by the tic54x_rtype_to_howto fn below.  */
 
 static void
-tic54x_lookup_howto (arelent *internal,
+tic54x_lookup_howto (bfd *abfd,
+		     arelent *internal,
 		     struct internal_reloc *dst)
 {
   unsigned i;
@@ -275,8 +276,8 @@ tic54x_lookup_howto (arelent *internal,
 	}
     }
 
-  _bfd_error_handler (_("Unrecognized reloc type 0x%x"),
-		      (unsigned int) dst->r_type);
+  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+		      abfd, (unsigned int) dst->r_type);
   abort ();
 }
 
@@ -286,7 +287,7 @@ tic54x_lookup_howto (arelent *internal,
 #define coff_rtype_to_howto coff_tic54x_rtype_to_howto
 
 static reloc_howto_type *
-coff_tic54x_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+coff_tic54x_rtype_to_howto (bfd *abfd,
 			    asection *sec,
 			    struct internal_reloc *rel,
 			    struct coff_link_hash_entry *h ATTRIBUTE_UNUSED,
@@ -303,7 +304,7 @@ coff_tic54x_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
       *addendp = (sec->output_section->vma + sec->output_offset) - sec->vma;
     }
 
-  tic54x_lookup_howto (&genrel, rel);
+  tic54x_lookup_howto (abfd, &genrel, rel);
 
   return genrel.howto;
 }
@@ -394,7 +395,7 @@ tic54x_reloc_processing (arelent *relent,
   /* !!     relent->section = (asection *) NULL;*/
 
   /* Fill in the relent->howto field from reloc->r_type.  */
-  tic54x_lookup_howto (relent, reloc);
+  tic54x_lookup_howto (abfd, relent, reloc);
 }
 
 /* TI COFF v0, DOS tools (little-endian headers).  */
diff --git a/bfd/coff-tic80.c b/bfd/coff-tic80.c
index dda34fa..4120b60 100644
--- a/bfd/coff-tic80.c
+++ b/bfd/coff-tic80.c
@@ -438,7 +438,7 @@ rtype2howto (arelent *cache_ptr, struct internal_reloc *dst)
 	}
     }
 
-  _bfd_error_handler (_("Unrecognized reloc type 0x%x"),
+  _bfd_error_handler (_("unsupported relocation type %#x"),
 		      (unsigned int) dst->r_type);
   cache_ptr->howto = tic80_howto_table + 0;
 }
diff --git a/bfd/coff-w65.c b/bfd/coff-w65.c
index c9c58f7..68b2c94 100644
--- a/bfd/coff-w65.c
+++ b/bfd/coff-w65.c
@@ -349,7 +349,7 @@ w65_reloc16_extra_cases (bfd *abfd,
       }
       break;
     default:
-      printf (_("ignoring reloc %s\n"), reloc->howto->name);
+      _bfd_error_handler (_("%pB: %s unsupported"), abfd, reloc->howto->name);
       break;
 
     }
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 51e3fac..1edb31e 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1352,7 +1352,7 @@ struct elf_backend_data
     (bfd *);
 
   reloc_howto_type *(*elf_backend_mips_rtype_to_howto)
-    (unsigned int, bfd_boolean);
+    (bfd *, unsigned int, bfd_boolean);
 
   /* The swapping table to use when dealing with ECOFF information.
      Used for the MIPS ELF .mdebug section.  */
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index 795944e..7eb2eff 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -799,7 +799,7 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for an MN10300 ELF reloc.  */
 
 static void
-mn10300_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+mn10300_info_to_howto (bfd *abfd,
 		       arelent *cache_ptr,
 		       Elf_Internal_Rela *dst)
 {
@@ -809,7 +809,7 @@ mn10300_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= R_MN10300_MAX)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unrecognised MN10300 reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       r_type = R_MN10300_NONE;
diff --git a/bfd/elf.c b/bfd/elf.c
index 2fb8377..5984fe7 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -8959,10 +8959,9 @@ _bfd_elf_validate_reloc (bfd *abfd, arelent *areloc)
   return TRUE;
 
  fail:
-  _bfd_error_handler
-    /* xgettext:c-format */
-    (_("%pB: unsupported relocation type %s"),
-     abfd, areloc->howto->name);
+  /* xgettext:c-format */
+  _bfd_error_handler (_("%pB: %s unsupported"),
+		      abfd, areloc->howto->name);
   bfd_set_error (bfd_error_bad_value);
   return FALSE;
 }
diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
index 0849a8d..74934de 100644
--- a/bfd/elf32-avr.c
+++ b/bfd/elf32-avr.c
@@ -946,7 +946,7 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for an AVR ELF reloc.  */
 
 static void
-avr_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+avr_info_to_howto_rela (bfd *abfd,
 			arelent *cache_ptr,
 			Elf_Internal_Rela *dst)
 {
@@ -956,7 +956,8 @@ avr_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_AVR_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid AVR reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &elf_avr_howto_table[r_type];
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index 6964e07..8f15f9a 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -4687,7 +4687,7 @@ bfinfdpic_check_relocs (bfd *abfd, struct bfd_link_info *info,
 	bad_reloc:
 	  _bfd_error_handler
 	    /* xgettext:c-format */
-	    (_("%pB: unsupported relocation type %d"),
+	    (_("%pB: unsupported relocation type %#x"),
 	     abfd, (int) ELF32_R_TYPE (rel->r_info));
 	  return FALSE;
 	}
@@ -5340,7 +5340,7 @@ bfd_bfin_elf32_create_embedded_relocs (bfd *abfd,
       /* We can only relocate absolute longword relocs at run time.  */
       if (ELF32_R_TYPE (irel->r_info) != (int) R_BFIN_BYTE4_DATA)
 	{
-	  *errmsg = _("unsupported reloc type");
+	  *errmsg = _("unsupported relocation type");
 	  bfd_set_error (bfd_error_bad_value);
 	  goto error_return;
 	}
diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c
index d34f6d1..46d9fe2 100644
--- a/bfd/elf32-cr16.c
+++ b/bfd/elf32-cr16.c
@@ -641,7 +641,7 @@ _bfd_cr16_elf_create_got_section (bfd * abfd, struct bfd_link_info * info)
 /* Retrieve a howto ptr using a BFD reloc_code.  */
 
 static reloc_howto_type *
-elf_cr16_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+elf_cr16_reloc_type_lookup (bfd *abfd,
 			    bfd_reloc_code_real_type code)
 {
   unsigned int i;
@@ -650,7 +650,8 @@ elf_cr16_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
     if (code == cr16_reloc_map[i].bfd_reloc_enum)
       return &cr16_elf_howto_table[cr16_reloc_map[i].cr16_reloc_type];
 
-  _bfd_error_handler (_("Unsupported CR16 relocation type: 0x%x\n"), code);
+  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+		      abfd, code);
   return NULL;
 }
 
@@ -671,7 +672,7 @@ elf_cr16_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Retrieve a howto ptr using an internal relocation entry.  */
 
 static void
-elf_cr16_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
+elf_cr16_info_to_howto (bfd *abfd, arelent *cache_ptr,
 			Elf_Internal_Rela *dst)
 {
   unsigned int r_type = ELF32_R_TYPE (dst->r_info);
@@ -679,7 +680,7 @@ elf_cr16_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
   if (r_type >= R_CR16_MAX)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unrecognised CR16 reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       r_type = R_CR16_NONE;
@@ -2798,7 +2799,7 @@ bfd_cr16_elf32_create_embedded_relocs (bfd *abfd,
       if (!((ELF32_R_TYPE (irel->r_info) == (int) R_CR16_NUM32a)
 	  || (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_NUM32)))
 	{
-	  *errmsg = _("unsupported reloc type");
+	  *errmsg = _("unsupported relocation type");
 	  bfd_set_error (bfd_error_bad_value);
 	  goto error_return;
 	}
diff --git a/bfd/elf32-cr16c.c b/bfd/elf32-cr16c.c
index 79aed13..f2793a9 100644
--- a/bfd/elf32-cr16c.c
+++ b/bfd/elf32-cr16c.c
@@ -183,7 +183,8 @@ elf_cr16c_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= RINDEX_16C_MAX)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid CR16C reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &elf_howto_table[r_type];
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 31c06d3..4c6d4da 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -464,7 +464,8 @@ cris_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
   if (r_type >= R_CRIS_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid CRIS reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = & cris_elf_howto_table [r_type];
diff --git a/bfd/elf32-crx.c b/bfd/elf32-crx.c
index 109e227..90857c8 100644
--- a/bfd/elf32-crx.c
+++ b/bfd/elf32-crx.c
@@ -419,14 +419,14 @@ elf_crx_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Retrieve a howto ptr using an internal relocation entry.  */
 
 static void
-elf_crx_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
+elf_crx_info_to_howto (bfd *abfd, arelent *cache_ptr,
 		       Elf_Internal_Rela *dst)
 {
   unsigned int r_type = ELF32_R_TYPE (dst->r_info);
   if (r_type >= R_CRX_MAX)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unrecognised CRX reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       r_type = R_CRX_NONE;
diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c
index 344a1af..8dac777 100644
--- a/bfd/elf32-d10v.c
+++ b/bfd/elf32-d10v.c
@@ -221,7 +221,7 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for an D10V ELF reloc.  */
 
 static void
-d10v_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
+d10v_info_to_howto_rel (bfd *abfd,
 			arelent *cache_ptr,
 			Elf_Internal_Rela *dst)
 {
@@ -231,7 +231,8 @@ d10v_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_D10V_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid D10V reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &elf_d10v_howto_table[r_type];
diff --git a/bfd/elf32-d30v.c b/bfd/elf32-d30v.c
index 505560f..984b4c4 100644
--- a/bfd/elf32-d30v.c
+++ b/bfd/elf32-d30v.c
@@ -509,7 +509,7 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for an D30V ELF reloc (type REL).  */
 
 static void
-d30v_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
+d30v_info_to_howto_rel (bfd *abfd,
 			arelent *cache_ptr,
 			Elf_Internal_Rela *dst)
 {
@@ -519,7 +519,8 @@ d30v_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_D30V_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid D30V reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &elf_d30v_howto_table[r_type];
@@ -528,7 +529,7 @@ d30v_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for an D30V ELF reloc (type RELA).  */
 
 static void
-d30v_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+d30v_info_to_howto_rela (bfd *abfd,
 			 arelent *cache_ptr,
 			 Elf_Internal_Rela *dst)
 {
@@ -538,7 +539,8 @@ d30v_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_D30V_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid D30V reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &elf_d30v_howto_table[r_type];
diff --git a/bfd/elf32-dlx.c b/bfd/elf32-dlx.c
index 468e6cb..c89ab5c 100644
--- a/bfd/elf32-dlx.c
+++ b/bfd/elf32-dlx.c
@@ -530,7 +530,7 @@ elf32_dlx_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 }
 
 static reloc_howto_type *
-dlx_rtype_to_howto (unsigned int r_type)
+dlx_rtype_to_howto (bfd *abfd, unsigned int r_type)
 {
   switch (r_type)
     {
@@ -545,7 +545,8 @@ dlx_rtype_to_howto (unsigned int r_type)
     default:
       if (r_type >= (unsigned int) R_DLX_max)
 	{
-	  _bfd_error_handler (_("Invalid DLX reloc number: %d"), r_type);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, r_type);
 	  r_type = 0;
 	}
       return & dlx_elf_howto_table[r_type];
@@ -561,14 +562,14 @@ elf32_dlx_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
 }
 
 static void
-elf32_dlx_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
+elf32_dlx_info_to_howto_rel (bfd *abfd,
 			     arelent *cache_ptr,
 			     Elf_Internal_Rela *dst)
 {
   unsigned int r_type;
 
   r_type = ELF32_R_TYPE (dst->r_info);
-  cache_ptr->howto = dlx_rtype_to_howto (r_type);
+  cache_ptr->howto = dlx_rtype_to_howto (abfd, r_type);
   return;
 }
 
diff --git a/bfd/elf32-epiphany.c b/bfd/elf32-epiphany.c
index a6b7038..8c24541 100644
--- a/bfd/elf32-epiphany.c
+++ b/bfd/elf32-epiphany.c
@@ -363,7 +363,7 @@ epiphany_elf_relax_section (bfd *abfd, asection *sec,
 /* Set the howto pointer for a EPIPHANY ELF reloc.  */
 
 static void
-epiphany_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
+epiphany_info_to_howto_rela (bfd * abfd,
 			     arelent * cache_ptr,
 			     Elf_Internal_Rela * dst)
 {
@@ -373,7 +373,8 @@ epiphany_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_EPIPHANY_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid Epiphany reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = & epiphany_elf_howto_table [r_type];
diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c
index 1ef9ded..6d8a040 100644
--- a/bfd/elf32-fr30.c
+++ b/bfd/elf32-fr30.c
@@ -378,7 +378,8 @@ fr30_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_FR30_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid FR30 reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = & fr30_elf_howto_table [r_type];
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index b06ab36..6af2aaf 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -2554,7 +2554,8 @@ frv_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
       if (r_type >= (unsigned int) R_FRV_max)
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: invalid FRV reloc number: %d"), abfd, r_type);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, r_type);
 	  r_type = 0;
 	}
       cache_ptr->howto = & elf32_frv_howto_table [r_type];
@@ -6250,10 +6251,9 @@ elf32_frv_check_relocs (bfd *abfd,
 
 	default:
 	bad_reloc:
-	  info->callbacks->einfo
-	    /* xgettext:c-format */
-	    (_("%pB: unsupported relocation type %i\n"),
-	     abfd, ELF32_R_TYPE (rel->r_info));
+	  /* xgettext:c-format */
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, (unsigned int) ELF32_R_TYPE (rel->r_info));
 	  return FALSE;
 	}
     }
diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c
index 5f00189..37e7733 100644
--- a/bfd/elf32-i370.c
+++ b/bfd/elf32-i370.c
@@ -290,7 +290,7 @@ i370_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for an i370 ELF reloc.  */
 
 static void
-i370_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+i370_elf_info_to_howto (bfd *abfd,
 			arelent *cache_ptr,
 			Elf_Internal_Rela *dst)
 {
@@ -304,7 +304,7 @@ i370_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= R_I370_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unrecognised I370 reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       r_type = R_I370_NONE;
@@ -1078,7 +1078,7 @@ i370_elf_relocate_section (bfd *output_bfd,
 	  || !i370_elf_howto_table[(int)r_type])
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: unknown relocation type %d"),
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			      input_bfd, (int) r_type);
 
 	  bfd_set_error (bfd_error_bad_value);
@@ -1161,8 +1161,8 @@ i370_elf_relocate_section (bfd *output_bfd,
 	{
 	default:
 	  _bfd_error_handler
-	    (_("%pB: unknown relocation type %d for symbol %s"),
-	     input_bfd, (int) r_type, sym_name);
+	    (_("%pB: unsupported relocation type %#x"),
+	     input_bfd, (int) r_type);
 
 	  bfd_set_error (bfd_error_bad_value);
 	  ret = FALSE;
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 0906785..32b84e6 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -381,8 +381,8 @@ elf_i386_rtype_to_howto (bfd *abfd, unsigned r_type)
 	  >= R_386_vt - R_386_ext2))
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid relocation type %d"),
-			  abfd, (int) r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       indx = R_386_NONE;
     }
   /* PR 17512: file: 0f67f69d.  */
diff --git a/bfd/elf32-i960.c b/bfd/elf32-i960.c
index 0f85efa..dbfb1bb 100644
--- a/bfd/elf32-i960.c
+++ b/bfd/elf32-i960.c
@@ -137,7 +137,8 @@ elf32_i960_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
   if (type >= R_960_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid i960 reloc number: %d"), abfd, type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, type);
       type = 0;
     }
 
diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c
index 361f320..aa93524 100644
--- a/bfd/elf32-ip2k.c
+++ b/bfd/elf32-ip2k.c
@@ -1232,7 +1232,7 @@ ip2k_elf_relax_section (bfd *abfd,
 /* Set the howto pointer for a IP2K ELF reloc.  */
 
 static void
-ip2k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
+ip2k_info_to_howto_rela (bfd * abfd,
 			 arelent * cache_ptr,
 			 Elf_Internal_Rela * dst)
 {
@@ -1242,7 +1242,8 @@ ip2k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_IP2K_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid IP2K reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = & ip2k_elf_howto_table [r_type];
diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c
index 4a026de..14cd167 100644
--- a/bfd/elf32-iq2000.c
+++ b/bfd/elf32-iq2000.c
@@ -438,7 +438,8 @@ iq2000_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
       if (r_type >= (unsigned int) R_IQ2000_max)
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: invalid IQ2000 reloc number: %d"), abfd, r_type);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, r_type);
 	  r_type = 0;
 	}
       cache_ptr->howto = & iq2000_elf_howto_table [r_type];
diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c
index 23b8872..07279ed 100644
--- a/bfd/elf32-lm32.c
+++ b/bfd/elf32-lm32.c
@@ -526,7 +526,7 @@ lm32_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for an Lattice Mico32 ELF reloc.  */
 
 static void
-lm32_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+lm32_info_to_howto_rela (bfd *abfd,
 			 arelent *cache_ptr,
 			 Elf_Internal_Rela *dst)
 {
@@ -536,7 +536,8 @@ lm32_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_LM32_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid LM32 reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &lm32_elf_howto_table[r_type];
diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c
index db88506..6e7e71c 100644
--- a/bfd/elf32-m32c.c
+++ b/bfd/elf32-m32c.c
@@ -292,10 +292,9 @@ m32c_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
 /* Set the howto pointer for an M32C ELF reloc.  */
 
 static void
-m32c_info_to_howto_rela
-    (bfd *		 abfd ATTRIBUTE_UNUSED,
-     arelent *		 cache_ptr,
-     Elf_Internal_Rela * dst)
+m32c_info_to_howto_rela (bfd *abfd,
+			 arelent *cache_ptr,
+			 Elf_Internal_Rela *dst)
 {
   unsigned int r_type;
 
@@ -303,7 +302,8 @@ m32c_info_to_howto_rela
   if (r_type >= (unsigned int) R_M32C_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid M32C reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = & m32c_elf_howto_table [r_type];
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index 2801f04..dfbfc70 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -1283,7 +1283,8 @@ m32r_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type > (unsigned int) R_M32R_GNU_VTENTRY)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid M32R reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &m32r_elf_howto_table[r_type];
@@ -2401,7 +2402,7 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
       if (r_type < 0 || r_type >= (int) R_M32R_max)
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: unknown relocation type %d"),
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			      input_bfd, (int) r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  ret = FALSE;
diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c
index 794a2af..4c57fe8 100644
--- a/bfd/elf32-m68hc11.c
+++ b/bfd/elf32-m68hc11.c
@@ -378,7 +378,7 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for an M68HC11 ELF reloc.  */
 
 static void
-m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
+m68hc11_info_to_howto_rel (bfd *abfd,
 			   arelent *cache_ptr, Elf_Internal_Rela *dst)
 {
   unsigned int r_type;
@@ -387,7 +387,8 @@ m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_M68HC11_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid M68HC11 reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &elf_m68hc11_howto_table[r_type];
diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c
index bde75a1..d2300c4 100644
--- a/bfd/elf32-m68hc12.c
+++ b/bfd/elf32-m68hc12.c
@@ -498,7 +498,7 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for an M68HC11 ELF reloc.  */
 
 static void
-m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
+m68hc11_info_to_howto_rel (bfd *abfd,
 			   arelent *cache_ptr, Elf_Internal_Rela *dst)
 {
   unsigned int r_type;
@@ -507,7 +507,8 @@ m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_M68HC11_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid M68HC12 reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &elf_m68hc11_howto_table[r_type];
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 3414d28..95db3a0 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -349,8 +349,8 @@ rtype_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
   if (indx >= (unsigned int) R_68K_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid relocation type %d"),
-			  abfd, (int) indx);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, indx);
       indx = R_68K_NONE;
     }
   cache_ptr->howto = &howto_table[indx];
@@ -4385,7 +4385,7 @@ bfd_m68k_elf32_create_embedded_relocs (bfd *abfd, struct bfd_link_info *info,
       /* We can only relocate absolute longword relocs at run time.  */
       if (ELF32_R_TYPE (irel->r_info) != (int) R_68K_32)
 	{
-	  *errmsg = _("unsupported reloc type");
+	  *errmsg = _("unsupported relocation type");
 	  bfd_set_error (bfd_error_bad_value);
 	  goto error_return;
 	}
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c
index 397ca87..2e4d5c2 100644
--- a/bfd/elf32-mcore.c
+++ b/bfd/elf32-mcore.c
@@ -97,10 +97,9 @@ mcore_elf_unsupported_reloc (bfd * abfd,
   BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
 
   /* xgettext:c-format */
-  _bfd_error_handler (_("%pB: Relocation %s (%d) is not currently supported.\n"),
+  _bfd_error_handler (_("%pB: %s unsupported"),
 		      abfd,
-		      reloc_entry->howto->name,
-		      reloc_entry->howto->type);
+		      reloc_entry->howto->name);
 
   return bfd_reloc_notsupported;
 }
@@ -338,7 +337,7 @@ mcore_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for a RCE ELF reloc.  */
 
 static void
-mcore_elf_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
+mcore_elf_info_to_howto (bfd * abfd,
 			 arelent * cache_ptr,
 			 Elf_Internal_Rela * dst)
 {
@@ -352,7 +351,7 @@ mcore_elf_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
   if (r_type >= R_MCORE_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unrecognised MCore reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       r_type = R_MCORE_NONE;
@@ -437,7 +436,7 @@ mcore_elf_relocate_section (bfd * output_bfd,
 	  || ! mcore_elf_howto_table [(int)r_type])
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: Unknown relocation type %d\n"),
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			      input_bfd, (int) r_type);
 
 	  bfd_set_error (bfd_error_bad_value);
@@ -452,10 +451,9 @@ mcore_elf_relocate_section (bfd * output_bfd,
       if (howto->special_function == mcore_elf_unsupported_reloc)
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: Relocation %s (%d) is not currently supported.\n"),
+	  _bfd_error_handler (_("%pB: %s unsupported"),
 			      input_bfd,
-			      howto->name,
-			      (int)r_type);
+			      howto->name);
 
 	  bfd_set_error (bfd_error_bad_value);
 	  ret = FALSE;
diff --git a/bfd/elf32-mep.c b/bfd/elf32-mep.c
index 2d6ebb6..e03fe50 100644
--- a/bfd/elf32-mep.c
+++ b/bfd/elf32-mep.c
@@ -376,10 +376,9 @@ mep_final_link_relocate
 /* Set the howto pointer for a MEP ELF reloc.  */
 
 static void
-mep_info_to_howto_rela
-    (bfd *		 abfd ATTRIBUTE_UNUSED,
-     arelent *		 cache_ptr,
-     Elf_Internal_Rela * dst)
+mep_info_to_howto_rela (bfd *abfd,
+			arelent *cache_ptr,
+			Elf_Internal_Rela *dst)
 {
   unsigned int r_type;
 
@@ -387,7 +386,8 @@ mep_info_to_howto_rela
   if (r_type >= R_MEP_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid MEP reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = & mep_elf_howto_table [r_type];
diff --git a/bfd/elf32-metag.c b/bfd/elf32-metag.c
index c09a2ea..c4b2c48 100644
--- a/bfd/elf32-metag.c
+++ b/bfd/elf32-metag.c
@@ -865,7 +865,7 @@ tpoff (struct bfd_link_info *info, bfd_vma address)
 }
 
 static void
-metag_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+metag_info_to_howto_rela (bfd *abfd,
 			  arelent *cache_ptr,
 			  Elf_Internal_Rela *dst)
 {
@@ -875,7 +875,8 @@ metag_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_METAG_MAX)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid METAG reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = & elf_metag_howto_table [r_type];
diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
index a7e5476..388bda3 100644
--- a/bfd/elf32-microblaze.c
+++ b/bfd/elf32-microblaze.c
@@ -639,7 +639,7 @@ microblaze_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for a RCE ELF reloc.  */
 
 static void
-microblaze_elf_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
+microblaze_elf_info_to_howto (bfd * abfd,
 			      arelent * cache_ptr,
 			      Elf_Internal_Rela * dst)
 {
@@ -653,7 +653,7 @@ microblaze_elf_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
   if (r_type >= R_MICROBLAZE_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unrecognised MicroBlaze reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       r_type = R_MICROBLAZE_NONE;
@@ -929,7 +929,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
       if (r_type < 0 || r_type >= (int) R_MICROBLAZE_max)
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: unknown relocation type %d"),
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			      input_bfd, (int) r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  ret = FALSE;
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index fa0cc15..be462a1 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -57,8 +57,6 @@ static bfd_reloc_status_type mips32_64bit_reloc
   (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
 static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
   (bfd *, bfd_reloc_code_real_type);
-static reloc_howto_type *mips_elf32_rtype_to_howto
-  (unsigned int, bfd_boolean);
 static void mips_info_to_howto_rel
   (bfd *, arelent *, Elf_Internal_Rela *);
 static void mips_info_to_howto_rela
@@ -2196,7 +2194,8 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure.  */
 
 static reloc_howto_type *
-mips_elf32_rtype_to_howto (unsigned int r_type,
+mips_elf32_rtype_to_howto (bfd *abfd,
+			   unsigned int r_type,
 			   bfd_boolean rela_p ATTRIBUTE_UNUSED)
 {
   switch (r_type)
@@ -2222,7 +2221,8 @@ mips_elf32_rtype_to_howto (unsigned int r_type,
 	return &elf_mips16_howto_table_rel[r_type - R_MIPS16_min];
       if (r_type >= (unsigned int) R_MIPS_max)
 	{
-	  _bfd_error_handler (_("Unrecognised MIPS reloc number: %d"), r_type);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  r_type = R_MIPS_NONE;
 	}
@@ -2240,7 +2240,7 @@ mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
 
   r_type = ELF32_R_TYPE (dst->r_info);
   bed = get_elf_backend_data (abfd);
-  cache_ptr->howto = bed->elf_backend_mips_rtype_to_howto (r_type, FALSE);
+  cache_ptr->howto = bed->elf_backend_mips_rtype_to_howto (abfd, r_type, FALSE);
 
   /* The addend for a GPREL16 or LITERAL relocation comes from the GP
      value for the object file.  We get the addend now, rather than
diff --git a/bfd/elf32-moxie.c b/bfd/elf32-moxie.c
index 579aae2..7a617a8 100644
--- a/bfd/elf32-moxie.c
+++ b/bfd/elf32-moxie.c
@@ -124,7 +124,7 @@ moxie_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
 /* Set the howto pointer for an MOXIE ELF reloc.  */
 
 static void
-moxie_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+moxie_info_to_howto_rela (bfd *abfd,
 			  arelent *cache_ptr,
 			  Elf_Internal_Rela *dst)
 {
@@ -134,7 +134,8 @@ moxie_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_MOXIE_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid Moxie reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = & moxie_elf_howto_table [r_type];
diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c
index dd7802c..1f334c4 100644
--- a/bfd/elf32-msp430.c
+++ b/bfd/elf32-msp430.c
@@ -632,7 +632,7 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for an MSP430 ELF reloc.  */
 
 static void
-msp430_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
+msp430_info_to_howto_rela (bfd * abfd,
 			   arelent * cache_ptr,
 			   Elf_Internal_Rela * dst)
 {
@@ -645,7 +645,8 @@ msp430_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
       if (r_type >= (unsigned int) R_MSP430x_max)
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: invalid MSP430X reloc number: %d"), abfd, r_type);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, r_type);
 	  r_type = 0;
 	}
       cache_ptr->howto = elf_msp430x_howto_table + r_type;
@@ -655,7 +656,8 @@ msp430_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_MSP430_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid MSP430 reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &elf_msp430_howto_table[r_type];
diff --git a/bfd/elf32-mt.c b/bfd/elf32-mt.c
index 8ac873c..efaaf68 100644
--- a/bfd/elf32-mt.c
+++ b/bfd/elf32-mt.c
@@ -228,10 +228,9 @@ mt_elf_relocate_hi16
 /* Set the howto pointer for a MT ELF reloc.  */
 
 static void
-mt_info_to_howto_rela
-    (bfd *		 abfd ATTRIBUTE_UNUSED,
-     arelent *		 cache_ptr,
-     Elf_Internal_Rela * dst)
+mt_info_to_howto_rela (bfd *abfd,
+		       arelent *cache_ptr,
+		       Elf_Internal_Rela *dst)
 {
   unsigned int r_type;
 
@@ -239,7 +238,8 @@ mt_info_to_howto_rela
   if (r_type >= (unsigned int) R_MT_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid MT reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = & mt_elf_howto_table [r_type];
diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c
index bd7c0f1..e325db3 100644
--- a/bfd/elf32-nds32.c
+++ b/bfd/elf32-nds32.c
@@ -2894,7 +2894,8 @@ nds32_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
   if (r_type > R_NDS32_GNU_VTENTRY)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid NDS32 reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = bfd_elf32_bfd_reloc_type_table_lookup (r_type);
@@ -4449,7 +4450,7 @@ nds32_elf_relocate_section (bfd *		   output_bfd ATTRIBUTE_UNUSED,
       if (r_type >= R_NDS32_max)
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: error: unknown relocation type %d."),
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			      input_bfd, r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  ret = FALSE;
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
index e630a45..816c796 100644
--- a/bfd/elf32-or1k.c
+++ b/bfd/elf32-or1k.c
@@ -702,7 +702,7 @@ or1k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for an Or1k ELF reloc.  */
 
 static void
-or1k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
+or1k_info_to_howto_rela (bfd * abfd,
 			 arelent * cache_ptr,
 			 Elf_Internal_Rela * dst)
 {
@@ -712,7 +712,8 @@ or1k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_OR1K_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid OR1K reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = & or1k_elf_howto_table[r_type];
diff --git a/bfd/elf32-pj.c b/bfd/elf32-pj.c
index 3350f20..1c75523 100644
--- a/bfd/elf32-pj.c
+++ b/bfd/elf32-pj.c
@@ -311,7 +311,7 @@ pj_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Given an ELF reloc, fill in the howto field of a relent.  */
 
 static void
-pj_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+pj_elf_info_to_howto (bfd *abfd,
 		      arelent *cache_ptr,
 		      Elf_Internal_Rela *dst)
 {
@@ -322,7 +322,7 @@ pj_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
   if (r >= R_PJ_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unrecognised PicoJava reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r);
       bfd_set_error (bfd_error_bad_value);
       r = R_PJ_NONE;
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 9b6a5ca..be95498 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -2029,7 +2029,7 @@ ppc_elf_info_to_howto (bfd *abfd,
   if (r_type >= R_PPC_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unsupported reloc type %#x"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       r_type = R_PPC_NONE;
@@ -2041,7 +2041,7 @@ ppc_elf_info_to_howto (bfd *abfd,
   if (!cache_ptr->howto)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unsupported reloc type %#x"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
 
diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c
index 50d229f..0ca6dd1 100644
--- a/bfd/elf32-rl78.c
+++ b/bfd/elf32-rl78.c
@@ -289,7 +289,8 @@ rl78_info_to_howto_rela (bfd *		     abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_RL78_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid RL78 reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = rl78_elf_howto_table + r_type;
diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c
index b393a50..9257f79 100644
--- a/bfd/elf32-rx.c
+++ b/bfd/elf32-rx.c
@@ -301,9 +301,9 @@ rx_reloc_name_lookup (bfd * abfd ATTRIBUTE_UNUSED, const char * r_name)
 /* Set the howto pointer for an RX ELF reloc.  */
 
 static void
-rx_info_to_howto_rela (bfd *		   abfd ATTRIBUTE_UNUSED,
-		       arelent *	   cache_ptr,
-		       Elf_Internal_Rela * dst)
+rx_info_to_howto_rela (bfd *abfd,
+		       arelent *cache_ptr,
+		       Elf_Internal_Rela *dst)
 {
   unsigned int r_type;
 
@@ -311,7 +311,8 @@ rx_info_to_howto_rela (bfd *		   abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_RX_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid RX reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = rx_elf_howto_table + r_type;
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 64bfb2d..ce9c25f 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -343,8 +343,8 @@ elf_s390_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
       if (r_type >= sizeof (elf_howto_table) / sizeof (elf_howto_table[0]))
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: invalid relocation type %d"),
-			      abfd, (int) r_type);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, r_type);
 	  r_type = R_390_NONE;
 	}
       cache_ptr->howto = &elf_howto_table[r_type];
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 5cb4acc..91545f8 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -488,7 +488,7 @@ sh_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
       || (r >= R_SH_FIRST_INVALID_RELOC_6 && r <= R_SH_LAST_INVALID_RELOC_6))
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unrecognised SH reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r);
       bfd_set_error (bfd_error_bad_value);
       r = R_SH_NONE;
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index 0ce3e9c..8279550 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -146,7 +146,7 @@ spu_elf_bfd_to_reloc_type (bfd_reloc_code_real_type code)
 }
 
 static void
-spu_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+spu_elf_info_to_howto (bfd *abfd,
 		       arelent *cache_ptr,
 		       Elf_Internal_Rela *dst)
 {
@@ -157,7 +157,7 @@ spu_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= R_SPU_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unrecognised SPU reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       r_type = R_SPU_NONE;
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index d5d264d..0199c2c 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -2606,7 +2606,7 @@ elf32_tic6x_relocate_section (bfd *output_bfd,
 	default:
 	  /* Unknown relocation.  */
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: invalid relocation type %d"),
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			      input_bfd, r_type);
 	  ok = FALSE;
 	  continue;
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 3b5ce94..9a1b195 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -490,7 +490,8 @@ v850_elf_perform_relocation (bfd *abfd,
     {
     default:
 #ifdef DEBUG
-      fprintf (stderr, "%pB: reloc number %d not recognised\n", abfd, r_type);
+      _bfd_error_handler ("%pB: unsupported relocation type %#x",
+			  abfd, r_type);
 #endif
       return bfd_reloc_notsupported;
 
@@ -1885,7 +1886,7 @@ v850_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for an V850 ELF reloc.  */
 
 static void
-v850_elf_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
+v850_elf_info_to_howto_rel (bfd *abfd,
 			    arelent *cache_ptr,
 			    Elf_Internal_Rela *dst)
 {
@@ -1895,7 +1896,8 @@ v850_elf_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_V850_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid V850 reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &v850_elf_howto_table[r_type];
@@ -1904,8 +1906,8 @@ v850_elf_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for a V850 ELF reloc (type RELA).  */
 
 static void
-v850_elf_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
-			     arelent * cache_ptr,
+v850_elf_info_to_howto_rela (bfd *abfd,
+			     arelent *cache_ptr,
 			     Elf_Internal_Rela *dst)
 {
   unsigned int r_type;
@@ -1914,7 +1916,8 @@ v850_elf_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_V850_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid V850 reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &v850_elf_howto_table[r_type];
@@ -2145,7 +2148,8 @@ v850_elf_final_link_relocate (reloc_howto_type *howto,
 
     default:
 #ifdef DEBUG
-      fprintf (stderr, "%pB: reloc number %d not recognised\n", input_bfd, r_type);
+      _bfd_error_handler ("%pB: unsupported relocation type %#x",
+	       input_bfd, r_type);
 #endif
       return bfd_reloc_notsupported;
     }
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index 6cee38b..61310b6 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -287,7 +287,7 @@ rtype_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
   if (r_type >= R_VAX_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unrecognised VAX reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       r_type = R_VAX_NONE;
diff --git a/bfd/elf32-visium.c b/bfd/elf32-visium.c
index 18c5f75..9310d42 100644
--- a/bfd/elf32-visium.c
+++ b/bfd/elf32-visium.c
@@ -459,7 +459,7 @@ visium_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
 /* Set the howto pointer for a VISIUM ELF reloc.  */
 
 static void
-visium_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
+visium_info_to_howto_rela (bfd *abfd, arelent *cache_ptr,
 			   Elf_Internal_Rela *dst)
 {
   unsigned int r_type = ELF32_R_TYPE (dst->r_info);
@@ -478,7 +478,8 @@ visium_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
       if (r_type >= (unsigned int) R_VISIUM_max)
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: invalid Visium reloc number: %d"), abfd, r_type);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, r_type);
 	  r_type = 0;
 	}
       cache_ptr->howto = &visium_elf_howto_table[r_type];
diff --git a/bfd/elf32-wasm32.c b/bfd/elf32-wasm32.c
index 501dca8..b9f3cb2 100644
--- a/bfd/elf32-wasm32.c
+++ b/bfd/elf32-wasm32.c
@@ -103,8 +103,8 @@ elf32_wasm32_rtype_to_howto (bfd *abfd, unsigned r_type)
   if (i >= ARRAY_SIZE (elf32_wasm32_howto_table))
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid relocation type %d"),
-			  abfd, (int) r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       i = R_WASM32_NONE;
     }
 
@@ -117,7 +117,7 @@ elf32_wasm32_rtype_to_howto (bfd *abfd, unsigned r_type)
 /* Translate the ELF-internal relocation RELA into CACHE_PTR.  */
 
 static void
-elf32_wasm32_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+elf32_wasm32_info_to_howto_rela (bfd *abfd,
 				arelent *cache_ptr,
 				Elf_Internal_Rela *dst)
 {
diff --git a/bfd/elf32-xgate.c b/bfd/elf32-xgate.c
index 1395af4..3e2669c 100644
--- a/bfd/elf32-xgate.c
+++ b/bfd/elf32-xgate.c
@@ -415,7 +415,7 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
 /* Set the howto pointer for an XGATE ELF reloc.  */
 
 static void
-xgate_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
+xgate_info_to_howto_rel (bfd *abfd,
 			 arelent *cache_ptr,
 			 Elf_Internal_Rela *dst)
 {
@@ -425,7 +425,8 @@ xgate_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_XGATE_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid XGate reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &elf_xgate_howto_table[r_type];
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 86ecbcb..22f16bf 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -473,7 +473,7 @@ elf_xtensa_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
    it in the BFD internal arelent representation of the relocation.  */
 
 static void
-elf_xtensa_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+elf_xtensa_info_to_howto_rela (bfd *abfd,
 			       arelent *cache_ptr,
 			       Elf_Internal_Rela *dst)
 {
@@ -482,7 +482,8 @@ elf_xtensa_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_XTENSA_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid XTENSA reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &elf_howto_table[r_type];
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 8db0987..734d463 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -1101,7 +1101,7 @@ elf64_alpha_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Given an Alpha ELF reloc type, fill in an arelent structure.  */
 
 static void
-elf64_alpha_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
+elf64_alpha_info_to_howto (bfd *abfd, arelent *cache_ptr,
 			   Elf_Internal_Rela *dst)
 {
   unsigned r_type = ELF64_R_TYPE(dst->r_info);
@@ -1109,7 +1109,7 @@ elf64_alpha_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
   if (r_type >= R_ALPHA_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unrecognised Alpha reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       r_type = R_ALPHA_NONE;
@@ -4097,7 +4097,7 @@ elf64_alpha_relocate_section_r (bfd *output_bfd ATTRIBUTE_UNUSED,
 	{
 	  _bfd_error_handler
 	    /* xgettext:c-format */
-	    (_("%pB: unknown relocation type %d"),
+	    (_("%pB: unsupported relocation type %#x"),
 	     input_bfd, (int) r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  ret_val = FALSE;
@@ -4245,7 +4245,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	{
 	  _bfd_error_handler
 	    /* xgettext:c-format */
-	    (_("%pB: unknown relocation type %d"),
+	    (_("%pB: unsupported relocation type %#x"),
 	     input_bfd, (int) r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  ret_val = FALSE;
diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c
index e8cae73..2b7e63b 100644
--- a/bfd/elf64-ia64-vms.c
+++ b/bfd/elf64-ia64-vms.c
@@ -3425,10 +3425,9 @@ elf64_ia64_relocate_section (bfd *output_bfd,
       r_type = ELF64_R_TYPE (rel->r_info);
       if (r_type > R_IA64_MAX_RELOC_CODE)
 	{
-	  _bfd_error_handler
-	    /* xgettext:c-format */
-	    (_("%pB: unknown relocation type %d"),
-	     input_bfd, (int) r_type);
+	  /* xgettext:c-format */
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      input_bfd, (int) r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  ret_val = FALSE;
 	  continue;
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index 8218625..4e798ad 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -80,8 +80,6 @@ static void mips_elf64_be_swap_reloca_out
   (bfd *, const Elf_Internal_Rela *, bfd_byte *);
 static reloc_howto_type *bfd_elf64_bfd_reloc_type_lookup
   (bfd *, bfd_reloc_code_real_type);
-static reloc_howto_type *mips_elf64_rtype_to_howto
-  (unsigned int, bfd_boolean);
 static void mips_elf64_info_to_howto_rel
   (bfd *, arelent *, Elf_Internal_Rela *);
 static void mips_elf64_info_to_howto_rela
@@ -3574,7 +3572,7 @@ bfd_elf64_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure.  */
 
 static reloc_howto_type *
-mips_elf64_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p)
+mips_elf64_rtype_to_howto (bfd *abfd, unsigned int r_type, bfd_boolean rela_p)
 {
   switch (r_type)
     {
@@ -3612,7 +3610,8 @@ mips_elf64_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p)
 	}
       if (r_type >= R_MIPS_max)
 	{
-	  _bfd_error_handler (_("unrecognised MIPS reloc number: %d"), r_type);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  r_type = R_MIPS_NONE;
 	}
@@ -3805,7 +3804,7 @@ mips_elf64_slurp_one_reloc_table (bfd *abfd, asection *asect,
 
 	  relent->addend = rela.r_addend;
 
-	  relent->howto = mips_elf64_rtype_to_howto (type, rela_p);
+	  relent->howto = mips_elf64_rtype_to_howto (abfd, type, rela_p);
 
 	  ++relent;
 	}
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index 126133b..8e9eee1 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -1251,7 +1251,7 @@ mmix_elf_perform_relocation (asection *isec, reloc_howto_type *howto,
 /* Set the howto pointer for an MMIX ELF reloc (type RELA).  */
 
 static void
-mmix_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+mmix_info_to_howto_rela (bfd *abfd,
 			 arelent *cache_ptr,
 			 Elf_Internal_Rela *dst)
 {
@@ -1261,7 +1261,8 @@ mmix_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type >= (unsigned int) R_MMIX_max)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: invalid MMIX reloc number: %d"), abfd, r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       r_type = 0;
     }
   cache_ptr->howto = &elf_mmix_howto_table[r_type];
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index cebd7e2..0c10a7e 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -2514,7 +2514,7 @@ ppc64_elf_info_to_howto (bfd *abfd, arelent *cache_ptr,
   if (type >= ARRAY_SIZE (ppc64_elf_howto_table))
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%pB: unsupported reloc type %#x"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			  abfd, type);
       type = R_PPC64_NONE;
     }
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 1e1b39b..aeb1ced 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -370,8 +370,8 @@ elf_s390_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
       if (r_type >= sizeof (elf_howto_table) / sizeof (elf_howto_table[0]))
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: invalid relocation type %d"),
-			      abfd, (int) r_type);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, r_type);
 	  r_type = R_390_NONE;
 	}
       cache_ptr->howto = &elf_howto_table[r_type];
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index a9671e2..cc03fa1 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -122,15 +122,15 @@ elf64_sparc_slurp_one_reloc_table (bfd *abfd, asection *asect,
       r_type = ELF64_R_TYPE_ID (rela.r_info);
       if (r_type == R_SPARC_OLO10)
 	{
-	  relent->howto = _bfd_sparc_elf_info_to_howto_ptr (R_SPARC_LO10);
+	  relent->howto = _bfd_sparc_elf_info_to_howto_ptr (abfd, R_SPARC_LO10);
 	  relent[1].address = relent->address;
 	  relent++;
 	  relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
 	  relent->addend = ELF64_R_TYPE_DATA (rela.r_info);
-	  relent->howto = _bfd_sparc_elf_info_to_howto_ptr (R_SPARC_13);
+	  relent->howto = _bfd_sparc_elf_info_to_howto_ptr (abfd, R_SPARC_13);
 	}
       else
-	relent->howto = _bfd_sparc_elf_info_to_howto_ptr (r_type);
+	relent->howto = _bfd_sparc_elf_info_to_howto_ptr (abfd, r_type);
     }
 
   canon_reloc_count (asect) += relent - relents;
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index d66d9ba..c66d286 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -282,8 +282,8 @@ elf_x86_64_rtype_to_howto (bfd *abfd, unsigned r_type)
       if (r_type >= (unsigned int) R_X86_64_standard)
 	{
 	  /* xgettext:c-format */
-	  _bfd_error_handler (_("%pB: invalid relocation type %d"),
-			      abfd, (int) r_type);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, r_type);
 	  r_type = R_X86_64_NONE;
 	}
       i = r_type;
diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c
index 141ec96..64246fc 100644
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -66,8 +66,6 @@ static bfd_reloc_status_type mips16_gprel_reloc
   (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
 static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
   (bfd *, bfd_reloc_code_real_type);
-static reloc_howto_type *mips_elf_n32_rtype_to_howto
-  (unsigned int, bfd_boolean);
 static void mips_info_to_howto_rel
   (bfd *, arelent *, Elf_Internal_Rela *);
 static void mips_info_to_howto_rela
@@ -3402,7 +3400,7 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure.  */
 
 static reloc_howto_type *
-mips_elf_n32_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p)
+mips_elf_n32_rtype_to_howto (bfd *abfd, unsigned int r_type, bfd_boolean rela_p)
 {
   switch (r_type)
     {
@@ -3440,7 +3438,8 @@ mips_elf_n32_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p)
 	}
       if (r_type >= R_MIPS_max)
 	{
-	  _bfd_error_handler (_("unrecognised MIPS reloc number: %d"), r_type);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  r_type = R_MIPS_NONE;
 	}
@@ -3460,7 +3459,7 @@ mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
   unsigned int r_type;
 
   r_type = ELF32_R_TYPE (dst->r_info);
-  cache_ptr->howto = mips_elf_n32_rtype_to_howto (r_type, FALSE);
+  cache_ptr->howto = mips_elf_n32_rtype_to_howto (abfd, r_type, FALSE);
 
   /* The addend for a GPREL16 or LITERAL relocation comes from the GP
      value for the object file.  We get the addend now, rather than
@@ -3474,13 +3473,13 @@ mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
 /* Given a MIPS Elf_Internal_Rela, fill in an arelent structure.  */
 
 static void
-mips_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+mips_info_to_howto_rela (bfd *abfd,
 			 arelent *cache_ptr, Elf_Internal_Rela *dst)
 {
   unsigned int r_type;
 
   r_type = ELF32_R_TYPE (dst->r_info);
-  cache_ptr->howto = mips_elf_n32_rtype_to_howto (r_type, TRUE);
+  cache_ptr->howto = mips_elf_n32_rtype_to_howto (abfd, r_type, TRUE);
   cache_ptr->addend = dst->r_addend;
 }
 
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index e1797b3..638ee15 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -1972,7 +1972,7 @@ elfNN_aarch64_bfd_reloc_from_howto (reloc_howto_type *howto)
 /* Given R_TYPE, return the bfd internal relocation enumerator.  */
 
 static bfd_reloc_code_real_type
-elfNN_aarch64_bfd_reloc_from_type (unsigned int r_type)
+elfNN_aarch64_bfd_reloc_from_type (bfd *abfd, unsigned int r_type)
 {
   static bfd_boolean initialized_p = FALSE;
   /* Indexed by R_TYPE, values are offsets in the howto_table.  */
@@ -1995,7 +1995,8 @@ elfNN_aarch64_bfd_reloc_from_type (unsigned int r_type)
   /* PR 17512: file: b371e70a.  */
   if (r_type >= R_AARCH64_end)
     {
-      _bfd_error_handler (_("Invalid AArch64 reloc number: %d"), r_type);
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       return BFD_RELOC_AARCH64_NONE;
     }
@@ -2054,7 +2055,7 @@ elfNN_aarch64_howto_from_bfd_reloc (bfd_reloc_code_real_type code)
 }
 
 static reloc_howto_type *
-elfNN_aarch64_howto_from_type (unsigned int r_type)
+elfNN_aarch64_howto_from_type (bfd *abfd, unsigned int r_type)
 {
   bfd_reloc_code_real_type val;
   reloc_howto_type *howto;
@@ -2070,7 +2071,7 @@ elfNN_aarch64_howto_from_type (unsigned int r_type)
   if (r_type == R_AARCH64_NONE)
     return &elfNN_aarch64_howto_none;
 
-  val = elfNN_aarch64_bfd_reloc_from_type (r_type);
+  val = elfNN_aarch64_bfd_reloc_from_type (abfd, r_type);
   howto = elfNN_aarch64_howto_from_bfd_reloc (val);
 
   if (howto != NULL)
@@ -2081,13 +2082,13 @@ elfNN_aarch64_howto_from_type (unsigned int r_type)
 }
 
 static void
-elfNN_aarch64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc,
+elfNN_aarch64_info_to_howto (bfd *abfd, arelent *bfd_reloc,
 			     Elf_Internal_Rela *elf_reloc)
 {
   unsigned int r_type;
 
   r_type = ELFNN_R_TYPE (elf_reloc->r_info);
-  bfd_reloc->howto = elfNN_aarch64_howto_from_type (r_type);
+  bfd_reloc->howto = elfNN_aarch64_howto_from_type (abfd, r_type);
 }
 
 static reloc_howto_type *
@@ -2727,11 +2728,11 @@ aarch64_relocate (unsigned int r_type, bfd *input_bfd, asection *input_section,
   reloc_howto_type *howto;
   bfd_vma place;
 
-  howto = elfNN_aarch64_howto_from_type (r_type);
+  howto = elfNN_aarch64_howto_from_type (input_bfd, r_type);
   place = (input_section->output_section->vma + input_section->output_offset
 	   + offset);
 
-  r_type = elfNN_aarch64_bfd_reloc_from_type (r_type);
+  r_type = elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type);
   value = _bfd_aarch64_elf_resolve_relocation (r_type, place, value, 0, FALSE);
   return _bfd_aarch64_elf_put_addend (input_bfd,
 				      input_section->contents + offset, r_type,
@@ -4708,7 +4709,7 @@ aarch64_tls_transition (bfd *input_bfd,
 			unsigned long r_symndx)
 {
   bfd_reloc_code_real_type bfd_r_type
-    = elfNN_aarch64_bfd_reloc_from_type (r_type);
+    = elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type);
 
   if (! aarch64_can_relax_tls (input_bfd, info, bfd_r_type, h, r_symndx))
     return bfd_r_type;
@@ -5793,7 +5794,7 @@ elfNN_aarch64_tls_relax (struct elf_aarch64_link_hash_table *globals,
 
   BFD_ASSERT (globals && input_bfd && contents && rel);
 
-  switch (elfNN_aarch64_bfd_reloc_from_type (r_type))
+  switch (elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type))
     {
     case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21:
     case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
@@ -6215,7 +6216,8 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
       r_symndx = ELFNN_R_SYM (rel->r_info);
       r_type = ELFNN_R_TYPE (rel->r_info);
 
-      howto = bfd_reloc.howto = elfNN_aarch64_howto_from_type (r_type);
+      bfd_reloc.howto = elfNN_aarch64_howto_from_type (input_bfd, r_type);
+      howto = bfd_reloc.howto;
 
       if (howto == NULL)
 	return _bfd_unrecognized_reloc (input_bfd, input_section, r_type);
@@ -6343,7 +6345,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
 					       h, &unresolved_reloc,
 					       save_addend, &addend, sym);
 
-      switch (elfNN_aarch64_bfd_reloc_from_type (r_type))
+      switch (elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type))
 	{
 	case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
 	case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
@@ -6386,7 +6388,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
 		  bfd_elfNN_swap_reloca_out (output_bfd, &rela, loc);
 
 		  bfd_reloc_code_real_type real_type =
-		    elfNN_aarch64_bfd_reloc_from_type (r_type);
+		    elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type);
 
 		  if (real_type == BFD_RELOC_AARCH64_TLSLD_ADR_PREL21
 		      || real_type == BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21
@@ -6581,7 +6583,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
       if (r != bfd_reloc_ok && r != bfd_reloc_continue)
 	{
 	  bfd_reloc_code_real_type real_r_type
-	    = elfNN_aarch64_bfd_reloc_from_type (r_type);
+	    = elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type);
 
 	  switch (r)
 	    {
diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
index 715115a..824652a 100644
--- a/bfd/elfnn-ia64.c
+++ b/bfd/elfnn-ia64.c
@@ -3842,9 +3842,9 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
       r_type = ELFNN_R_TYPE (rel->r_info);
       if (r_type > R_IA64_MAX_RELOC_CODE)
 	{
-	  _bfd_error_handler
-	    /* xgettext:c-format */
-	    (_("%pB: unknown relocation type %d"), input_bfd, (int) r_type);
+	  /* xgettext:c-format */
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      input_bfd, (int) r_type);
 	  bfd_set_error (bfd_error_bad_value);
 	  ret_val = FALSE;
 	  continue;
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index 2e54a4e..6403af9 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -122,11 +122,11 @@ struct riscv_elf_link_hash_table
   == RISCV_ELF_DATA ? ((struct riscv_elf_link_hash_table *) ((p)->hash)) : NULL)
 
 static void
-riscv_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+riscv_info_to_howto_rela (bfd *abfd,
 			  arelent *cache_ptr,
 			  Elf_Internal_Rela *dst)
 {
-  cache_ptr->howto = riscv_elf_rtype_to_howto (ELFNN_R_TYPE (dst->r_info));
+  cache_ptr->howto = riscv_elf_rtype_to_howto (abfd, ELFNN_R_TYPE (dst->r_info));
 }
 
 static void
@@ -470,7 +470,7 @@ bad_static_reloc (bfd *abfd, unsigned r_type, struct elf_link_hash_entry *h)
   (*_bfd_error_handler)
     (_("%pB: relocation %s against `%s' can not be used when making a shared "
        "object; recompile with -fPIC"),
-      abfd, riscv_elf_rtype_to_howto (r_type)->name,
+      abfd, riscv_elf_rtype_to_howto (abfd, r_type)->name,
       h != NULL ? h->root.root.string : "a local symbol");
   bfd_set_error (bfd_error_bad_value);
   return FALSE;
@@ -626,7 +626,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
 	     symbol.  */
 	  if ((bfd_link_pic (info)
 	       && (sec->flags & SEC_ALLOC) != 0
-	       && (! riscv_elf_rtype_to_howto (r_type)->pc_relative
+	       && (! riscv_elf_rtype_to_howto (abfd, r_type)->pc_relative
 		   || (h != NULL
 		       && (! info->symbolic
 			   || h->root.type == bfd_link_hash_defweak
@@ -696,7 +696,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
 		}
 
 	      p->count += 1;
-	      p->pc_count += riscv_elf_rtype_to_howto (r_type)->pc_relative;
+	      p->pc_count += riscv_elf_rtype_to_howto (abfd, r_type)->pc_relative;
 	    }
 
 	  break;
@@ -1724,7 +1724,7 @@ riscv_elf_relocate_section (bfd *output_bfd,
       bfd_boolean unresolved_reloc, is_ie = FALSE;
       bfd_vma pc = sec_addr (input_section) + rel->r_offset;
       int r_type = ELFNN_R_TYPE (rel->r_info), tls_type;
-      reloc_howto_type *howto = riscv_elf_rtype_to_howto (r_type);
+      reloc_howto_type *howto = riscv_elf_rtype_to_howto (input_bfd, r_type);
       const char *msg = NULL;
 
       if (r_type == R_RISCV_GNU_VTINHERIT || r_type == R_RISCV_GNU_VTENTRY)
@@ -1888,7 +1888,7 @@ riscv_elf_relocate_section (bfd *output_bfd,
 						howto,
 						input_bfd);
 	  r_type = ELFNN_R_TYPE (rel->r_info);
-	  howto = riscv_elf_rtype_to_howto (r_type);
+	  howto = riscv_elf_rtype_to_howto (input_bfd, r_type);
 	  if (!riscv_record_pcrel_hi_reloc (&pcrel_relocs, pc,
 					    relocation, absolute))
 	    r = bfd_reloc_overflow;
@@ -1984,7 +1984,7 @@ riscv_elf_relocate_section (bfd *output_bfd,
 						howto,
 						input_bfd);
 	  r_type = ELFNN_R_TYPE (rel->r_info);
-	  howto = riscv_elf_rtype_to_howto (r_type);
+	  howto = riscv_elf_rtype_to_howto (input_bfd, r_type);
 	  if (!riscv_record_pcrel_hi_reloc (&pcrel_relocs, pc,
 					    relocation + rel->r_addend,
 					    absolute))
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index e57d4cd..6d81dc6 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -881,7 +881,7 @@ static bfd *reldyn_sorting_bfd;
   _bfd_elf_add_dynamic_entry (info, tag, val)
 
 #define MIPS_ELF_RTYPE_TO_HOWTO(abfd, rtype, rela)			\
-  (get_elf_backend_data (abfd)->elf_backend_mips_rtype_to_howto (rtype, rela))
+  (get_elf_backend_data (abfd)->elf_backend_mips_rtype_to_howto (abfd, rtype, rela))
 
 /* The name of the dynamic relocation section.  */
 #define MIPS_ELF_REL_DYN_NAME(INFO) \
diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index c0f006f..7d4f59f 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -948,11 +948,12 @@ riscv_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
 }
 
 reloc_howto_type *
-riscv_elf_rtype_to_howto (unsigned int r_type)
+riscv_elf_rtype_to_howto (bfd *abfd, unsigned int r_type)
 {
   if (r_type >= ARRAY_SIZE (howto_table))
     {
-      (*_bfd_error_handler) (_("unrecognized relocation (0x%x)"), r_type);
+      (*_bfd_error_handler) (_("%pB: unsupported relocation type %#x"),
+			     abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       return NULL;
     }
diff --git a/bfd/elfxx-riscv.h b/bfd/elfxx-riscv.h
index 04da5b5..836f05d 100644
--- a/bfd/elfxx-riscv.h
+++ b/bfd/elfxx-riscv.h
@@ -30,4 +30,4 @@ extern reloc_howto_type *
 riscv_reloc_type_lookup (bfd *, bfd_reloc_code_real_type);
 
 extern reloc_howto_type *
-riscv_elf_rtype_to_howto (unsigned int r_type);
+riscv_elf_rtype_to_howto (bfd *, unsigned int r_type);
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 89d3a37..c75d053 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -614,7 +614,7 @@ _bfd_sparc_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 }
 
 reloc_howto_type *
-_bfd_sparc_elf_info_to_howto_ptr (unsigned int r_type)
+_bfd_sparc_elf_info_to_howto_ptr (bfd *abfd, unsigned int r_type)
 {
   switch (r_type)
     {
@@ -636,7 +636,8 @@ _bfd_sparc_elf_info_to_howto_ptr (unsigned int r_type)
     default:
       if (r_type >= (unsigned int) R_SPARC_max_std)
 	{
-	  _bfd_error_handler (_("invalid relocation type %d"), (int) r_type);
+	  _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			      abfd, r_type);
 	  r_type = R_SPARC_NONE;
 	}
       return &_bfd_sparc_elf_howto_table[r_type];
@@ -649,12 +650,12 @@ _bfd_sparc_elf_info_to_howto_ptr (unsigned int r_type)
 	((r_info) & 0xff)
 
 void
-_bfd_sparc_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
+_bfd_sparc_elf_info_to_howto (bfd *abfd, arelent *cache_ptr,
 			      Elf_Internal_Rela *dst)
 {
   unsigned int r_type = SPARC_ELF_R_TYPE (dst->r_info);
 
-  cache_ptr->howto = _bfd_sparc_elf_info_to_howto_ptr (r_type);
+  cache_ptr->howto = _bfd_sparc_elf_info_to_howto_ptr (abfd, r_type);
 }
 
 
diff --git a/bfd/elfxx-sparc.h b/bfd/elfxx-sparc.h
index 7b089f3..f465ca7 100644
--- a/bfd/elfxx-sparc.h
+++ b/bfd/elfxx-sparc.h
@@ -100,7 +100,7 @@ extern reloc_howto_type *_bfd_sparc_elf_reloc_name_lookup
 extern void _bfd_sparc_elf_info_to_howto
   (bfd *, arelent *, Elf_Internal_Rela *);
 extern reloc_howto_type *_bfd_sparc_elf_info_to_howto_ptr
-  (unsigned int);
+  (bfd*, unsigned int);
 extern bfd_boolean _bfd_sparc_elf_mkobject
   (bfd *);
 extern struct bfd_link_hash_table *_bfd_sparc_elf_link_hash_table_create
diff --git a/bfd/reloc.c b/bfd/reloc.c
index a61fd9a..db7facd 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -8388,7 +8388,7 @@ bfd_boolean
 _bfd_unrecognized_reloc (bfd * abfd, sec_ptr section, unsigned int r_type)
 {
    /* xgettext:c-format */
-  _bfd_error_handler (_("%pB: unrecognized relocation (%#x) in section `%pA'"),
+  _bfd_error_handler (_("%pB: unrecognized relocation type %#x in section `%pA'"),
 		      abfd, r_type, section);
 
   /* PR 21803: Suggest the most likely cause of this error.  */

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]