]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
A mostly cosmetic tidy up of warnings and error message reporting.
authorAlan Modra <amodra@gmail.com>
Fri, 7 Apr 2000 04:39:25 +0000 (04:39 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 7 Apr 2000 04:39:25 +0000 (04:39 +0000)
25 files changed:
binutils/ChangeLog
binutils/Makefile.am
binutils/Makefile.in
binutils/addr2line.c
binutils/ar.c
binutils/bucomm.c
binutils/bucomm.h
binutils/coffdump.c
binutils/dlltool.c
binutils/dllwrap.c
binutils/nlmconv.c
binutils/nm.c
binutils/objcopy.1
binutils/objdump.c
binutils/rdcoff.c
binutils/rddbg.c
binutils/rescoff.c
binutils/size.c
binutils/srconv.c
binutils/strings.1
binutils/strings.c
binutils/sysdump.c
binutils/version.c
binutils/windres.c
binutils/wrstabs.c

index 5a17b0fd33f676e3aee07ef2eb288a4313b85390..a067bc02a14e7d8c407f21ca36cd08ff331d18f6 100644 (file)
@@ -1,3 +1,99 @@
+2000-04-06  Alan Modra  <alan@linuxcare.com.au>
+
+       * addr2line.c: Update copyright.
+       * objcopy.1: Likewise, and title.
+       * strings.1: Likewise.
+
+       * version.c (print_version): Add 2000.
+
+       * rddbg.c (read_section_stabs_debugging_info): Don't use
+       bfd_size_type for strx to avoid printf problems if BFD64.
+
+       * bucomm.c: (report): Remove `static'.
+       Move inclusion of stdarg.h/vararg.h from here.
+       * bucomm.h: To here.
+       (CONST): Change all occurences to const.
+       (report): Declare it.
+       (bfd_fatal): Add ATTRIBUTE_NORETURN.
+       (fatal): Add ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN.
+       (non_fatal): Add ATTRIBUTE_PRINTF_1.
+
+       * ar.c (main): Use fatal or non_fatal instead of fprintf.
+       Correct a typo in an error message.
+       (do_quick_append): Use non_fatal instead of fprintf.
+       (move_members): Use fatal instead of fprintf, exit.
+       * coffdump.c (main): Same here.
+
+       * dlltool.c (display): Delete.
+       (warn): Delete.
+       (inform): Use `report' instead of `display'.
+       (rvaafter): Remove trailing \n from fatal error msg.
+       (rvabefore): Ditto.
+       (asm_prefix): Ditto.
+       (yyerror): Replace `warn' with `non_fatal', and remove \n.
+       (def_name): Likewise.
+       (run): Likewise.
+       (scan_all_symbols): Likewise.
+       (gen_lib_file): Likewise.
+       (def_library): Likewise.  Remove extra program_name too.
+       (run): Remove \n from inform strings.
+       (scan_drectve_symbols): Likewise.
+       (add_excludes): Likewise.
+       (scan_open_obj_file): Likewise.
+       (gen_exp_file): Likewise.
+       (gen_lib_file): Likewise.
+       (process_duplicates): Likewise.
+
+       * Makefile.am (dllwrap_SOURCES): Add version.c.
+       * dllwrap.c (program_version): Delete.
+       (print_version): Delete.
+       (display): Always print trailing \n.
+       (warn): New.
+       (delete_temp_files): Use warn instead of fprintf.  Use gettext.
+       (run): Here too.
+       (main): And here.
+       (usage): gettext'ify.
+       (long_options): Add missing initialisers.
+
+       * nlmconv.c (main): Use fatal/non_fatal instead of fprintf.
+       (select_output_format): Likewise.
+       (powerpc_mangle_relocs): Likewise.
+       (link_inputs): Likewise.
+
+       * nm.c (set_print_radix): Use fatal instead of fprintf, exit.
+       (set_output_format): Likewise.
+       (main): Use non_fatal instead of fprintf.
+       (display_rel_file): Likewise.
+
+       * objdump.c (slurp_symtab): Use non_fatal instead of fprintf.
+       (slurp_dynamic_symtab): Same here.
+       (disassemble_data): And here.
+       (read_section_stabs): And here.
+       (read_section_stabs): And here.
+       (dump_bfd): And here.
+       (main): And here.
+       (objdump_sprintf): Use fatal instead of fprintf, exit.
+       (disassemble_data): Same here.
+
+       * rdcoff.c (parse_coff_type): Use non_fatal instead of fprintf.
+       (parse_coff_struct_type): Same here.
+       (parse_coff_enum_type): And here.
+       (parse_coff): And here.
+       * rddbg.c (read_debugging_info): And here.
+       * size.c (main): And here.
+       * windres.c (format_from_name): And here.
+       * wrstabs.c (stab_write_symbol): Here too.
+       (write_stabs_in_sections_debugging_info): And here.
+       (stab_int_type): And here.
+       (stab_struct_field): And here.
+       (stab_typdef): And here.
+
+       * rescoff.c (read_coff_rsrc): Use fatal instead of fprintf, exit.
+       * srconv.c (main): Same here.
+       * strings.c (main): And here.
+       (integer_arg): And here.
+       * sysdump.c (main): And here.
+
 2000-04-05  Alan Modra  <alan@linuxcare.com.au>
 
        * binutils.texi: Remove optional `=' from long options that have
@@ -7356,7 +7452,8 @@ Mon Sep 30 12:30:39 1991  Per Bothner  (bothner at cygnus.com)
 
 Mon May 20 16:14:07 1991  Steve Chamberlain  (steve at cygint.cygnus.com)
 
-        *objdump.c *nm.c *copy.c :hanged some types to work with 64 bit object files
+        *objdump.c *nm.c *copy.c: Changed some types to work with 64 bit
+       object files.
 
 Thu May 16 16:06:55 1991  Steve Chamberlain  (steve at cygint.cygnus.com)
      from bother
index 0ecc13648dec4ea7b9d1089b67cd3f086c1d8283..4c509bf6413e5ae0318d397b438683c9f68265a1 100644 (file)
@@ -267,7 +267,7 @@ windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \
        winduni.c resres.c $(BULIBS)
 windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
 
-dllwrap_SOURCES = dllwrap.c dyn-string.c 
+dllwrap_SOURCES = dllwrap.c dyn-string.c version.c
 dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS)
 
 
index 033a80078b0448b21eb2c0442a0d67d3aff8894e..8172759603ab73f60824a60313fb618e3a0d9c41 100644 (file)
@@ -280,7 +280,7 @@ windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \
 
 windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
 
-dllwrap_SOURCES = dllwrap.c dyn-string.c 
+dllwrap_SOURCES = dllwrap.c dyn-string.c version.c
 dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS)
 
 DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
@@ -338,7 +338,7 @@ windres_OBJECTS =  windres.o resrc.o rescoff.o resbin.o rcparse.o \
 rclex.o winduni.o resres.o bucomm.o version.o filemode.o
 windres_DEPENDENCIES =  ../bfd/libbfd.la ../libiberty/libiberty.a
 windres_LDFLAGS = 
-dllwrap_OBJECTS =  dllwrap.o dyn-string.o
+dllwrap_OBJECTS =  dllwrap.o dyn-string.o version.o
 dllwrap_DEPENDENCIES =  ../libiberty/libiberty.a
 dllwrap_LDFLAGS = 
 size_OBJECTS =  size.o bucomm.o version.o filemode.o
index a6d89c86d728df3a217009213e878f6f4735bec9..20c7eef437c03ceab35813af8b94ea059b128cbd 100644 (file)
@@ -1,5 +1,5 @@
 /* addr2line.c -- convert addresses to line number and function name
-   Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright 1997, 98, 99, 2000 Free Software Foundation, Inc.
    Contributed by Ulrich Lauther <Ulrich.Lauther@zfe.siemens.de>
 
    This file is part of GNU Binutils.
index 045adecc5451c9722042a7e378cdd404f2ac277e..17388a499012f656f40d93de649d47e28631be64 100644 (file)
@@ -1,5 +1,5 @@
 /* ar.c - Archive modify and extract.
-   Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 1999
+   Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
    Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
@@ -538,7 +538,7 @@ main (argc, argv)
          break;
        default:
          /* xgettext:c-format */
-         fprintf (stderr, _("%s: illegal option -- %c\n"), program_name, c);
+         non_fatal (_("illegal option -- %c"), c);
          usage (0);
        }
     }
@@ -583,7 +583,7 @@ main (argc, argv)
       if (counted_name_mode) 
        {
           if (operation != extract && operation != delete) 
-            fatal (_("`N' is only meaningful with the `x' and 'd' options."));
+            fatal (_("`N' is only meaningful with the `x' and `d' options."));
          counted_name_counter = atoi (argv[arg_index++]);
           if (counted_name_counter <= 0)
            fatal (_("Value for `N' must be positive."));
@@ -669,9 +669,7 @@ main (argc, argv)
          /* Shouldn't happen! */
        default:
          /* xgettext:c-format */
-         fprintf (stderr, _("%s: internal error -- this option not implemented\n"),
-                  program_name);
-         xexit (1);
+         fatal (_("internal error -- this option not implemented"));
        }
     }
 
