diff options
author | Cary Coutant <ccoutant@google.com> | 2011-06-08 04:43:28 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2011-06-08 04:43:28 +0000 |
commit | e6455dfbc2dae8cc91f64b4120e87e138970cf84 (patch) | |
tree | ae3c3f5e8ee74a9e4ea1951152ffa055096758b6 /gold/gold.h | |
parent | fb0e076f5c3d8bfd1f23a96031bfbfb92dc657d2 (diff) | |
download | gdb-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.h')
-rw-r--r-- | gold/gold.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gold/gold.h b/gold/gold.h index 133a64e..88fc4de 100644 --- a/gold/gold.h +++ b/gold/gold.h @@ -27,6 +27,7 @@ #include "ansidecl.h" #include <cstddef> +#include <cstdlib> #include <cstring> #include <stdint.h> #include <sys/types.h> @@ -166,6 +167,15 @@ class Output_file; template<int size, bool big_endian> struct Relocate_info; +// Exit status codes. + +enum Exit_status +{ + GOLD_OK = EXIT_SUCCESS, + GOLD_ERR = EXIT_FAILURE, + GOLD_FALLBACK = EXIT_FAILURE + 1 +}; + // Some basic types. For these we use lower case initial letters. // For an offset in an input or output file, use off_t. Note that @@ -183,7 +193,7 @@ extern const char* program_name; // This function is called to exit the program. Status is true to // exit success (0) and false to exit failure (1). extern void -gold_exit(bool status) ATTRIBUTE_NORETURN; +gold_exit(Exit_status status) ATTRIBUTE_NORETURN; // This function is called to emit an error message and then // immediately exit with failure. @@ -203,6 +213,13 @@ gold_warning(const char* msg, ...) ATTRIBUTE_PRINTF_1; extern void gold_info(const char* msg, ...) ATTRIBUTE_PRINTF_1; +// This function is called to emit an error message and then +// immediately exit with fallback status (e.g., when +// --incremental-update fails and the link needs to be restarted +// with --incremental-full). +extern void +gold_fallback(const char* format, ...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1; + // Work around a bug in gcc 4.3.0. http://gcc.gnu.org/PR35546 . This // can probably be removed after the bug has been fixed for a while. #ifdef HAVE_TEMPLATE_ATTRIBUTES |