aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-04-23 18:31:40 +0930
committerAlan Modra <amodra@gmail.com>2017-04-23 20:33:35 +0930
commitb02cd3e978e9273074f7cbe2ca1d5b372225a56d (patch)
tree01c62dc9fbb12aaa4785590c7b059e7fdc9b1ddb /binutils
parent7eacd66b086cabb1daab20890d5481894d4f56b2 (diff)
downloadgdb-b02cd3e978e9273074f7cbe2ca1d5b372225a56d.zip
gdb-b02cd3e978e9273074f7cbe2ca1d5b372225a56d.tar.gz
gdb-b02cd3e978e9273074f7cbe2ca1d5b372225a56d.tar.bz2
PR 21415, objdump fails to check bfd_get_section_contents status
PR 21415 * objdump.c (disassemble_section): Check bfd_get_section_contents status.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/objdump.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index a19d488..735a344 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,11 @@
2017-04-23 Alan Modra <amodra@gmail.com>
+ PR 21415
+ * objdump.c (disassemble_section): Check bfd_get_section_contents
+ status.
+
+2017-04-23 Alan Modra <amodra@gmail.com>
+
PR 21408
* dwarf.c (display_debug_lines_decoded): Don't segfault on NULL
file_table.
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 58521dd..bc61000 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;