@@ -971,8 +969,7 @@ do_quick_append (archive_filename, files_to_append)
       fwrite (ARMAG, 1, SARMAG, ofile);
       if (!silent_create)
        /* xgettext:c-format */
-       fprintf (stderr, _("%s: creating %s\n"),
-                program_name, archive_filename);
+       non_fatal (_("creating %s"), archive_filename);
     }
 
   if (ar_truncate)
@@ -1230,9 +1227,8 @@ move_members (arch, files_to_move)
          current_ptr_ptr = &((*current_ptr_ptr)->next);
        }
       /* xgettext:c-format */
-      fprintf (stderr, _("%s: no entry %s in archive %s!\n"),
-              program_name, *files_to_move, arch->filename);
-      xexit (1);
+      fatal (_("no entry %s in archive %s!"), *files_to_move, arch->filename);
+
     next_file:;
     }
 
index a5b0054887aaeaf38bd01c99a56f1686d877db68..3406e1d6e60b6692b718161260020abcd3cbed6d 100644 (file)
@@ -1,5 +1,6 @@
 /* bucomm.c -- Bin Utils COMmon code.
-   Copyright (C) 1991, 92, 93, 94, 95, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1991, 92, 93, 94, 95, 97, 98, 2000
+   Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
 typedef long time_t;
 #endif
 #endif
-
-#ifdef ANSI_PROTOTYPES
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
 \f
 /* Error reporting */
 
@@ -64,7 +59,7 @@ bfd_fatal (string)
   xexit (1);
 }
 
-static void
+void
 report (format, args)
      const char * format;
      va_list args;
index f211473980105f8d38fd2c1d27ea3d4b4bef3c39..c6dc26a1f09f618845306cf9081df30b8be13c5e 100644 (file)
@@ -1,5 +1,5 @@
 /* bucomm.h -- binutils common include file.
-   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+   Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
    Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
@@ -28,6 +28,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "config.h"
 #include "bin-bugs.h"
 
+#ifdef ANSI_PROTOTYPES
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
 #ifdef USE_BINARY_FOPEN
 #include "fopen-bin.h"
 #else
@@ -143,13 +149,15 @@ void *alloca ();
 #endif
 
 /* bucomm.c */
-void bfd_nonfatal PARAMS ((CONST char *));
+void bfd_nonfatal PARAMS ((const char *));
+
+void bfd_fatal PARAMS ((const char *)) ATTRIBUTE_NORETURN;
 
-void bfd_fatal PARAMS ((CONST char *));
+void report PARAMS ((const char *, va_list));
 
-void fatal PARAMS ((CONST char *, ...));
+void fatal PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 
-void non_fatal PARAMS ((CONST char *, ...));
+void non_fatal PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
 
 void set_default_bfd_target PARAMS ((void));
 
index dc84d50917683112270078eb7c999a9dd8bd8ab2..77dbd33276d59a66f79dce028f144d6ca36cbf83 100644 (file)
@@ -1,5 +1,5 @@
 /* Coff file dumper.
-   Copyright (C) 1994, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1994, 95, 98, 99, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
 
@@ -513,9 +513,7 @@ main (ac, av)
 
   if (!input_file)
     {
-      fprintf (stderr,_("%s: no input file specified\n"),
-              program_name);
-      exit(1);
+      fatal (_("no input file specified"));
     }
   abfd = bfd_openr (input_file, 0);
 
index 4189b5e01bdffa7f3bc0250d3ff126317e4fb9ac..b618b96994658d8bab223fab8480514de3edc4f5 100644 (file)
@@ -683,23 +683,7 @@ static void fill_ordinals PARAMS ((export_type **));
 static int alphafunc PARAMS ((const void *, const void *));
 static void mangle_defs PARAMS ((void));
 static void usage PARAMS ((FILE *, int));
-static void display PARAMS ((const char *, va_list));
 static void inform PARAMS ((const char *, ...));
-static void warn PARAMS ((const char *, ...));
-
-static void
-display (message, args)
-     const char * message;
-     va_list      args;
-{
-  if (program_name != NULL)
-    fprintf (stderr, "%s: ", program_name);
-
-  vfprintf (stderr, message, args);
-
-  if (message [strlen (message) - 1] != '\n')
-    fputc ('\n', stderr);
-}  
 
 
 static void
@@ -722,33 +706,11 @@ inform (message, va_alist)
   va_start (args);
 #endif
 
-  display (message, args);
+  report (message, args);
   
   va_end (args);
 }
 
-static void
-#ifdef __STDC__
-warn (const char * message, ...)
-#else
-warn (message, va_alist)
-     const char * message;
-     va_dcl
-#endif
-{
-  va_list args;
-  
-#ifdef __STDC__
-  va_start (args, message);
-#else
-  va_start (args);
-#endif
-  
-  display (message, args);
-
-  va_end (args);
-}
-
 static const char *
 rvaafter (machine)
      int machine;
@@ -767,7 +729,7 @@ rvaafter (machine)
       break;
     default:
       /* xgettext:c-format */
-      fatal (_("Internal error: Unknown machine type: %d\n"), machine);
+      fatal (_("Internal error: Unknown machine type: %d"), machine);
       break;
     }
   return "";
@@ -791,7 +753,7 @@ rvabefore (machine)
       return ".rva\t";
     default:
       /* xgettext:c-format */
-      fatal (_("Internal error: Unknown machine type: %d\n"), machine);
+      fatal (_("Internal error: Unknown machine type: %d"), machine);
       break;
     }
   return "";
@@ -816,7 +778,7 @@ asm_prefix (machine)
       return "_";
     default:
       /* xgettext:c-format */
-      fatal (_("Internal error: Unknown machine type: %d\n"), machine);
+      fatal (_("Internal error: Unknown machine type: %d"), machine);
       break;
     }
   return "";
@@ -887,7 +849,7 @@ yyerror (err)
      const char * err ATTRIBUTE_UNUSED;
 {
   /* xgettext:c-format */
-  warn (_("Syntax error in def file %s:%d\n"), def_file, linenumber);
+  non_fatal (_("Syntax error in def file %s:%d"), def_file, linenumber);
   
   return 0;
 }
@@ -923,7 +885,7 @@ def_name (name, base)
   inform (_("NAME: %s base: %x"), name, base);
   
   if (d_is_dll)
-    warn (_("Can't have LIBRARY and NAME\n"));
+    non_fatal (_("Can't have LIBRARY and NAME"));
   
   d_name = name;
   /* if --dllname not provided, use the one in the DEF file.
@@ -942,7 +904,7 @@ def_library (name, base)
   inform (_("LIBRARY: %s base: %x"), name, base);
   
   if (d_is_exe)
-    warn (_("%s: Can't have LIBRARY and NAME\n"), program_name);
+    non_fatal (_("Can't have LIBRARY and NAME"));
   
   d_name = name;
   /* if --dllname not provided, use the one in the DEF file. */
@@ -1157,7 +1119,7 @@ run (what, args)
   char *errmsg_fmt, *errmsg_arg;
   char *temp_base = choose_temp_base ();
 
-  inform ("run: %s %s\n", what, args);
+  inform ("run: %s %s", what, args);
 
   /* Count the args */
   i = 0;
