aboutsummaryrefslogtreecommitdiff
path: root/gold/options.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2011-09-26 23:42:06 +0000
committerCary Coutant <ccoutant@google.com>2011-09-26 23:42:06 +0000
commit403a3331af14b94c59eee2f2849deb592301083c (patch)
tree3a63c388e40383df07481d7282a51e926f19136a /gold/options.cc
parent139d7133b8c8fa9af2b78ccab99c15687d08be9a (diff)
downloadgdb-403a3331af14b94c59eee2f2849deb592301083c.zip
gdb-403a3331af14b94c59eee2f2849deb592301083c.tar.gz
gdb-403a3331af14b94c59eee2f2849deb592301083c.tar.bz2
* gold/gold.cc (queue_initial_tasks): Move option checks ...
* gold/options.cc (General_options::finalize): ... to here. Disable some options; make others fatal.
Diffstat (limited to 'gold/options.cc')
-rw-r--r--gold/options.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/gold/options.cc b/gold/options.cc
index be32645..d91a834 100644
--- a/gold/options.cc
+++ b/gold/options.cc
@@ -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.
}