From bb14f524002c5b0e93c17e929109f4c735f11f5b Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 2 Mar 2005 09:03:58 +0000 Subject: [PATCH] bfd/ 2005-03-02 Jan Beulich * 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 * 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 * as.c (main): Use unlink_if_ordinary instead of unlink. * messages.c (as_fatal): Likewise. ld/ 2005-03-02 Jan Beulich * ldmain.c (remove_output): Use unlink_if_ordinary instead of unlink. * pe-dll.c (pe_dll_generate_implib): Likewise. --- bfd/ChangeLog | 6 ++++++ bfd/Makefile.am | 2 +- bfd/Makefile.in | 2 +- bfd/cache.c | 3 ++- binutils/ChangeLog | 6 ++++++ binutils/ar.c | 2 +- binutils/objcopy.c | 4 ++-- gas/ChangeLog | 5 +++++ gas/as.c | 2 +- gas/messages.c | 2 +- ld/ChangeLog | 5 +++++ ld/ldmain.c | 2 +- ld/pe-dll.c | 2 +- 13 files changed, 33 insertions(+), 10 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ccc3c9e9c4d..b84bcf0a6e3 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2005-03-02 Jan Beulich + + * 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 * elf.c (bfd_section_from_shdr ): Call diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 18cb4ff50af..ae1c62f4884 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -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 diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 7d9559770d0..13b836e7da0 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -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 diff --git a/bfd/cache.c b/bfd/cache.c index 0d6529b209f..1146b5b22dd 100644 --- a/bfd/cache.c +++ b/bfd/cache.c @@ -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; diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 0899afccc29..16e12d2a300 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2005-03-02 Jan Beulich + + * 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 Nick Clifton diff --git a/binutils/ar.c b/binutils/ar.c index 05933a17fb2..585b704287c 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -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); } } diff --git a/binutils/objcopy.c b/binutils/objcopy.c index d58e12e5187..63d5a15d659 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -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); } diff --git a/gas/ChangeLog b/gas/ChangeLog index 759c9be61b1..8f38437ed3f 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2005-03-02 Jan Beulich + + * as.c (main): Use unlink_if_ordinary instead of unlink. + * messages.c (as_fatal): Likewise. + 2005-03-02 Jan Beulich * config/tc-i386.c (build_modrm_byte): Add lock prefix for cr8...15 diff --git a/gas/as.c b/gas/as.c index d16ad886aed..ad32a199a4a 100644 --- 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 (); diff --git a/gas/messages.c b/gas/messages.c index 866565dee2a..39842e99547 100644 --- a/gas/messages.c +++ b/gas/messages.c @@ -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 diff --git a/ld/ChangeLog b/ld/ChangeLog index 89ace4abf60..37af7e8387b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2005-03-02 Jan Beulich + + * ldmain.c (remove_output): Use unlink_if_ordinary instead of unlink. + * pe-dll.c (pe_dll_generate_implib): Likewise. + 2005-02-24 Ben Elliston * ldfile.c: Remove GNU960 conditional code. diff --git a/ld/ldmain.c b/ld/ldmain.c index 4a767bc51ed..713c590eef0 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -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); } } diff --git a/ld/pe-dll.c b/ld/pe-dll.c index 3bbc5b642b9..81834ec4c95 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -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); -- 2.30.2