readelf: Consolidate --syms --use-dynamic with --dyn-syms
[deliverable/binutils-gdb.git] / binutils / windres.c
index 64afb3ad6a5fcd48d0637fd733c5460ce5b165b5..9b921ba2bc654258543fc1a5d748a9fa95fdf12f 100644 (file)
@@ -1,5 +1,5 @@
 /* windres.c -- a program to manipulate Windows resources
-   Copyright 1997-2013 Free Software Foundation, Inc.
+   Copyright (C) 1997-2020 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
    Rewritten by Kai Tietz, Onevision.
 
@@ -204,6 +204,7 @@ open_file_search (const char *filename, const char *mode, const char *errmsg,
              *real_filename = n;
              return e;
            }
+         free (n);
 
          if (errno != ENOENT)
            break;
@@ -807,10 +808,12 @@ main (int argc, char **argv)
 
   program_name = argv[0];
   xmalloc_set_program_name (program_name);
+  bfd_set_error_program_name (program_name);
 
   expandargv (&argc, &argv);
 
-  bfd_init ();
+  if (bfd_init () != BFD_INIT_MAGIC)
+    fatal (_("fatal error: libbfd ABI mismatch"));
   set_default_bfd_target ();
 
   res_init ();
@@ -937,7 +940,7 @@ main (int argc, char **argv)
            {
              struct stat statbuf;
              char modebuf[11];
-             
+
              if (stat (optarg, & statbuf) == 0
                  /* Coded this way to avoid importing knowledge of S_ISDIR into this file.  */
                  && (mode_string (statbuf.st_mode, modebuf), modebuf[0] == 'd'))
@@ -1114,7 +1117,7 @@ windres_open_as_binary (const char *filename, int rdmode)
 
   if (rdmode && ! bfd_check_format (abfd, bfd_object))
     fatal ("can't open `%s' for input.", filename);
-  
+
   return abfd;
 }
 
@@ -1309,7 +1312,7 @@ static rc_uint_type
 target_get_8 (const void *p, rc_uint_type length)
 {
   rc_uint_type ret;
-  
+
   if (length < 1)
     fatal ("Resource too small for getting 8-bit value.");
 
@@ -1322,7 +1325,7 @@ target_get_16 (const void *p, rc_uint_type length)
 {
   if (length < 2)
     fatal ("Resource too small for getting 16-bit value.");
-  
+
   if (target_is_bigendian)
     return bfd_getb16 (p);
   else
@@ -1334,7 +1337,7 @@ target_get_32 (const void *p, rc_uint_type length)
 {
   if (length < 4)
     fatal ("Resource too small for getting 32-bit value.");
-  
+
   if (target_is_bigendian)
     return bfd_getb32 (p);
   else
@@ -1352,7 +1355,7 @@ static void
 target_put_16 (void *p, rc_uint_type value)
 {
   assert (!! p);
-  
+
   if (target_is_bigendian)
     bfd_putb16 (value, p);
   else
@@ -1363,7 +1366,7 @@ static void
 target_put_32 (void *p, rc_uint_type value)
 {
   assert (!! p);
-  
+
   if (target_is_bigendian)
     bfd_putb32 (value, p);
   else
@@ -1402,5 +1405,5 @@ int wr_print (FILE *e, const char *fmt, ...)
   va_start (arg, fmt);
   r += vfprintf (e, fmt, arg);
   va_end (arg);
-  return r;    
+  return r;
 }
This page took 0.107107 seconds and 4 git commands to generate.