]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
1999-10-27 Fred Fish <fnf@cygnus.com>
authorIan Lance Taylor <ian@airs.com>
Thu, 28 Oct 1999 03:30:13 +0000 (03:30 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 28 Oct 1999 03:30:13 +0000 (03:30 +0000)
* objdump.c (display_bfd): Break into two functions.  The
actual dumping code moves to dump_bfd.  If bfd is not
unambiguously recognized as a bfd_object, attempt to dump
it as a bfd_core.
(dump_bfd): New function.

binutils/ChangeLog
binutils/objdump.c

index 9cf85117948c73faa3313894df0d1004fa902a02..7cf4f71f73ac08cb002c8d0bc7990c8cfeb28ce3 100644 (file)
@@ -1,3 +1,11 @@
+1999-10-27  Fred Fish  <fnf@cygnus.com>
+
+       * objdump.c (display_bfd): Break into two functions.  The
+       actual dumping code moves to dump_bfd.  If bfd is not
+       unambiguously recognized as a bfd_object, attempt to dump
+       it as a bfd_core.
+       (dump_bfd): New function.
+
 1999-10-26  Nick Clifton  <nickc@cygnus.com>
 
        * dlltool.c (assemble_file): Remove spurious test of exp_name.
index 92805d31ef652ef5c9c482d542fe8408c587b90b..71bb65f08110eb2bdae77192822a63296745cd61 100644 (file)
@@ -2042,23 +2042,12 @@ bfd *abfd;
   bfd_print_private_bfd_data (abfd, stdout);
 }
 
+/* Dump selected contents of ABFD */
+
 static void
-display_bfd (abfd)
+dump_bfd (abfd)
      bfd *abfd;
 {
-  char **matching;
-
-  if (!bfd_check_format_matches (abfd, bfd_object, &matching))
-    {
-      nonfatal (bfd_get_filename (abfd));
-      if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
-       {
-         list_matching_formats (matching);
-         free (matching);
-       }
-      return;
-    }
-
   /* If we are adjusting section VMA's, change them all now.  Changing
      the BFD information is a hack.  However, we must do it, or
      bfd_find_nearest_line will not do the right thing.  */
@@ -2134,6 +2123,47 @@ display_bfd (abfd)
     }
 }
 
+static void
+display_bfd (abfd)
+     bfd *abfd;
+{
+  char **matching;
+
+  if (bfd_check_format_matches (abfd, bfd_object, &matching))
+    {
+      dump_bfd (abfd);
+      return;
+    }
+
+  if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
+    {
+      nonfatal (bfd_get_filename (abfd));
+      list_matching_formats (matching);
+      free (matching);
+      return;
+    }
+
+  if (bfd_get_error () != bfd_error_file_not_recognized)
+    {
+      nonfatal (bfd_get_filename (abfd));
+      return;
+    }
+
+  if (bfd_check_format_matches (abfd, bfd_core, &matching))
+    {
+      dump_bfd (abfd);
+      return;
+    }
+
+  nonfatal (bfd_get_filename (abfd));
+
+  if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
+    {
+      list_matching_formats (matching);
+      free (matching);
+    }
+}
+
 static void
 display_file (filename, target)
      char *filename;