# HG changeset patch # User lost # Date 1236303340 0 # Node ID 833d392fec82ffbbdf59b965530d54a94470b4aa # Parent 14878196ed5ba6c8cae340514ff41fcbbd7d67c9 Arranged for lwasm and lwlink to remove the output file in case they fail diff -r 14878196ed5b -r 833d392fec82 ChangeLog --- a/ChangeLog Thu Mar 05 02:23:47 2009 +0000 +++ b/ChangeLog Fri Mar 06 01:35:40 2009 +0000 @@ -15,6 +15,8 @@ [*] added library search path (-L) and library specification (-l) to LWLINK [*] added ability to specify section base addresses on the command line to LWLINK (they get prepended to the built in link script) +[b] arranged for output files for lwasm/lwlink to be removed if the assembly + or linking fails Version 2.2 diff -r 14878196ed5b -r 833d392fec82 lwasm/main.c --- a/lwasm/main.c Thu Mar 05 02:23:47 2009 +0000 +++ b/lwasm/main.c Fri Mar 06 01:35:40 2009 +0000 @@ -30,6 +30,7 @@ #include #include #include +#include #include "lwasm.h" @@ -176,6 +177,9 @@ exit(1); } + // lose the output file if it already exists... + unlink(asmstate.outfile); + /* pass 1 - collect the symbols and assign addresses where possible */ /* pass 1 also resolves included files, etc. */ /* that means files are read exactly once unless included multiple times */ diff -r 14878196ed5b -r 833d392fec82 lwlink/main.c --- a/lwlink/main.c Thu Mar 05 02:23:47 2009 +0000 +++ b/lwlink/main.c Fri Mar 06 01:35:40 2009 +0000 @@ -30,6 +30,7 @@ #include #include #include +#include #include "lwlink.h" @@ -154,6 +155,8 @@ exit(1); } + unlink(outfile); + // handle the linker script setup_script();