From 361d94e76821d32498bb1e3d3848b5bae0654ae3 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <ian@airs.com>
Date: Mon, 13 Sep 1999 23:45:47 +0000
Subject: [PATCH] 1999-09-13  Donn Terry  <donn@interix.com>

	* emultempl/pe.em: Remove the output file at the start, in case it
	is not writable.
---
 ld/ChangeLog       | 5 +++++
 ld/emultempl/pe.em | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index c1b479a86fd..e9a44744358 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+1999-09-13  Donn Terry  <donn@interix.com>
+
+	* emultempl/pe.em: Remove the output file at the start, in case it
+	is not writable.
+
 Mon Sep 13 00:17:18 1999  Jeffrey A Law  (law@cygnus.com)
 
 	* emulparms/elf64hppa.sh (OTHER_READWRITE_SECTIONS): Put .plt
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index d6a7573796e..8823e18e264 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1,6 +1,7 @@
 # This shell script emits a C file. -*- C -*-
 # It does some substitutions.
-(echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
+rm -f e${EMULATION_NAME}.c
+(echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
 cat >>e${EMULATION_NAME}.c <<EOF
 /* This file is part of GLD, the Gnu Linker.
    Copyright 1995, 96, 97, 98, 1999 Free Software Foundation, Inc.