* gold/gold.cc (queue_initial_tasks): Move option checks ...

* gold/options.cc (General_options::finalize): ... to here. Disable
	some options; make others fatal.
This commit is contained in:
Cary Coutant 2011-09-26 23:42:06 +00:00
parent 139d7133b8
commit 403a3331af
3 changed files with 55 additions and 35 deletions

View file

@ -1224,6 +1224,37 @@ General_options::finalize()
gold_fatal(_("Options --incremental-changed, --incremental-unchanged, "
"--incremental-unknown require the use of --incremental"));
// Check for options that are not compatible with incremental linking.
// Where an option can be disabled without seriously changing the semantics
// of the link, we turn the option off; otherwise, we issue a fatal error.
if (this->incremental_mode_ != INCREMENTAL_OFF)
{
if (this->relocatable())
gold_fatal(_("incremental linking is not compatible with -r"));
if (this->emit_relocs())
gold_fatal(_("incremental linking is not compatible with "
"--emit-relocs"));
if (this->has_plugins())
gold_fatal(_("incremental linking is not compatible with --plugin"));
if (this->gc_sections())
{
gold_warning(_("ignoring --gc-sections for an incremental link"));
this->set_gc_sections(false);
}
if (this->icf_enabled())
{
gold_warning(_("ignoring --icf for an incremental link"));
this->set_icf_status(ICF_NONE);
}
if (strcmp(this->compress_debug_sections(), "none") != 0)
{
gold_warning(_("ignoring --compress-debug-sections for an "
"incremental link"));
this->set_compress_debug_sections("none");
}
}
// FIXME: we can/should be doing a lot more sanity checking here.
}