aboutsummaryrefslogtreecommitdiff
path: root/gold/gold.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2011-06-08 04:43:28 +0000
committerCary Coutant <ccoutant@google.com>2011-06-08 04:43:28 +0000
commite6455dfbc2dae8cc91f64b4120e87e138970cf84 (patch)
treeae3c3f5e8ee74a9e4ea1951152ffa055096758b6 /gold/gold.cc
parentfb0e076f5c3d8bfd1f23a96031bfbfb92dc657d2 (diff)
downloadgdb-e6455dfbc2dae8cc91f64b4120e87e138970cf84.zip
gdb-e6455dfbc2dae8cc91f64b4120e87e138970cf84.tar.gz
gdb-e6455dfbc2dae8cc91f64b4120e87e138970cf84.tar.bz2
* common.cc (Symbol_table::do_allocate_commons_list): Call
gold_fallback. * errors.cc (Errors::fatal): Adjust call to gold_exit. (Errors::fallback): New function. (gold_fallback): New function. * errors.h (Errors::fallback): New function. * gold.cc (gold_exit): Change status parameter to enum; adjust all callers. (queue_initial_tasks): Call gold_fallback. * gold.h: Include cstdlib. (Exit_status): New enum type. (gold_exit): Change status parameter to enum. (gold_fallback): New function. * layout.cc (Layout::set_section_offsets): Call gold_fallback. (Layout::create_symtab_sections): Likewise. (Layout::create_shdrs): Likewise. * main.cc (main): Adjust call to gold_exit. * output.cc (Output_data_got::add_got_entry): Call gold_fallback. (Output_data_got::add_got_entry_pair): Likewise. (Output_section::add_input_section): Likewise. (Output_section::add_output_section_data): Likewise. (Output_segment::set_section_list_addresses): Likewise. * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
Diffstat (limited to 'gold/gold.cc')
-rw-r--r--gold/gold.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/gold/gold.cc b/gold/gold.cc
index 0b901bb..95c226c 100644
--- a/gold/gold.cc
+++ b/gold/gold.cc
@@ -58,15 +58,15 @@ process_incremental_input(Incremental_binary*, unsigned int, Input_objects*,
Task_token*, Task_token*);
void
-gold_exit(bool status)
+gold_exit(Exit_status status)
{
if (parameters != NULL
&& parameters->options_valid()
&& parameters->options().has_plugins())
parameters->options().plugins()->cleanup();
- if (!status && parameters != NULL && parameters->options_valid())
+ if (status != GOLD_OK && parameters != NULL && parameters->options_valid())
unlink_if_ordinary(parameters->options().output_file_name());
- exit(status ? EXIT_SUCCESS : EXIT_FAILURE);
+ exit(status);
}
void
@@ -87,7 +87,7 @@ gold_nomem()
const char* const s = ": out of memory\n";
len = write(2, s, strlen(s));
}
- gold_exit(false);
+ gold_exit(GOLD_ERR);
}
// Handle an unreachable case.
@@ -97,7 +97,7 @@ do_gold_unreachable(const char* filename, int lineno, const char* function)
{
fprintf(stderr, _("%s: internal error in %s, at %s:%d\n"),
program_name, function, filename, lineno);
- gold_exit(false);
+ gold_exit(GOLD_ERR);
}
// This class arranges to run the functions done in the middle of the
@@ -176,7 +176,7 @@ queue_initial_tasks(const General_options& options,
if (cmdline.begin() == cmdline.end())
{
if (options.printed_version())
- gold_exit(true);
+ gold_exit(GOLD_OK);
gold_fatal(_("no input files"));
}
@@ -222,7 +222,7 @@ queue_initial_tasks(const General_options& options,
if (set_parameters_incremental_full())
gold_info(_("linking with --incremental-full"));
else
- gold_fatal(_("restart link with --incremental-full"));
+ gold_fallback(_("restart link with --incremental-full"));
}
}
}
@@ -748,7 +748,7 @@ queue_middle_tasks(const General_options& options,
// THIS_BLOCKER to be NULL here. There's no real point in
// continuing if that happens.
gold_assert(parameters->errors()->error_count() > 0);
- gold_exit(false);
+ gold_exit(GOLD_ERR);
}
}