top level:
[deliverable/binutils-gdb.git] / binutils / objdump.c
index fc9600c26ea9b393ddfab94c0ac6f0569390fca0..a273f511f15b1c9e9ad6ab05d57229fbe2342154 100644 (file)
@@ -1,6 +1,6 @@
 /* objdump.c -- dump information about an object file.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 #define        BYTES_IN_WORD   32
 #include "aout/aout64.h"
 
-#if !HAVE_DECL_FPRINTF
-/* This is needed by init_disassemble_info().  */
-extern int fprintf (FILE *, const char *, ...);
-#endif
-
 /* Exit status.  */
 static int exit_status = 0;
 
@@ -230,7 +225,7 @@ usage (FILE *stream, int status)
 
       disassembler_usage (stream);
     }
-  if (status == 0)
+  if (REPORT_BUGS_TO[0] && status == 0)
     fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO);
   exit (status);
 }
@@ -904,7 +899,7 @@ objdump_print_address (bfd_vma vma, struct disassemble_info *info)
   objdump_print_addr (vma, info, ! prefix_addresses);
 }
 
-/* Determine of the given address has a symbol associated with it.  */
+/* Determine if the given address has a symbol associated with it.  */
 
 static int
 objdump_symbol_at_address (bfd_vma vma, struct disassemble_info * info)
@@ -1753,11 +1748,13 @@ disassemble_section (bfd *abfd, asection *section, void *info)
 
          pinfo->symbols = sorted_syms + place;
          pinfo->num_symbols = x - place;
+         pinfo->symtab_pos = place;
        }
       else
        {
          pinfo->symbols = NULL;
          pinfo->num_symbols = 0;
+         pinfo->symtab_pos = -1;
        }
 
       if (! prefix_addresses)
@@ -1950,6 +1947,8 @@ disassemble_data (bfd *abfd)
                 compare_relocs);
        }
     }
+  disasm_info.symtab = sorted_syms;
+  disasm_info.symtab_size = sorted_symcount;
 
   bfd_map_over_sections (abfd, disassemble_section, & disasm_info);
 
@@ -2020,7 +2019,7 @@ dump_dwarf_section (bfd *abfd, asection *section,
   const char *match;
   enum dwarf_section_display_enum i;
 
-  if (strncmp (name, ".gnu.linkonce.wi.", 17) == 0)
+  if (CONST_STRNEQ (name, ".gnu.linkonce.wi."))
     match = ".debug_info";
   else
     match = name;
@@ -2907,7 +2906,10 @@ display_file (char *filename, char *target)
   bfd *arfile = NULL;
 
   if (get_file_size (filename) < 1)
-    return;
+    {
+      exit_status = 1;
+      return;
+    }
 
   file = bfd_openr (filename, target);
   if (file == NULL)
This page took 0.026139 seconds and 4 git commands to generate.