@@ -1208,8 +1170,8 @@ run (what, args)
     {
       if (WEXITSTATUS (wait_status) != 0)
        /* xgettext:c-format */
-       warn (_("%s exited with status %d\n"),
-             what, WEXITSTATUS (wait_status));
+       non_fatal (_("%s exited with status %d"),
+                  what, WEXITSTATUS (wait_status));
     }
   else
     abort ();
@@ -1240,7 +1202,7 @@ scan_drectve_symbols (abfd)
   bfd_get_section_contents (abfd, s, buf, 0, size);
       
   /* xgettext:c-format */
-  inform (_("Sucking in info from %s section in %s\n"),
+  inform (_("Sucking in info from %s section in %s"),
          DRECTVE_SECTION_NAME, bfd_get_filename (abfd));
 
   /* Search for -export: strings. The exported symbols can optionally
@@ -1364,7 +1326,7 @@ add_excludes (new_excludes)
       excludes = new_exclude;
 
       /* xgettext:c-format */
-      inform (_("Excluding symbol: %s\n"), exclude_string);
+      inform (_("Excluding symbol: %s"), exclude_string);
     }
 
   free (local_copy);
@@ -1459,7 +1421,7 @@ scan_all_symbols (abfd)
   if (! (bfd_get_file_flags (abfd) & HAS_SYMS))
     {
       /* xgettext:c-format */
-      warn (_("%s: no symbols\n"), bfd_get_filename (abfd));
+      non_fatal (_("%s: no symbols"), bfd_get_filename (abfd));
       return;
     }
 
@@ -1470,7 +1432,7 @@ scan_all_symbols (abfd)
   if (symcount == 0)
     {
       /* xgettext:c-format */
-      warn (_("%s: no symbols\n"), bfd_get_filename (abfd));
+      non_fatal (_("%s: no symbols"), bfd_get_filename (abfd));
       return;
     }
 
@@ -1497,7 +1459,7 @@ scan_open_obj_file (abfd)
   /* FIXME: we ought to read in and block out the base relocations */
 
   /* xgettext:c-format */
-  inform (_("Done reading %s\n"), bfd_get_filename (abfd));
+  inform (_("Done reading %s"), bfd_get_filename (abfd));
 }
 
 static void
@@ -1787,7 +1749,7 @@ gen_exp_file ()
   dlist_type *dl;
 
   /* xgettext:c-format */
-  inform (_("Generating export file: %s\n"), exp_name);
+  inform (_("Generating export file: %s"), exp_name);
   
   f = fopen (TMP_ASM, FOPEN_WT);
   if (!f)
@@ -2784,7 +2746,7 @@ gen_lib_file ()
     fatal (_("Can't open .lib file: %s"), imp_name);
 
   /* xgettext:c-format */
-  inform (_("Creating library file: %s\n"), imp_name);
+  inform (_("Creating library file: %s"), imp_name);
   
   bfd_set_format (outarch, bfd_archive);
   outarch->has_armap = 1;
@@ -2843,7 +2805,7 @@ gen_lib_file ()
          sprintf (name, "%s%05d.o", TMP_STUB, i);
          if (unlink (name) < 0)
            /* xgettext:c-format */
-           warn (_("cannot delete %s: %s\n"), name, strerror (errno));
+           non_fatal (_("cannot delete %s: %s"), name, strerror (errno));
        }
     }
   
@@ -2952,7 +2914,7 @@ process_duplicates (d_export_vec)
              more = 1;
              
              /* xgettext:c-format */
-             inform (_("Warning, ignoring duplicate EXPORT %s %d,%d\n"),
+             inform (_("Warning, ignoring duplicate EXPORT %s %d,%d"),
                      a->name, a->ordinal, b->ordinal);
              
              if (a->ordinal != -1
index 25bf519d192e1a5d847ec4cc0c00555b07bb6599..637fa52fc17ff76002085b3cefed1421a6a1e220 100644 (file)
@@ -78,7 +78,6 @@
 #endif /* defined (_WIN32) && ! defined (__CYGWIN32__) */
 #endif /* ! HAVE_SYS_WAIT_H */
 
-static char *program_version = "0.2.4";
 static char *driver_name = NULL;
 static char *cygwin_driver_flags = 
   "-Wl,--dll -nostartfiles";
@@ -120,6 +119,7 @@ static int run PARAMS ((const char *, char *));
 static void usage PARAMS ((FILE *, int));
 static void display PARAMS ((const char *, va_list));
 static void inform PARAMS ((const char *, ...));
+static void warn PARAMS ((const char *format, ...));
 static char *look_for_prog PARAMS ((const char *, const char *, int));
 static char *deduce_name PARAMS ((const char *));
 static void delete_temp_files PARAMS ((void));
@@ -144,37 +144,63 @@ display (message, args)
     fprintf (stderr, "%s: ", program_name);
 
   vfprintf (stderr, message, args);
-
-  if (message [strlen (message) - 1] != '\n')
-    fputc ('\n', stderr);
-}  
+  fputc ('\n', stderr);
+}
 
 
-static void
 #ifdef __STDC__
+static void
 inform (const char * message, ...)
+{
+  va_list args;
+
+  if (!verbose)
+    return;
+
+  va_start (args, message);
+  display (message, args);
+  va_end (args);
+}
+
+static void
+warn (const char *format, ...)
+{
+  va_list args;
+
+  va_start (args, format);
+  display (format, args);
+  va_end (args);
+}
 #else
+
+static void
 inform (message, va_alist)
      const char * message;
      va_dcl
-#endif
 {
   va_list args;
-  
+
   if (!verbose)
     return;
 
-#ifdef __STDC__
-  va_start (args, message);
-#else
   va_start (args);
-#endif
-
   display (message, args);
-  
   va_end (args);
 }
 
+static void
+warn (format, va_alist)
+     const char *format;
+     va_dcl
+{
+  va_list args;
+
+  va_start (args);
+  display (format, args);
+  va_end (args);
+}
+#endif
+
 /* Look for the program formed by concatenating PROG_NAME and the
    string running from PREFIX to END_PREFIX.  If the concatenated
    string contains a '/', try appending EXECUTABLE_SUFFIX if it is
@@ -304,9 +330,12 @@ delete_temp_files ()
   if (delete_base_file && base_file_name)
     {
       if (verbose)
-       fprintf (stderr, "%s temporary base file %s\n",
-                dontdeltemps ? "Keeping" : "Deleting",
-                base_file_name);
+       {
+         if (dontdeltemps)
+           warn (_("Keeping temporary base file %s"), base_file_name);
+         else
+           warn (_("Deleting temporary base file %s"), base_file_name);
+       }
       if (! dontdeltemps)
         {
           unlink (base_file_name);
@@ -317,9 +346,12 @@ delete_temp_files ()
   if (delete_exp_file && exp_file_name)
     {
       if (verbose)
-       fprintf (stderr, "%s temporary exp file %s\n",
-                dontdeltemps ? "Keeping" : "Deleting",
-                exp_file_name);
+       {
+         if (dontdeltemps)
+           warn (_("Keeping temporary exp file %s"), exp_file_name);
+         else
+           warn (_("Deleting temporary exp file %s"), exp_file_name);
+       }
       if (! dontdeltemps)
         {
           unlink (exp_file_name);
@@ -329,9 +361,12 @@ delete_temp_files ()
   if (delete_def_file && def_file_name)
     {
       if (verbose)
-       fprintf (stderr, "%s temporary def file %s\n",
-                dontdeltemps ? "Keeping" : "Deleting",
-                def_file_name);
+       {
+         if (dontdeltemps)
+           warn (_("Keeping temporary def file %s"), def_file_name);
+         else
+           warn (_("Deleting temporary def file %s"), def_file_name);
+       }
       if (! dontdeltemps)
         {
           unlink (def_file_name);
@@ -413,21 +448,19 @@ run (what, args)
   pid = pwait (pid, &wait_status, 0);
   if (pid == -1)
     {
-      fprintf (stderr, "%s: wait: %s\n", program_name, strerror (errno));
+      warn ("wait: %s", strerror (errno));
       retcode = 1;
     }
   else if (WIFSIGNALED (wait_status))
     {
-      fprintf (stderr, "%s: subprocess got fatal signal %d\n",
-              program_name, WTERMSIG (wait_status));
+      warn (_("subprocess got fatal signal %d"), WTERMSIG (wait_status));
       retcode = 1;
     }
   else if (WIFEXITED (wait_status))
     {
       if (WEXITSTATUS (wait_status) != 0)
        {
-         fprintf (stderr, "%s: %s exited with status %d\n",
-                  program_name, what, WEXITSTATUS (wait_status));
+         warn (_("%s exited with status %d"), what, WEXITSTATUS (wait_status));
          retcode = 1;
        }
     }
@@ -479,61 +512,47 @@ strhash (const char *str)
 
 /**********************************************************************/
 
