aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elfxx-mips.c11
2 files changed, 16 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 091e363..9a8a320 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
2018-02-05 Maciej W. Rozycki <macro@mips.com>
+ * elfxx-mips.c (_bfd_mips_elf_section_processing): For
+ SHT_MIPS_REGINFO sections don't assert the correct size and
+ report an error instead.
+
+2018-02-05 Maciej W. Rozycki <macro@mips.com>
+
* elf.c (_bfd_elf_write_object_contents): Propagate a failure
status from `->elf_backend_section_processing'.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 2854013..ab65894 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -7102,9 +7102,18 @@ _bfd_mips_elf_section_processing (bfd *abfd, Elf_Internal_Shdr *hdr)
{
bfd_byte buf[4];
- BFD_ASSERT (hdr->sh_size == sizeof (Elf32_External_RegInfo));
BFD_ASSERT (hdr->contents == NULL);
+ if (hdr->sh_size != sizeof (Elf32_External_RegInfo))
+ {
+ _bfd_error_handler
+ (_("%B: Incorrect `.reginfo' section size; expected %Lu, got %Lu"),
+ abfd, (bfd_size_type) sizeof (Elf32_External_RegInfo),
+ hdr->sh_size);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
if (bfd_seek (abfd,
hdr->sh_offset + sizeof (Elf32_External_RegInfo) - 4,
SEEK_SET) != 0)