From 403a3331af14b94c59eee2f2849deb592301083c Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Mon, 26 Sep 2011 23:42:06 +0000 Subject: * gold/gold.cc (queue_initial_tasks): Move option checks ... * gold/options.cc (General_options::finalize): ... to here. Disable some options; make others fatal. --- gold/gold.cc | 55 +++++++++++++++++++------------------------------------ 1 file changed, 19 insertions(+), 36 deletions(-) (limited to 'gold/gold.cc') diff --git a/gold/gold.cc b/gold/gold.cc index 12f25b7..693ff79 100644 --- a/gold/gold.cc +++ b/gold/gold.cc @@ -197,46 +197,29 @@ queue_initial_tasks(const General_options& options, // For incremental links, the base output file. Incremental_binary* ibase = NULL; - if (parameters->incremental()) - { - if (options.relocatable()) - gold_error(_("incremental linking is incompatible with -r")); - if (options.emit_relocs()) - gold_error(_("incremental linking is incompatible with --emit-relocs")); - if (options.gc_sections()) - gold_error(_("incremental linking is incompatible with --gc-sections")); - if (options.icf_enabled()) - gold_error(_("incremental linking is incompatible with --icf")); - if (options.has_plugins()) - gold_error(_("incremental linking is incompatible with --plugin")); - if (strcmp(options.compress_debug_sections(), "none") != 0) - gold_error(_("incremental linking is incompatible with " - "--compress-debug-sections")); - - if (parameters->incremental_update()) + if (parameters->incremental_update()) + { + Output_file* of = new Output_file(options.output_file_name()); + if (of->open_base_file(options.incremental_base(), true)) { - Output_file* of = new Output_file(options.output_file_name()); - if (of->open_base_file(options.incremental_base(), true)) - { - ibase = open_incremental_binary(of); - if (ibase != NULL - && ibase->check_inputs(cmdline, layout->incremental_inputs())) - ibase->init_layout(layout); - else - { - delete ibase; - ibase = NULL; - of->close(); - } - } - if (ibase == NULL) + ibase = open_incremental_binary(of); + if (ibase != NULL + && ibase->check_inputs(cmdline, layout->incremental_inputs())) + ibase->init_layout(layout); + else { - if (set_parameters_incremental_full()) - gold_info(_("linking with --incremental-full")); - else - gold_fallback(_("restart link with --incremental-full")); + delete ibase; + ibase = NULL; + of->close(); } } + if (ibase == NULL) + { + if (set_parameters_incremental_full()) + gold_info(_("linking with --incremental-full")); + else + gold_fallback(_("restart link with --incremental-full")); + } } // Read the input files. We have to add the symbols to the symbol -- cgit v1.1