-void
-print_version (name)
-     const char *name;
-{
-  /* This output is intended to follow the GNU standards document.  */
-  /* xgettext:c-format */
-  printf ("GNU %s %s\n", name, program_version);
-  printf ("Copyright 1998 Free Software Foundation, Inc.\n");
-  printf ("\
-This program is free software; you may redistribute it under the terms of\n\
-the GNU General Public License.  This program has absolutely no warranty.\n");
-  exit (0);
-}
-
 static void
 usage (file, status)
      FILE *file;
      int status;
 {
-  fprintf (file, "Usage %s <options> <object-files>\n", program_name);
-  fprintf (file, "  Generic options:\n");
-  fprintf (file, "   --quiet, -q            Work quietly\n");
-  fprintf (file, "   --verbose, -v          Verbose\n");
-  fprintf (file, "   --version              Print dllwrap version\n");
-  fprintf (file, "   --implib <outname>     Synonym for --output-lib\n");
-  fprintf (file, "  Options for %s:\n", program_name);
-  fprintf (file, "   --driver-name <driver> Defaults to \"gcc\"\n");
-  fprintf (file, "   --driver-flags <flags> Override default ld flags\n");
-  fprintf (file, "   --dlltool-name <dlltool> Defaults to \"dlltool\"\n");
-  fprintf (file, "   --entry <entry>        Specify alternate DLL entry point\n");
-  fprintf (file, "   --image-base <base>    Specify image base address\n");
-  fprintf (file, "   --target <machine>     i386-cygwin32 or i386-mingw32\n");
-  fprintf (file, "   --dry-run              Show what needs to be run\n");
-  fprintf (file, "   --mno-cygwin           Create Mingw DLL\n");
-  fprintf (file, "  Options passed to DLLTOOL:\n");
-  fprintf (file, "   --machine <machine>\n");
-  fprintf (file, "   --output-exp <outname> Generate export file.\n");
-  fprintf (file, "   --output-lib <outname> Generate input library.\n");
-  fprintf (file, "   --add-indirect         Add dll indirects to export file.\n");
-  fprintf (file, "   --dllname <name>       Name of input dll to put into output lib.\n");
-  fprintf (file, "   --def <deffile>        Name input .def file\n");
-  fprintf (file, "   --output-def <deffile> Name output .def file\n");
-  fprintf (file, "   --export-all-symbols     Export all symbols to .def\n");
-  fprintf (file, "   --no-export-all-symbols  Only export .drectve symbols\n");
-  fprintf (file, "   --exclude-symbols <list> Exclude <list> from .def\n");
-  fprintf (file, "   --no-default-excludes    Zap default exclude symbols\n");
-  fprintf (file, "   --base-file <basefile> Read linker generated base file\n");
-  fprintf (file, "   --no-idata4           Don't generate idata$4 section\n");
-  fprintf (file, "   --no-idata5           Don't generate idata$5 section\n");
-  fprintf (file, "   -U                     Add underscores to .lib\n");
-  fprintf (file, "   -k                     Kill @<n> from exported names\n");
-  fprintf (file, "   --add-stdcall-alias    Add aliases without @<n>\n");
-  fprintf (file, "   --as <name>            Use <name> for assembler\n");
-  fprintf (file, "   --nodelete             Keep temp files.\n");
-  fprintf (file, "  Rest are passed unmodified to the language driver\n");
+  fprintf (file, _("Usage %s <options> <object-files>\n"), program_name);
+  fprintf (file, _("  Generic options:\n"));
+  fprintf (file, _("   --quiet, -q            Work quietly\n"));
+  fprintf (file, _("   --verbose, -v          Verbose\n"));
+  fprintf (file, _("   --version              Print dllwrap version\n"));
+  fprintf (file, _("   --implib <outname>     Synonym for --output-lib\n"));
+  fprintf (file, _("  Options for %s:\n"), program_name);
+  fprintf (file, _("   --driver-name <driver> Defaults to \"gcc\"\n"));
+  fprintf (file, _("   --driver-flags <flags> Override default ld flags\n"));
+  fprintf (file, _("   --dlltool-name <dlltool> Defaults to \"dlltool\"\n"));
+  fprintf (file, _("   --entry <entry>        Specify alternate DLL entry point\n"));
+  fprintf (file, _("   --image-base <base>    Specify image base address\n"));
+  fprintf (file, _("   --target <machine>     i386-cygwin32 or i386-mingw32\n"));
+  fprintf (file, _("   --dry-run              Show what needs to be run\n"));
+  fprintf (file, _("   --mno-cygwin           Create Mingw DLL\n"));
+  fprintf (file, _("  Options passed to DLLTOOL:\n"));
+  fprintf (file, _("   --machine <machine>\n"));
+  fprintf (file, _("   --output-exp <outname> Generate export file.\n"));
+  fprintf (file, _("   --output-lib <outname> Generate input library.\n"));
+  fprintf (file, _("   --add-indirect         Add dll indirects to export file.\n"));
+  fprintf (file, _("   --dllname <name>       Name of input dll to put into output lib.\n"));
+  fprintf (file, _("   --def <deffile>        Name input .def file\n"));
+  fprintf (file, _("   --output-def <deffile> Name output .def file\n"));
+  fprintf (file, _("   --export-all-symbols     Export all symbols to .def\n"));
+  fprintf (file, _("   --no-export-all-symbols  Only export .drectve symbols\n"));
+  fprintf (file, _("   --exclude-symbols <list> Exclude <list> from .def\n"));
+  fprintf (file, _("   --no-default-excludes    Zap default exclude symbols\n"));
+  fprintf (file, _("   --base-file <basefile> Read linker generated base file\n"));
+  fprintf (file, _("   --no-idata4           Don't generate idata$4 section\n"));
+  fprintf (file, _("   --no-idata5           Don't generate idata$5 section\n"));
+  fprintf (file, _("   -U                     Add underscores to .lib\n"));
+  fprintf (file, _("   -k                     Kill @<n> from exported names\n"));
+  fprintf (file, _("   --add-stdcall-alias    Add aliases without @<n>\n"));
+  fprintf (file, _("   --as <name>            Use <name> for assembler\n"));
+  fprintf (file, _("   --nodelete             Keep temp files.\n"));
+  fprintf (file, _("  Rest are passed unmodified to the language driver\n"));
   fprintf (file, "\n\n");
   exit (status);
 }
@@ -614,7 +633,7 @@ static const struct option long_options[] =
   {"add-indirect", no_argument, NULL, OPTION_ADD_INDIRECT},
   {"base-file", required_argument, NULL, OPTION_BASE_FILE},
   {"as", required_argument, NULL, OPTION_AS},
-  {0}
+  {0, 0, 0, 0}
 };
 
 int
@@ -794,9 +813,7 @@ main (argc, argv)
   /* sanity checks. */
   if (! dll_name && ! dll_file_name)
     {
-      fprintf (stderr,
-               "%s: Must provide at least one of -o or --dllname options\n",
-               program_name);
+      warn (_("Must provide at least one of -o or --dllname options"));
       exit (1);
     }
   else if (! dll_name)
@@ -824,9 +841,8 @@ main (argc, argv)
       delete_def_file = 1;
       free (fileprefix);
       delete_def_file = 1;
-      fprintf (stderr, "Warning: no export definition file provided\n");
-      fprintf (stderr, 
-               "dllwrap will create one, but may not be what you want\n");
+      warn (_("no export definition file provided"));
+      warn (_("creating one, but that may not be what you want"));
     }
   
   /* set the target platform. */
