Don't try to delete the output file if we don't know its name yet.

This commit is contained in:
Ian Lance Taylor 2007-11-28 19:39:40 +00:00
parent ef04e3921e
commit 2d6840917d
2 changed files with 7 additions and 1 deletions

View File

@ -47,7 +47,7 @@ const char* program_name;
void
gold_exit(bool status)
{
if (!status && parameters != NULL)
if (!status && parameters != NULL && parameters->options_valid())
unlink_if_ordinary(parameters->output_file_name());
exit(status ? EXIT_SUCCESS : EXIT_FAILURE);
}

View File

@ -47,6 +47,12 @@ class Parameters
errors() const
{ return this->errors_; }
// Whether the options are valid. This should not normally be
// called, but it is needed by gold_exit.
bool
options_valid() const
{ return this->options_valid_; }
// Whether to use threads.
bool
threads() const