bfd/
authorJan Beulich <jbeulich@novell.com>
Wed, 2 Mar 2005 09:03:58 +0000 (09:03 +0000)
committerJan Beulich <jbeulich@novell.com>
Wed, 2 Mar 2005 09:03:58 +0000 (09:03 +0000)
2005-03-02  Jan Beulich  <jbeulich@novell.com>

* Makefile.am: Add dependency of cache.o on libiberty.h.
* cache.c: Include libiberty.h.
(bfd_open_file): Use unlink_if_ordinary instead of unlink.

binutils/
2005-03-02  Jan Beulich  <jbeulich@novell.com>

* ar.c (remove_output): Use unlink_if_ordinary instead of unlink.
* objcopy.c (copy_file): Likewise.
(strip_main): Likewise.

gas/
2005-03-02  Jan Beulich  <jbeulich@novell.com>

* as.c (main): Use unlink_if_ordinary instead of unlink.
* messages.c (as_fatal): Likewise.

ld/
2005-03-02  Jan Beulich  <jbeulich@novell.com>

* ldmain.c (remove_output): Use unlink_if_ordinary instead of unlink.
* pe-dll.c (pe_dll_generate_implib): Likewise.

13 files changed:
bfd/ChangeLog
bfd/Makefile.am
bfd/Makefile.in
bfd/cache.c
binutils/ChangeLog
binutils/ar.c
binutils/objcopy.c
gas/ChangeLog
gas/as.c
gas/messages.c
ld/ChangeLog
ld/ldmain.c
ld/pe-dll.c

index ccc3c9e9c4d5d30b3d9c251aa9987d7bc9cf0515..b84bcf0a6e30019e5927c4fb5c49ab4154590b6b 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-02  Jan Beulich  <jbeulich@novell.com>
+
+       * Makefile.am: Add dependency of cache.o on libiberty.h.
+       * cache.c: Include libiberty.h.
+       (bfd_open_file): Use unlink_if_ordinary instead of unlink.
+
 2005-03-01  Zack Weinberg  <zack@codesourcery.com>
 
        * elf.c (bfd_section_from_shdr <default case>): Call
index 18cb4ff50af712fb98653a09f3b7c801528a81f2..ae1c62f488436174d6e97c0bf0f83be15d5100bd 100644 (file)
@@ -903,7 +903,7 @@ bfd.lo: bfd.c bfdver.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   $(INCDIR)/elf/external.h
 bfdio.lo: bfdio.c $(INCDIR)/filenames.h
 bfdwin.lo: bfdwin.c $(INCDIR)/filenames.h
-cache.lo: cache.c $(INCDIR)/filenames.h
+cache.lo: cache.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h
 coffgen.lo: coffgen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \
   libcoff.h $(INCDIR)/bfdlink.h
 corefile.lo: corefile.c $(INCDIR)/filenames.h
index 7d9559770d0e33166dd59045c10630162d3a1fb6..13b836e7da0bf080411f500b3175479e8cca8522 100644 (file)
@@ -1459,7 +1459,7 @@ bfd.lo: bfd.c bfdver.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   $(INCDIR)/elf/external.h
 bfdio.lo: bfdio.c $(INCDIR)/filenames.h
 bfdwin.lo: bfdwin.c $(INCDIR)/filenames.h
-cache.lo: cache.c $(INCDIR)/filenames.h
+cache.lo: cache.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h
 coffgen.lo: coffgen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \
   libcoff.h $(INCDIR)/bfdlink.h
 corefile.lo: corefile.c $(INCDIR)/filenames.h
index 0d6529b209faef60df359535cae7646a39cc1710..1146b5b22ddd7ace108a125e076af108fb6273af 100644 (file)
@@ -41,6 +41,7 @@ SECTION
 #include "bfd.h"
 #include "sysdep.h"
 #include "libbfd.h"
+#include "libiberty.h"
 
 static bfd_boolean bfd_cache_delete (bfd *);
 
@@ -436,7 +437,7 @@ bfd_open_file (bfd *abfd)
          struct stat s;
 
          if (stat (abfd->filename, &s) == 0 && s.st_size != 0)
-           unlink (abfd->filename);
+           unlink_if_ordinary (abfd->filename);
 #endif
          abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WUB);
          abfd->opened_once = TRUE;