@@ -987,10 +1003,10 @@ main (argc, argv)
 
   if (verbose)
     {
-      fprintf (stderr, "DLLTOOL name    : %s\n", dlltool_name);
-      fprintf (stderr, "DLLTOOL options : %s\n", dlltool_cmdline->s);
-      fprintf (stderr, "DRIVER name     : %s\n", driver_name);
-      fprintf (stderr, "DRIVER options  : %s\n", driver_cmdline->s);
+      fprintf (stderr, _("DLLTOOL name    : %s\n"), dlltool_name);
+      fprintf (stderr, _("DLLTOOL options : %s\n"), dlltool_cmdline->s);
+      fprintf (stderr, _("DRIVER name     : %s\n"), driver_name);
+      fprintf (stderr, _("DRIVER options  : %s\n"), driver_cmdline->s);
     }
  
   /*
index 44bfbe01b999889210f9aef873dacd6517f78669..26602d7b6a716deb428ffecde272deac42a716c1 100644 (file)
@@ -1,5 +1,6 @@
 /* nlmconv.c -- NLM conversion program
-   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 99, 2000
+   Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
 
@@ -271,10 +272,7 @@ main (argc, argv)
            show_usage (stderr, 1);
          if (strcmp (input_file, output_file) == 0)
            {
-             fprintf (stderr,
-                      _("%s: input and output files must be different\n"),
-                      program_name);
-             exit (1);
+             fatal (_("input and output files must be different"));
            }
        }
     }
@@ -321,10 +319,7 @@ main (argc, argv)
     {
       if (input_file != NULL)
        {
-         fprintf (stderr,
-                  _("%s: input file named both on command line and with INPUT\n"),
-                  program_name);
-         exit (1);
+         fatal (_("input file named both on command line and with INPUT"));
        }
       if (input_files->next == NULL)
        input_file = input_files->string;
@@ -333,7 +328,7 @@ main (argc, argv)
     }
   else if (input_file == NULL)
     {
-      fprintf (stderr, _("%s: no input file\n"), program_name);
+      non_fatal (_("no input file"));
       show_usage (stderr, 1);
     }
 
@@ -363,8 +358,7 @@ main (argc, argv)
      Otherwise use the file named in the OUTPUT statement.  */
   if (output_file == NULL)
     {
-      fprintf (stderr, _("%s: no name for output file\n"),
-              program_name);
+      non_fatal (_("no name for output file"));
       show_usage (stderr, 1);
     }
 
@@ -377,9 +371,7 @@ main (argc, argv)
   assert (bfd_get_flavour (outbfd) == bfd_target_nlm_flavour);
 
   if (bfd_arch_get_compatible (inbfd, outbfd) == NULL)
-    fprintf (stderr,
-            _("%s: warning:input and output formats are not compatible\n"),
-            program_name);
+    non_fatal (_("warning: input and output formats are not compatible"));
 
   /* Move the values read from the command file into outbfd.  */
   *nlm_fixed_header (outbfd) = fixed_hdr_struct;
@@ -634,9 +626,8 @@ main (argc, argv)
                }
            }
          if (l == NULL)
-           fprintf (stderr,
-                    _("%s: warning: symbol %s imported but not in import list\n"),
-                    program_name, bfd_asymbol_name (sym));
+           non_fatal (_("warning: symbol %s imported but not in import list"),
+                      bfd_asymbol_name (sym));
        }
        
       /* See if it's one of the special named symbols.  */
@@ -704,15 +695,11 @@ main (argc, argv)
   bfd_set_symtab (outbfd, outsyms, symcount + newsymcount);
     
   if (! gotstart)
-    fprintf (stderr, _("%s: warning: START procedure %s not defined\n"),
-            program_name, start_procedure);
+    non_fatal (_("warning: START procedure %s not defined"), start_procedure);
   if (! gotexit)
-    fprintf (stderr, _("%s: warning: EXIT procedure %s not defined\n"),
-            program_name, exit_procedure);
-  if (check_procedure != NULL
-      && ! gotcheck)
-    fprintf (stderr, _("%s: warning: CHECK procedure %s not defined\n"),
-            program_name, check_procedure);
+    non_fatal (_("warning: EXIT procedure %s not defined"), exit_procedure);
+  if (check_procedure != NULL && ! gotcheck)
+    non_fatal (_("warning: CHECK procedure %s not defined"), check_procedure);
 
   /* Add additional sections required for the header information.  */
   if (custom_file != NULL)
@@ -848,9 +835,8 @@ main (argc, argv)
              if (sharedhdr.uninitializedDataSize > 0)
                {
                  /* There is no place to record this information.  */
-                 fprintf (stderr,
-                          _("%s:%s: warning: shared libraries can not have uninitialized data\n"),
-                          program_name, sharelib_file);
+                 non_fatal (_("%s: warning: shared libraries can not have uninitialized data"),
+                            sharelib_file);
                }
              shared_offset = st.st_size;
              if (shared_offset > (size_t) sharedhdr.codeImageOffset)
@@ -878,8 +864,7 @@ main (argc, argv)
 
   /* Check whether a version was given.  */
   if (strncmp (version_hdr->stamp, "VeRsIoN#", 8) != 0)
-    fprintf (stderr, _("%s: warning: No version number given\n"),
-            program_name);
+    non_fatal (_("warning: No version number given"));
 
   /* At least for now, always create an extended header, because that
      is what NLMLINK does.  */
@@ -919,8 +904,7 @@ main (argc, argv)
 
       data = xmalloc (custom_size);
       if (fread (data, 1, custom_size, custom_data) != custom_size)
