From: Alan Modra Date: Sun, 23 Apr 2017 09:01:40 +0000 (+0930) Subject: PR 21415, objdump fails to check bfd_get_section_contents status X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b02cd3e978e9273074f7cbe2ca1d5b372225a56d;p=binutils-gdb.git PR 21415, objdump fails to check bfd_get_section_contents status PR 21415 * objdump.c (disassemble_section): Check bfd_get_section_contents status. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index a19d488673f..735a3445512 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2017-04-23 Alan Modra + + PR 21415 + * objdump.c (disassemble_section): Check bfd_get_section_contents + status. + 2017-04-23 Alan Modra PR 21408 diff --git a/binutils/objdump.c b/binutils/objdump.c index 58521dd8453..bc610003a7d 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -2174,7 +2174,12 @@ disassemble_section (bfd *abfd, asection *section, void *inf) data = (bfd_byte *) xmalloc (datasize); - bfd_get_section_contents (abfd, section, data, 0, datasize); + if (!bfd_get_section_contents (abfd, section, data, 0, datasize)) + { + non_fatal (_("Reading section %s failed because: %s"), + section->name, bfd_errmsg (bfd_get_error ())); + return; + } paux->sec = section; pinfo->buffer = data;