index 0899afccc292e517bed40afb8ff778d043149cc6..16e12d2a300153a6cbbf328bc39e29ed3084c786 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-02  Jan Beulich  <jbeulich@novell.com>
+
+       * ar.c (remove_output): Use unlink_if_ordinary instead of unlink.
+       * objcopy.c (copy_file): Likewise.
+       (strip_main): Likewise.
+
 2005-03-01  Stig Petter Olsroed  <stigpo@users.sourceforge.net>
            Nick Clifton  <nickc@redhat.com>
 
index 05933a17fb244734726f53429c99b1879b1d28a1..585b704287c21919856a1e5dce0c29fc4bda9bb5 100644 (file)
@@ -323,7 +323,7 @@ remove_output (void)
        bfd_cache_close (output_bfd);
       if (output_file != NULL)
        fclose (output_file);
-      unlink (output_filename);
+      unlink_if_ordinary (output_filename);
     }
 }
 
index d58e12e5187335a6658a88be960e2b8a3166e770..63d5a15d659f27ed680faaa117732029a3c1e3de 100644 (file)
@@ -1731,7 +1731,7 @@ copy_file (const char *input_filename, const char *output_filename,
 
       if (delete)
        {
-         unlink (output_filename);
+         unlink_if_ordinary (output_filename);
          status = 1;
        }
     }
@@ -2438,7 +2438,7 @@ strip_main (int argc, char *argv[])
          status = hold_status;
        }
       else
-       unlink (tmpname);
+       unlink_if_ordinary (tmpname);
       if (output_file == NULL)
        free (tmpname);
     }
index 759c9be61b1e044145a54cf378a2254afddb61f2..8f38437ed3f28b65a54e63a5e12e85a510cf55c1 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-02  Jan Beulich  <jbeulich@novell.com>
+
+       * as.c (main): Use unlink_if_ordinary instead of unlink.
+       * messages.c (as_fatal): Likewise.
+
 2005-03-02  Jan Beulich  <jbeulich@novell.com>
 
        * config/tc-i386.c (build_modrm_byte): Add lock prefix for cr8...15
index d16ad886aed5ee39ec1749fcba4c3d6213e26939..ad32a199a4ae09ab5d4d7fa21352633d353dabe2 100644 (file)
--- a/gas/as.c
+++ b/gas/as.c
@@ -1205,7 +1205,7 @@ main (int argc, char ** argv)
     keep_it = 0;
 
   if (!keep_it)
-    unlink (out_file_name);
+    unlink_if_ordinary (out_file_name);
 
   input_scrub_end ();
 
index 866565dee2a7a8ff888aeddea55e1bcb126476ee..39842e99547c22f95c546ee42ab0c999f9f498b7 100644 (file)
@@ -412,7 +412,7 @@ as_fatal (const char *format, ...)
   /* Delete the output file, if it exists.  This will prevent make from
      thinking that a file was created and hence does not need rebuilding.  */
   if (out_file_name != NULL)
-    unlink (out_file_name);
+    unlink_if_ordinary (out_file_name);
   xexit (EXIT_FAILURE);
 }
 #else
index 89ace4abf603d06fc4c6e3616df0b788dd7dc551..37af7e8387b8250770ea9f02259f742cda95f4a7 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-02  Jan Beulich  <jbeulich@novell.com>
+
+       * ldmain.c (remove_output): Use unlink_if_ordinary instead of unlink.
+       * pe-dll.c (pe_dll_generate_implib): Likewise.
+
 2005-02-24  Ben Elliston  <bje@au.ibm.com>
 
        * ldfile.c: Remove GNU960 conditional code.
index 4a767bc51ede7522de8fc7893814bae5d1429bab..713c590eef00f961d0bfe12e0fa49ab838ee8216 100644 (file)
@@ -173,7 +173,7 @@ remove_output (void)
       if (output_bfd)
        bfd_cache_close (output_bfd);
       if (delete_output_file_on_failure)
-       unlink (output_filename);
+       unlink_if_ordinary (output_filename);
     }
 }
 
index 3bbc5b642b975eb8f0d289d187445da1fd5185f5..81834ec4c95ecd0013ea574956e322f3a7c99c4f 100644 (file)
@@ -2225,7 +2225,7 @@ pe_dll_generate_implib (def_file *def, const char *impfilename)
     if (!ISALNUM (dll_symname[i]))
       dll_symname[i] = '_';
 
-  unlink (impfilename);
+  unlink_if_ordinary (impfilename);
 
   outarch = bfd_openw (impfilename, 0);