-       fprintf (stderr, _("%s:%s: read: %s\n"), program_name, custom_file,
-                strerror (errno));
+       non_fatal (_("%s: read: %s"), custom_file, strerror (errno));
       else
        {
          if (! bfd_set_section_contents (outbfd, custom_section, data,
@@ -942,17 +926,14 @@ main (argc, argv)
       nlm_fixed_header (outbfd)->debugInfoOffset = (file_ptr) -1;
     }
   if (map_file != NULL)
-    fprintf (stderr,
-            _("%s: warning: MAP and FULLMAP are not supported; try ld -M\n"),
-            program_name);
+    non_fatal (_("warning: MAP and FULLMAP are not supported; try ld -M"));
   if (help_file != NULL)
     {
       PTR data;
 
       data = xmalloc (help_size);
       if (fread (data, 1, help_size, help_data) != help_size)
-       fprintf (stderr, _("%s:%s: read: %s\n"), program_name, help_file,
-                strerror (errno));
+       non_fatal (_("%s: read: %s"), help_file, strerror (errno));
       else
        {
          if (! bfd_set_section_contents (outbfd, help_section, data,
@@ -970,8 +951,7 @@ main (argc, argv)
 
       data = xmalloc (message_size);
       if (fread (data, 1, message_size, message_data) != message_size)
-       fprintf (stderr, _("%s:%s: read: %s\n"), program_name, message_file,
-                strerror (errno));
+       non_fatal (_("%s: read: %s"), message_file, strerror (errno));
       else
        {
          if (! bfd_set_section_contents (outbfd, message_section, data,
@@ -1020,8 +1000,7 @@ main (argc, argv)
 
       data = xmalloc (rpc_size);
       if (fread (data, 1, rpc_size, rpc_data) != rpc_size)
-       fprintf (stderr, _("%s:%s: read: %s\n"), program_name, rpc_file,
-                strerror (errno));
+       non_fatal (_("%s: read: %s"), rpc_file, strerror (errno));
       else
        {
          if (! bfd_set_section_contents (outbfd, rpc_section, data,
@@ -1040,8 +1019,7 @@ main (argc, argv)
       data = xmalloc (shared_size);
       if (fseek (shared_data, shared_offset, SEEK_SET) != 0
          || fread (data, 1, shared_size, shared_data) != shared_size)
-       fprintf (stderr, _("%s:%s: read: %s\n"), program_name, sharelib_file,
-                strerror (errno));
+       non_fatal (_("%s: read: %s"), sharelib_file, strerror (errno));
       else
        {
          if (! bfd_set_section_contents (outbfd, shared_section, data,
@@ -1170,11 +1148,8 @@ select_output_format (arch, mach, bigendian)
       return "nlm32-powerpc";
 #endif
     default:
-      fprintf (stderr, _("%s: support not compiled in for %s\n"),
-              program_name, bfd_printable_arch_mach (arch, mach));
-      exit (1);
-      /* Avoid warning.  */
-      return NULL;
+      fatal (_("support not compiled in for %s"),
+            bfd_printable_arch_mach (arch, mach));
     }
   /*NOTREACHED*/
 }
@@ -2000,8 +1975,8 @@ powerpc_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents,
             between two sections both of which were placed in the
             same output section.  This should not happen.  */
          if (bfd_get_section (sym) != insec->output_section)
-           fprintf (stderr, _("%s: unresolved PC relative reloc against %s\n"),
-                    program_name, bfd_asymbol_name (sym));
+           non_fatal (_("unresolved PC relative reloc against %s"),
+                      bfd_asymbol_name (sym));
          else
            {
              bfd_vma val;
@@ -2064,9 +2039,8 @@ powerpc_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents,
                        & rel->howto->dst_mask));
              if ((bfd_signed_vma) val < - 0x8000
                  || (bfd_signed_vma) val >= 0x8000)
-               fprintf (stderr,
-                        _("%s: overflow when adjusting relocation against %s\n"),
-                        program_name, bfd_asymbol_name (sym));
+               non_fatal (_("overflow when adjusting relocation against %s"),
+                          bfd_asymbol_name (sym));
              bfd_put_16 (outbfd, val, (bfd_byte *) contents + rel->address);
              break;
 
@@ -2203,7 +2177,7 @@ link_inputs (inputs, ld)
 
   if (status != 0)
     {
-      fprintf (stderr, _("%s: Execution of %s failed\n"), program_name, ld);
+      non_fatal (_("Execution of %s failed"), ld);
       unlink (unlink_on_exit);
       exit (1);
     }
index bfe2158ca6884d7af8f76a96b523c000ec3a76cb..2ee48731bed46fb4879e585c9b1ac5b8b1bfd061 100644 (file)
@@ -1,5 +1,5 @@
 /* nm.c -- Describe symbol table of a rel file.
-   Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 1999
+   Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
@@ -336,8 +336,7 @@ set_print_radix (radix)
       other_format[3] = desc_format[3] = *radix;
       break;
     default:
-      fprintf (stderr, _("%s: %s: invalid radix\n"), program_name, radix);
-      exit (1);
+      fatal (_("%s: invalid radix"), radix);
     }
 }
 
@@ -362,8 +361,7 @@ set_output_format (f)
       i = FORMAT_SYSV;
       break;
     default:
-      fprintf (stderr, _("%s: %s: invalid output format\n"), program_name, f);
-      exit (1);
+      fatal (_("%s: invalid output format"), f);
     }
   format = &formats[i];
 }
@@ -489,8 +487,7 @@ main (argc, argv)
     {
       char *lim = (char *) sbrk (0);
 
-      fprintf (stderr, _("%s: data size %ld\n"), program_name,
-              (long) (lim - (char *) &environ));
+      non_fatal (_("data size %ld"), (long) (lim - (char *) &environ));
     }
 #endif
 
@@ -901,7 +898,7 @@ display_rel_file (abfd, archive_bfd)
     {
       if (!(bfd_get_file_flags (abfd) & HAS_SYMS))
        {
-         fprintf (stderr, _("%s: no symbols\n"), bfd_get_filename (abfd));
+         non_fatal (_("%s: no symbols"), bfd_get_filename (abfd));
          return;
        }
     }
@@ -912,7 +909,7 @@ display_rel_file (abfd, archive_bfd)
 
   if (symcount == 0)
     {
-      fprintf (stderr, _("%s: no symbols\n"), bfd_get_filename (abfd));
+      non_fatal (_("%s: no symbols"), bfd_get_filename (abfd));
       return;
     }
 
index e8c6482c946aaf035bbf63eab5a5a3b6fe39142b..80ca21664aac51619393da70402d128599709fcd 100644 (file)
@@ -1,6 +1,6 @@
-.\" Copyright (c) 1991, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation
+.\" Copyright (c) 1991, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation
 .\" See section COPYING for conditions for redistribution
-.TH objcopy 1 "1999" "Cygnus Solutions" "GNU Development Tools"
+.TH objcopy 1 "05 April 2000" "Cygnus Solutions" "GNU Development Tools"
 .de BP
 .sp
 .ti \-.2i
index 9c83a63ee36ecfb5185b1387c1802520455bb51a..d8c907e7285e7862d4f294c51a3dc47b36af9870 100644 (file)
@@ -1,5 +1,5 @@
 /* objdump.c -- dump information about an object file.
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
    Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
@@ -441,7 +441,7 @@ slurp_symtab (abfd)
 
   if (!(bfd_get_file_flags (abfd) & HAS_SYMS))
     {
-      fprintf (stderr, _("%s: no symbols\n"), bfd_get_filename (abfd));
+      non_fatal (_("%s: no symbols"), bfd_get_filename (abfd));
       symcount = 0;
       return NULL;
     }
@@ -458,7 +458,7 @@ slurp_symtab (abfd)
   if (symcount < 0)
     bfd_fatal (bfd_get_filename (abfd));
   if (symcount == 0)
-    fprintf (stderr, _("%s: no symbols\n"), bfd_get_filename (abfd));
+    non_fatal (_("%s: no symbols"), bfd_get_filename (abfd));
   return sy;
 }
 
@@ -476,8 +476,7 @@ slurp_dynamic_symtab (abfd)
     {
       if (!(bfd_get_file_flags (abfd) & DYNAMIC))
        {
-         fprintf (stderr, _("%s: %s: not a dynamic object\n"),
-                  program_name, bfd_get_filename (abfd));
+         non_fatal (_("%s: not a dynamic object"), bfd_get_filename (abfd));
          dynsymcount = 0;
          return NULL;
        }
@@ -493,8 +492,7 @@ slurp_dynamic_symtab (abfd)
   if (dynsymcount < 0)
     bfd_fatal (bfd_get_filename (abfd));
   if (dynsymcount == 0)
-    fprintf (stderr, _("%s: %s: No dynamic symbols\n"),
-            program_name, bfd_get_filename (abfd));
+    non_fatal (_("%s: No dynamic symbols"), bfd_get_filename (abfd));
   return sy;
 }
 
@@ -1197,8 +1195,7 @@ objdump_sprintf (va_alist)
 
   if (buf == NULL)
     {
-      fprintf (stderr, _("Out of virtual memory\n"));
-      exit (1);
+      fatal (_("Out of virtual memory"));
     }
 
   n = strlen (buf);
@@ -1608,10 +1605,7 @@ disassemble_data (abfd)
       const bfd_arch_info_type *info = bfd_scan_arch (machine);
       if (info == NULL)
        {
-         fprintf (stderr, _("%s: Can't use supplied machine %s\n"),
-                  program_name,
-                  machine);
-         exit (1);
+         fatal (_("Can't use supplied machine %s"), machine);
        }
       abfd->arch_info = info;
     }
@@ -1629,9 +1623,8 @@ disassemble_data (abfd)
   disassemble_fn = disassembler (abfd);
   if (!disassemble_fn)
     {
-      fprintf (stderr, _("%s: Can't disassemble for architecture %s\n"),
-              program_name,
-              bfd_printable_arch_mach (bfd_get_arch (abfd), 0));
+      non_fatal (_("Can't disassemble for architecture %s\n"),
+                bfd_printable_arch_mach (bfd_get_arch (abfd), 0));
       exit_status = 1;
       return;
     }
@@ -1887,8 +1880,8 @@ read_section_stabs (abfd, stabsect_name, strsect_name)
   stabstrsect = bfd_get_section_by_name (abfd, strsect_name);
   if (0 == stabstrsect)
     {
-      fprintf (stderr, _("%s: %s has no %s section\n"), program_name,
-              bfd_get_filename (abfd), strsect_name);
+      non_fatal (_("%s has no %s section"),
+                bfd_get_filename (abfd), strsect_name);
       exit_status = 1;
       return false;
     }
@@ -1901,9 +1894,9 @@ read_section_stabs (abfd, stabsect_name, strsect_name)
   
   if (! bfd_get_section_contents (abfd, stabsect, (PTR) stabs, 0, stab_size))
     {
-      fprintf (stderr, _("%s: Reading %s section of %s failed: %s\n"),
-              program_name, stabsect_name, bfd_get_filename (abfd),
-              bfd_errmsg (bfd_get_error ()));
+      non_fatal (_("Reading %s section of %s failed: %s"),
+                stabsect_name, bfd_get_filename (abfd),
+                bfd_errmsg (bfd_get_error ()));
       free (stabs);
       free (strtab);
       exit_status = 1;
@@ -1913,9 +1906,9 @@ read_section_stabs (abfd, stabsect_name, strsect_name)
   if (! bfd_get_section_contents (abfd, stabstrsect, (PTR) strtab, 0,
                                  stabstr_size))
     {
-      fprintf (stderr, _("%s: Reading %s section of %s failed: %s\n"),
-              program_name, strsect_name, bfd_get_filename (abfd),
-              bfd_errmsg (bfd_get_error ()));
+      non_fatal (_("Reading %s section of %s failed: %s\n"),
+                strsect_name, bfd_get_filename (abfd),
+                bfd_errmsg (bfd_get_error ()));
       free (stabs);
       free (strtab);
       exit_status = 1;
@@ -2146,9 +2139,8 @@ dump_bfd (abfd)
        {
          if (! print_debugging_info (stdout, dhandle))
            {
-             fprintf (stderr,
-                      _("%s: printing debugging information failed\n"),
-                      bfd_get_filename (abfd));
+             non_fatal (_("%s: printing debugging information failed"),
+                        bfd_get_filename (abfd));
              exit_status = 1;
            }
        }
@@ -2858,8 +2850,7 @@ main (argc, argv)
            endian = BFD_ENDIAN_LITTLE;
          else
            {
-             fprintf (stderr, _("%s: unrecognized -E option\n"),
-                      program_name);
+             non_fatal (_("unrecognized -E option"));
              usage (stderr, 1);
            }
          break;
@@ -2870,8 +2861,7 @@ main (argc, argv)
            endian = BFD_ENDIAN_LITTLE;
          else
            {
-             fprintf (stderr, _("%s: unrecognized --endian type `%s'\n"),
-                     program_name, optarg);
+             non_fatal (_("unrecognized --endian type `%s'"), optarg);
              usage (stderr, 1);
            }
          break;
index d1ee6e620f5f82eef5460c48d0ebc35b8ce7960a..e1385c7140eefe6ce86228bd02f640f392bf7282 100644 (file)
@@ -1,5 +1,5 @@
 /* stabs.c -- Parse COFF debugging information
-   Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 98, 99, 2000 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -201,8 +201,7 @@ parse_coff_type (abfd, symbols, types, coff_symno, ntype, pauxent, useaux,
        }
       else
        {
-         fprintf (stderr, _("%s: parse_coff_type: Bad type code 0x%x\n"),
-                  program_name, ntype);
+         non_fatal (_("parse_coff_type: Bad type code 0x%x"), ntype);
          return DEBUG_TYPE_NULL;
        }
 
@@ -420,8 +419,8 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
 
       if (! bfd_coff_get_syment (abfd, sym, &syment))
        {
-         fprintf (stderr, _("%s: bfd_coff_get_syment failed: %s\n"),
-                  program_name, bfd_errmsg (bfd_get_error ()));
+         non_fatal (_("bfd_coff_get_syment failed: %s"),
+                    bfd_errmsg (bfd_get_error ()));
          return DEBUG_TYPE_NULL;
        }
 
@@ -436,8 +435,8 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
        {
          if (! bfd_coff_get_auxent (abfd, sym, 0, &auxent))
            {
-             fprintf (stderr, _("%s: bfd_coff_get_auxent failed: %s\n"),
-                      program_name, bfd_errmsg (bfd_get_error ()));
+             non_fatal (_("bfd_coff_get_auxent failed: %s"),
+                        bfd_errmsg (bfd_get_error ()));
              return DEBUG_TYPE_NULL;
            }
          psubaux = &auxent;
@@ -528,8 +527,8 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
 
       if (! bfd_coff_get_syment (abfd, sym, &syment))
        {
-         fprintf (stderr, _("%s: bfd_coff_get_syment failed: %s\n"),
-                  program_name, bfd_errmsg (bfd_get_error ()));
+         non_fatal (_("bfd_coff_get_syment failed: %s"),
+                    bfd_errmsg (bfd_get_error ()));
          return DEBUG_TYPE_NULL;
        }
 
@@ -709,8 +708,8 @@ parse_coff (abfd, syms, symcount, dhandle)
 
       if (! bfd_coff_get_syment (abfd, sym, &syment))
        {
-         fprintf (stderr, _("%s: bfd_coff_get_syment failed: %s\n"),
-                  program_name, bfd_errmsg (bfd_get_error ()));
+         non_fatal (_("bfd_coff_get_syment failed: %s"),
+                    bfd_errmsg (bfd_get_error ()));
          return false;
        }
 
@@ -729,8 +728,8 @@ parse_coff (abfd, syms, symcount, dhandle)
        {
          if (! bfd_coff_get_auxent (abfd, sym, 0, &auxent))
            {
-             fprintf (stderr, _("%s: bfd_coff_get_auxent failed: %s\n"),
-                      program_name, bfd_errmsg (bfd_get_error ()));
+             non_fatal (_("bfd_coff_get_auxent failed: %s"),
+                        bfd_errmsg (bfd_get_error ()));
              return false;
            }
          paux = &auxent;
@@ -795,8 +794,8 @@ parse_coff (abfd, syms, symcount, dhandle)
            {
              if (fnname == NULL)
                {
-                 fprintf (stderr, _("%s: %ld: .bf without preceding function\n"),
-                          program_name, this_coff_symno);
+                 non_fatal (_("%ld: .bf without preceding function"),
+                            this_coff_symno);
                  return false;
                }
 
@@ -845,8 +844,7 @@ parse_coff (abfd, syms, symcount, dhandle)
            {
              if (! within_function)
                {
-                 fprintf (stderr, _("%s: %ld: unexpected .ef\n"),
-                          program_name, this_coff_symno);
+                 non_fatal (_("%ld: unexpected .ef\n"), this_coff_symno);
                  return false;
                }
 
index e26056e6cfc446adeee4c99cd3486a7886b8b529..f9fae05d6691162f84dc02c0b1c63f7c37e901f3 100644 (file)
@@ -1,5 +1,5 @@
 /* rddbg.c -- Read debugging information into a generic form.
-   Copyright (C) 1995, 96, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995, 96, 97, 98, 2000 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -84,8 +84,8 @@ read_debugging_info (abfd, syms, symcount)
 
   if (! found)
     {
-      fprintf (stderr, _("%s: no recognized debugging information\n"),
-              bfd_get_filename (abfd));
+      non_fatal (_("%s: no recognized debugging information"),
+                bfd_get_filename (abfd));
       return NULL;
     }
 
@@ -159,7 +159,7 @@ read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound)
          next_stroff = 0;
          for (stab = stabs; stab < stabs + stabsize; stab += 12)
            {
-             bfd_size_type strx;
+             unsigned int strx;
              int type;
              int other;
              int desc;
index 64cf572b2d86ff789f0b65e1a6526095f23c3ab0..45161c3677db09f4a31a0e94819545779e305b0e 100644 (file)
@@ -142,9 +142,7 @@ read_coff_rsrc (filename, target)
   sec = bfd_get_section_by_name (abfd, ".rsrc");
   if (sec == NULL)
     {
-      fprintf (stderr, _("%s: %s: no resource section\n"), program_name,
-              filename);
-      xexit (1);
+      fatal (_("%s: no resource section"), filename);
     }
 
   size = bfd_section_size (abfd, sec);
index fefb8db3ca10d3cd831190cf775e927baf867576..070834b63c09da1273191354cbf35786a4fc39f1 100644 (file)
@@ -1,5 +1,5 @@
 /* size.c -- report size of various sections of an executable file.
-   Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 1999
+   Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
    Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
@@ -136,7 +136,7 @@ main (argc, argv)
            berkeley_format = 0;
            break;
          default:
-           fprintf (stderr, _("invalid argument to --format: %s\n"), optarg);
+           non_fatal (_("invalid argument to --format: %s"), optarg);
            usage (stderr, 1);
          }
        break;
@@ -163,7 +163,7 @@ main (argc, argv)
            radix = hex;
            break;
          default:
-           printf (_("Invalid radix: %s\n"), optarg);
+           non_fatal (_("Invalid radix: %s\n"), optarg);
            usage (stderr, 1);
          }
        break;
index 8b0f2b7b5ee0265af53cf20c9de4e29352a8d3f0..c317d9807fa4ceee6e891cff92f3a0a85b03c385 100644 (file)
@@ -1,5 +1,5 @@
 /* srconv.c -- Sysroff conversion program
-   Copyright (C) 1994, 95, 96, 98, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1994, 95, 96, 98, 99, 2000 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -1962,10 +1962,7 @@ main (ac, av)
            show_usage (stderr, 1);
          if (strcmp (input_file, output_file) == 0)
            {
-             fprintf (stderr,
-                      _("%s: input and output files must be different\n"),
-                      program_name);
-             exit (1);
+             fatal (_("input and output files must be different"));
            }
        }
     }
@@ -1974,9 +1971,7 @@ main (ac, av)
 
   if (!input_file)
     {
-      fprintf (stderr, _("%s: no input file specified\n"),
-              program_name);
-      exit (1);
+      fatal (_("no input file specified"));
     }
 
   if (!output_file)
@@ -2021,9 +2016,7 @@ main (ac, av)
 
   if (!file)
     {
-      fprintf (stderr, _("%s: unable to open output file %s\n"),
-              program_name, output_file);
-      exit (1);
+      fatal (_("unable to open output file %s"), output_file);
     }
 
   if (debug)
index f0e46e5e5e5f7f8c37120cca73edeb0d47d0bb8d..4d33b7996b77f174da6bb1457b80b531ef09f0bd 100644 (file)
@@ -1,6 +1,6 @@
-.\" Copyright (c) 1993 Free Software Foundation
+.\" Copyright (c) 1993, 94, 95, 2000 Free Software Foundation
 .\" See section COPYING for conditions for redistribution
-.TH strings 1 "25 June 1993" "cygnus support" "GNU Development Tools"
+.TH strings 1 "09 March 2000" "cygnus support" "GNU Development Tools"
 .de BP
 .sp
 .ti \-.2i
index 7f41c704025964af810661f7542ebc3fc7e7c461..ab845b04d42bc9a3313a55ac91c225bc4df39b00 100644 (file)
@@ -1,5 +1,6 @@
 /* strings -- print the strings of printable characters in files
-   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 99, 2000
+   Free Software Foundation, Inc.
 
    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
@@ -156,9 +157,7 @@ main (argc, argv)
          string_min = integer_arg (optarg);
          if (string_min < 1)
            {
-             fprintf (stderr, _("%s: invalid number %s\n"),
-                      program_name, optarg);
-             exit (1);
+             fatal (_("invalid number %s"), optarg);
            }
          break;
 
@@ -491,8 +490,7 @@ integer_arg (s)
 
   if (*p)
     {
-      fprintf (stderr, _("%s: invalid integer argument %s\n"), program_name, s);
-      exit (1);
+      fatal (_("invalid integer argument %s"), s);
     }
   return value;
 }
index c821e8cf457ba54c7ef0093587560b0079a0c46f..fd2a0ea3e4719c8766f310ddde3f78ef7a4b6a88 100644 (file)
@@ -1,5 +1,5 @@
 /* Sysroff object format dumper.
-   Copyright (C) 1994, 95, 98, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1994, 95, 98, 99, 2000 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -772,17 +772,13 @@ main (ac, av)
 
   if (!input_file)
     {
-      fprintf (stderr, _("%s: no input file specified\n"),
-              program_name);
-      exit (1);
+      fatal (_("no input file specified"));
     }
 
   file = fopen (input_file, FOPEN_RB);
   if (!file)
     {
-      fprintf (stderr, _("%s: cannot open input file %s\n"),
-              program_name, input_file);
-      exit (1);
+      fatal (_("cannot open input file %s"), input_file);
     }
 
   module ();
index 105593997a7d5833f4cce808be5847d91da3f512..cb893cf9837e6b5f2c15b31050ad5db802f8452a 100644 (file)
@@ -1,5 +1,5 @@
 /* version.c -- binutils version information
-   Copyright 1991, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright 1991, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
 
@@ -36,7 +36,7 @@ print_version (name)
   /* This output is intended to follow the GNU standards document.  */
   /* xgettext:c-format */
   printf ("GNU %s %s\n", name, program_version);
-  printf (_("Copyright 1997, 1998, 1999 Free Software Foundation, Inc.\n"));
+  printf (_("Copyright 1997, 98, 99, 2000 Free Software Foundation, Inc.\n"));
   printf (_("\
 This program is free software; you may redistribute it under the terms of\n\
 the GNU General Public License.  This program has absolutely no warranty.\n"));
index 5bc9bd337b375e855eced759747f136d496d1720..89f0ac2ecc2617513aeceb241981251942e8ff32 100644 (file)
@@ -1,5 +1,5 @@
 /* windres.c -- a program to manipulate Windows resources
-   Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright 1997, 98, 99, 2000 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
    This file is part of GNU Binutils.
@@ -599,7 +599,7 @@ format_from_name (name)
 
   if (m->name == NULL)
     {
-      fprintf (stderr, _("%s: unknown format type `%s'\n"), program_name, name);
+      non_fatal (_("unknown format type `%s'"), name);
       fprintf (stderr, _("%s: supported formats:"), program_name);
       for (m = format_names; m->name != NULL; m++)
        fprintf (stderr, " %s", m->name);
index 8b51587589585c7d92d03cdd1483c86d13270ac2..c74af2ee72abbc9c2be9cb55aa884e687e5c0461 100644 (file)
@@ -1,5 +1,5 @@
 /* wrstabs.c -- Output stabs debugging information
-   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 97, 98, 99, 2000 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -363,8 +363,8 @@ stab_write_symbol (info, type, desc, value, string)
       h = string_hash_lookup (&info->strhash, string, true, true);
       if (h == NULL)
        {
-         fprintf (stderr, _("string_hash_lookup failed: %s\n"),
-                  bfd_errmsg (bfd_get_error ()));
+         non_fatal (_("string_hash_lookup failed: %s"),
+                    bfd_errmsg (bfd_get_error ()));
          return false;
        }
       if (h->index != -1)
@@ -505,8 +505,8 @@ write_stabs_in_sections_debugging_info (abfd, dhandle, psyms, psymsize,
   if (! bfd_hash_table_init (&info.strhash.table, string_hash_newfunc)
       || ! bfd_hash_table_init (&info.typedef_hash.table, string_hash_newfunc))
     {
-      fprintf (stderr, "bfd_hash_table_init_failed: %s\n",
-              bfd_errmsg (bfd_get_error ()));
+      non_fatal ("bfd_hash_table_init_failed: %s",
+                bfd_errmsg (bfd_get_error ()));
       return false;
     }
 
@@ -663,7 +663,7 @@ stab_int_type (p, size, unsignedp)
 
   if (size <= 0 || (size > sizeof (long) && size != 8))
     {
-      fprintf (stderr, _("stab_int_type: bad size %u\n"), size);
+      non_fatal (_("stab_int_type: bad size %u"), size);
       return false;
     }
 
@@ -1464,9 +1464,8 @@ stab_struct_field (p, name, bitpos, bitsize, visibility)
     {
       bitsize = size * 8;
       if (bitsize == 0)
-       fprintf (stderr,
-                _("%s: warning: unknown size for field `%s' in struct\n"),
-                bfd_get_filename (info->abfd), name);
+       non_fatal (_("%s: warning: unknown size for field `%s' in struct"),
+                  bfd_get_filename (info->abfd), name);
     }
 
   sprintf (n, "%s%s:%s%s,%ld,%ld;", info->type_stack->fields, name, vis, s,
@@ -2025,8 +2024,8 @@ stab_typdef (p, name)
   h = string_hash_lookup (&info->typedef_hash, name, true, false);
   if (h == NULL)
     {
-      fprintf (stderr, _("string_hash_lookup failed: %s\n"),
-              bfd_errmsg (bfd_get_error ()));
+      non_fatal (_("string_hash_lookup failed: %s"),
+                bfd_errmsg (bfd_get_error ()));
       return false;
     }