From a32fb31982d6ef1f93cbe1b9da82e4766f902b2a Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 15 Jan 2001 22:53:58 +0000 Subject: [PATCH] Delete output file upon fatal errors. Treat multiple defintions of the same symbol as ordinary errors, not fatal ones --- gas/ChangeLog | 9 +++++++++ gas/messages.c | 4 ++++ gas/symbols.c | 8 ++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index bed841e14f..1116016710 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +2001-01-15 Nick Clifton + + * symbols.c (colon): Change 'already defined symbol' from a + fatal error to an ordinary error. There is no reason why this + error should be fatal. + + * message.c (as_fatal): Delete output file, if one has been + created. + 2001-01-14 Alan Modra * config/tc-hppa.h (TARGET_FORMAT): Add hppa-linux variants. diff --git a/gas/messages.c b/gas/messages.c index 7af8de69f5..1abfb3ac3b 100644 --- a/gas/messages.c +++ b/gas/messages.c @@ -414,6 +414,10 @@ as_fatal (const char *format, ...) vfprintf (stderr, format, args); (void) putc ('\n', stderr); va_end (args); + /* 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); xexit (EXIT_FAILURE); } #else diff --git a/gas/symbols.c b/gas/symbols.c index a338df079a..a9bd222ea4 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -439,7 +439,7 @@ colon (sym_name) /* Just seen "x:" - rattle symbols & frags. */ S_GET_OTHER (symbolP), S_GET_DESC (symbolP)); #endif - as_fatal (_("Symbol \"%s\" is already defined as \"%s\"/%s%ld."), + as_bad (_("Symbol \"%s\" is already defined as \"%s\"/%s%ld."), sym_name, segment_name (S_GET_SEGMENT (symbolP)), od_buf, @@ -453,8 +453,8 @@ colon (sym_name) /* Just seen "x:" - rattle symbols & frags. */ if (!(frag_now == symbolP->sy_frag && S_GET_VALUE (symbolP) == frag_now_fix () && S_GET_SEGMENT (symbolP) == now_seg)) - as_fatal (_("Symbol %s already defined."), sym_name); - } /* if this symbol is not yet defined */ + as_bad (_("Symbol %s already defined."), sym_name); + } } #ifdef BFD_ASSEMBLER @@ -474,7 +474,7 @@ colon (sym_name) /* Just seen "x:" - rattle symbols & frags. */ #endif /* OBJ_VMS */ symbol_table_insert (symbolP); - } /* if we have seen this symbol before */ + } if (mri_common_symbol != NULL) { -- 2.11.0