aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-01-06 16:40:31 +1030
committerAlan Modra <amodra@gmail.com>2021-01-06 21:03:55 +1030
commit599c86c4a57c10c456663fadd8dfb21cbbcafe57 (patch)
tree304ae0a6f953e3689764ff1149fba731316c91ed
parent85f55c2b759ff61a53819a8b3a855d0313efcd64 (diff)
downloadgdb-599c86c4a57c10c456663fadd8dfb21cbbcafe57.zip
gdb-599c86c4a57c10c456663fadd8dfb21cbbcafe57.tar.gz
gdb-599c86c4a57c10c456663fadd8dfb21cbbcafe57.tar.bz2
score-elf binutils-all/strip-13 fail
* 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.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-score.c10
-rw-r--r--bfd/elf32-score7.c10
3 files changed, 22 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b9b5f7b..06d6e39 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
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.
(sparc64-*-solaris2*): Add sparc_elf64_vec and
sparc_elf32_vec.
diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c
index ee20d4c..50c7405 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 06e8f50..2f63ab8 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;