2011-05-24 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / binutils / coffdump.c
index 058c3abb3cca923f42629e70c1722567f57402a2..428f598bc68d374b05870fc38802fadc61c7ec1e 100644 (file)
@@ -1,12 +1,12 @@
 /* Coff file dumper.
-   Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007,
+   2011 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or (at
+   the Free Software Foundation; either version 3 of the License, or (at
    your option) any later version.
 
    This program is distributed in the hope that it will be useful,
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
 
 /* Written by Steve Chamberlain <sac@cygnus.com>
 
    This module reads a type tree generated by coffgrok and prints
    it out so we can test the grokker.  */
 
+#include "sysdep.h"
 #include "bfd.h"
+#include "bfd_stdint.h"
 #include "libiberty.h"
+#include "bucomm.h"
 
 #include "coffgrok.h"
-#include "bucomm.h"
 #include "getopt.h"
 
 static int atnl;
@@ -362,7 +366,7 @@ dump_coff_scope (struct coff_scope *p)
   if (p)
     {
       tab (1);
-      printf ("List of blocks %lx ",(unsigned long) p);
+      printf ("List of blocks %" BFD_VMA_FMT "x ",(bfd_vma) (uintptr_t) p);
 
       if (p->sec)
        printf( "  %s %x..%x",  p->sec->name,p->offset, p->offset + p->size -1);
@@ -441,7 +445,7 @@ coff_dump (struct coff_ofile *ptr)
 
   printf ("Coff dump");
   nl ();
-  printf ("#souces %d", ptr->nsources);
+  printf ("#sources %d", ptr->nsources);
   nl ();
   dump_coff_sfile (ptr->source_head);
 
@@ -455,13 +459,14 @@ static void
 show_usage (FILE *file, int status)
 {
   fprintf (file, _("Usage: %s [option(s)] in-file\n"), program_name);
-  fprintf (file, _(" Print a human readable interpretation of a SYSROFF object file\n"));
+  fprintf (file, _(" Print a human readable interpretation of a COFF object file\n"));
   fprintf (file, _(" The options are:\n\
+  @<file>                Read options from <file>\n\
   -h --help              Display this information\n\
   -v --version           Display the program's version\n\
 \n"));
 
-  if (status == 0)
+  if (REPORT_BUGS_TO[0] && status == 0)
     fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO);
 
   exit (status);
@@ -494,6 +499,8 @@ main (int ac, char **av)
   program_name = av[0];
   xmalloc_set_program_name (program_name);
 
+  expandargv (&ac, &av);
+
   while ((opt = getopt_long (ac, av, "HhVv", long_options,
                             (int *) NULL))
         != EOF)
This page took 0.024689 seconds and 4 git commands to generate.