]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR28540, segmentation fault on NULL byte_get
authorAlan Modra <amodra@gmail.com>
Thu, 4 Nov 2021 03:41:02 +0000 (14:11 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 4 Nov 2021 03:53:52 +0000 (14:23 +1030)
PR 28540
* objdump.c (dump_bfd): Don't attempt load_separate_debug_files
when byte_get is NULL.

(cherry picked from commit f2f105f518413ea3e4c212f89585f9a8a5dddcdd)

binutils/objdump.c

index a7b8303b992c21f307f58c6e2f3bff39c1ed2bc4..50317b3d48f41c97d3191d5cdb8f9116022d0f4a 100644 (file)
@@ -4869,7 +4869,7 @@ dump_bfd (bfd *abfd, bool is_mainfile)
      
      The test on is_mainfile is there because the chain of separate debug
      info files is a global variable shared by all invocations of dump_bfd.  */
-  if (is_mainfile)
+  if (byte_get != NULL && is_mainfile)
     {
       load_separate_debug_files (abfd, bfd_get_filename (abfd));