aboutsummaryrefslogtreecommitdiff
path: root/gold/gold.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/gold.cc')
-rw-r--r--gold/gold.cc21
1 files changed, 6 insertions, 15 deletions
diff --git a/gold/gold.cc b/gold/gold.cc
index a426408..1396524 100644
--- a/gold/gold.cc
+++ b/gold/gold.cc
@@ -26,6 +26,7 @@
#include <cstdio>
#include <cstring>
#include <unistd.h>
+#include "libiberty.h"
#include "options.h"
#include "workqueue.h"
@@ -46,21 +47,12 @@ const char* program_name;
void
gold_exit(bool status)
{
+ if (!status && parameters != NULL)
+ unlink_if_ordinary(parameters->output_file_name());
exit(status ? EXIT_SUCCESS : EXIT_FAILURE);
}
void
-gold_fatal(const char* msg, bool perrno)
-{
- fprintf(stderr, "%s: ", program_name);
- if (perrno)
- perror(msg);
- else
- fprintf(stderr, "%s\n", msg);
- gold_exit(false);
-}
-
-void
gold_nomem()
{
// We are out of memory, so try hard to print a reasonable message.
@@ -123,7 +115,7 @@ queue_initial_tasks(const General_options& options,
Symbol_table* symtab, Layout* layout)
{
if (cmdline.begin() == cmdline.end())
- gold_fatal(_("no input files"), false);
+ gold_fatal(_("no input files"));
// Read the input files. We have to add the symbols to the symbol
// table in order. We do this by creating a separate blocker for
@@ -166,9 +158,8 @@ queue_middle_tasks(const General_options& options,
if (!doing_static_link && options.is_static())
{
// We print out just the first .so we see; there may be others.
- fprintf(stderr, _("%s: cannot mix -static with dynamic object %s\n"),
- program_name, (*input_objects->dynobj_begin())->name().c_str());
- gold_exit(false);
+ gold_error(_("cannot mix -static with dynamic object %s"),
+ (*input_objects->dynobj_begin())->name().c_str());
}
// Define some sections and symbols needed for a dynamic link. This