PR 21415, objdump fails to check bfd_get_section_contents status
[deliverable/binutils-gdb.git] / binutils / objdump.c
index 58521dd84530de2fd1b838ddcf82bdb3b705c0bc..bc610003a7dc85faa9f42a70fd1237a8ffcb29fc 100644 (file)
@@ -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;
This page took 0.022886 seconds and 4 git commands to generate.