--- write_object.c.orig	2005-03-06 20:00:57.000000000 -0800
+++ write_object.c	2005-03-06 20:02:33.000000000 -0800
@@ -148,6 +148,7 @@
     char *symbol_name;
     int fd;
     unsigned long local;
+    struct stat stat_buf;
 
 #ifdef I860
 	I860_tweeks();
@@ -579,7 +580,10 @@
          */
 	if(bad_error != 0)
 	    return;
-	(void)unlink(out_file_name);
+	if(stat(out_file_name, &stat_buf) != -1){
+	  if(stat_buf.st_mode & S_IFREG)
+	    (void)unlink(out_file_name);
+	}
 	if((fd = open(out_file_name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) == -1)
 	    as_fatal("can't create output file: %s", out_file_name);
 	if(write(fd, output_addr, output_size) != (int)output_size)
