public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* score-elf binutils-all/strip-13 fail
@ 2021-01-06 10:52 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2021-01-06 10:52 UTC (permalink / raw)
  To: binutils

	* elf32-score.c (s3_bfd_score_info_to_howto): Report an error
	on unknown r_type.
	* elf32-score7.c (s7_bfd_score_info_to_howto): Likewise.

diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c
index ee20d4cd48..50c7405c32 100644
--- a/bfd/elf32-score.c
+++ b/bfd/elf32-score.c
@@ -2379,7 +2379,7 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
 
 /* Score backend functions.  */
 static bfd_boolean
-s3_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+s3_bfd_score_info_to_howto (bfd *abfd,
 			    arelent *bfd_reloc,
 			    Elf_Internal_Rela *elf_reloc)
 {
@@ -2387,7 +2387,13 @@ s3_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
 
   r_type = ELF32_R_TYPE (elf_reloc->r_info);
   if (r_type >= ARRAY_SIZE (elf32_score_howto_table))
-    return FALSE;
+    {
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
 
   bfd_reloc->howto = &elf32_score_howto_table[r_type];
   return TRUE;
diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c
index 06e8f5083e..2f63ab8cd5 100644
--- a/bfd/elf32-score7.c
+++ b/bfd/elf32-score7.c
@@ -2218,7 +2218,7 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
 /* Score backend functions.  */
 
 bfd_boolean
-s7_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+s7_bfd_score_info_to_howto (bfd *abfd,
 			    arelent *bfd_reloc,
 			    Elf_Internal_Rela *elf_reloc)
 {
@@ -2226,7 +2226,13 @@ s7_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
 
   r_type = ELF32_R_TYPE (elf_reloc->r_info);
   if (r_type >= ARRAY_SIZE (elf32_score_howto_table))
-    return FALSE;
+    {
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+			  abfd, r_type);
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
 
   bfd_reloc->howto = &elf32_score_howto_table[r_type];
   return TRUE;

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-06 10:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06 10:52 score-elf binutils-all/strip-13 fail Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).