aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-mips.c
diff options
context:
space:
mode:
authorVlad Ivanov <vlad@ivanov.email>2018-01-12 09:25:11 +0000
committerMaciej W. Rozycki <macro@mips.com>2018-01-12 09:25:11 +0000
commit58807c48a5a317ad3e2d39a8755168a3d4d5fdf8 (patch)
treefefa7631f67b46289bf2cb266a49b2a22b5ec339 /bfd/elfxx-mips.c
parent97a232d7335f3bd0231fd9cd39455bde1d563922 (diff)
downloadgdb-58807c48a5a317ad3e2d39a8755168a3d4d5fdf8.zip
gdb-58807c48a5a317ad3e2d39a8755168a3d4d5fdf8.tar.gz
gdb-58807c48a5a317ad3e2d39a8755168a3d4d5fdf8.tar.bz2
_bfd_mips_elf_final_link: Notify user about wrong .reginfo size
One of assertions in _bfd_mips_elf_final_link could be triggered by a combination of input files and a linker script. This happens when either the input doesn't contain .reginfo section or when this section is oversized. This patch replaces the assertion with a more useful error message. * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when .reginfo section has wrong size.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r--bfd/elfxx-mips.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 3ef98af..fc49f2f 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -14374,7 +14374,15 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
}
/* Size has been set in _bfd_mips_elf_always_size_sections. */
- BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo));
+ if (o->size != sizeof (Elf32_External_RegInfo))
+ {
+ _bfd_error_handler
+ (_("%B: .reginfo section size should be %d bytes, "
+ "actual size is %d"),
+ abfd, sizeof (Elf32_External_RegInfo), o->size);
+
+ return FALSE;
+ }
/* Skip this section later on (I don't think this currently
matters, but someday it might). */