score-elf binutils-all/strip-13 fail
authorAlan Modra <amodra@gmail.com>
Wed, 6 Jan 2021 06:10:31 +0000 (16:40 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 6 Jan 2021 10:33:55 +0000 (21:03 +1030)
* 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.

bfd/ChangeLog
bfd/elf32-score.c
bfd/elf32-score7.c

index b9b5f7b2d38698fee87972b6ea9e92048536215e..06d6e393060440ecb440e8eb2f80bdf02ab42b0d 100644 (file)
@@ -1,3 +1,9 @@
+2021-01-06  Alan Modra  <amodra@gmail.com>
+
+       * 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.
+
 2021-01-06  Alan Modra  <amodra@gmail.com>
 
        * config.bfd (sparc-*-solaris2*): Add sparc_elf32_vec.
index ee20d4cd4895ee46add8b5e9ad0f3c2e18ecc039..50c7405c32a918e367a8db33b52309c55062f889 100644 (file)
@@ -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;
index 06e8f5083e72ab98c22cc0d09763554024857e8f..2f63ab8cd5b85dbacb013aa222fbb9f5714968c1 100644 (file)
@@ -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;