aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffgen.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-01-09 09:27:46 +0000
committerNick Clifton <nickc@redhat.com>2017-01-09 09:27:46 +0000
commit98f02962fefbacf1b805e93fb7bddeb58ec6ff70 (patch)
tree727640a8947f5d8f1fa1dd13572adfa1cebad15d /bfd/coffgen.c
parent011561117eeaff00862eb5f465c3470f29e8a9a9 (diff)
downloadgdb-98f02962fefbacf1b805e93fb7bddeb58ec6ff70.zip
gdb-98f02962fefbacf1b805e93fb7bddeb58ec6ff70.tar.gz
gdb-98f02962fefbacf1b805e93fb7bddeb58ec6ff70.tar.bz2
Improve objdump's behaviour when it encounters a corrupt binary with an excessively large symbol table.
PR binutils/21013 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error message if there are too many symbols to load.
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r--bfd/coffgen.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index d2cc591..5a61f6d 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -1643,7 +1643,12 @@ _bfd_coff_get_external_symbols (bfd *abfd)
syms = bfd_malloc (size);
if (syms == NULL)
- return FALSE;
+ {
+ /* PR 21013: Provide an error message when the alloc fails. */
+ _bfd_error_handler (_("%B: Not enough memory to allocate space for %lu symbols"),
+ abfd, size);
+ return FALSE;
+ }
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
|| bfd_bread (syms, size, abfd) != size)