diff options
author | Stan Shebs <shebs@codesourcery.com> | 1994-02-01 02:52:22 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 1994-02-01 02:52:22 +0000 |
commit | 334d6e7603c5ba4cec9b17613757c96e00763bba (patch) | |
tree | 0f8070bc8aaf30d0de1abff575aa004a55916c18 /binutils | |
parent | ffcb7f05a096b7960f7359a6f8dcd4dad508d1a4 (diff) | |
download | gdb-334d6e7603c5ba4cec9b17613757c96e00763bba.zip gdb-334d6e7603c5ba4cec9b17613757c96e00763bba.tar.gz gdb-334d6e7603c5ba4cec9b17613757c96e00763bba.tar.bz2 |
Mon Jan 31 18:50:41 1994 Stan Shebs (shebs@andros.cygnus.com)
* objdump.c (display_target_list, display_info_table): Check that
the bfd of the dummy output file is not null.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 5 | ||||
-rw-r--r-- | binutils/objdump.c | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index b2d56a1..df72b10 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +Mon Jan 31 18:50:41 1994 Stan Shebs (shebs@andros.cygnus.com) + + * objdump.c (display_target_list, display_info_table): Check that + the bfd of the dummy output file is not null. + Wed Jan 26 13:13:18 1994 David J. Mackenzie (djm@thepub.cygnus.com) * objcopy.c (filter_bytes): New function. diff --git a/binutils/objdump.c b/binutils/objdump.c index 8502296..469bfbd 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -1193,6 +1193,14 @@ display_target_list () bfd_target *p = bfd_target_vector[t]; bfd *abfd = bfd_openw (_DUMMY_NAME_, p->name); + /* It *is* possible that bfd_openw might fail; avoid the + tragic consequences that would otherwise ensue. */ + if (abfd == NULL) + { + fprintf (stderr, "%s: ", program_name); + bfd_perror (_DUMMY_NAME_); + return; + } bfd_set_format (abfd, bfd_object); printf ("%s\n (header %s, data %s)\n", p->name, p->header_byteorder_big_p ? "big endian" : "little endian", @@ -1231,6 +1239,13 @@ display_info_table (first, last) bfd_target *p = bfd_target_vector[t]; bfd *abfd = bfd_openw (_DUMMY_NAME_, p->name); + /* Just in case the open failed somehow. */ + if (abfd == NULL) + { + fprintf (stderr, "%s: ", program_name); + bfd_perror (_DUMMY_NAME_); + return; + } bfd_set_format (abfd, bfd_object); if (bfd_set_arch_mach (abfd, a, 0)) printf ("%s ", p->name); |