aboutsummaryrefslogtreecommitdiff
path: root/gold/options.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-10-10 19:30:39 +0000
committerIan Lance Taylor <iant@google.com>2007-10-10 19:30:39 +0000
commit46738c9aeb6140719e265425db002a2f887107cc (patch)
treefeb0d96531d716630a2d00ce792aae0df6020261 /gold/options.cc
parent86f26d2fc30272709d82ef42bf8e4f578418b076 (diff)
downloadgdb-46738c9aeb6140719e265425db002a2f887107cc.zip
gdb-46738c9aeb6140719e265425db002a2f887107cc.tar.gz
gdb-46738c9aeb6140719e265425db002a2f887107cc.tar.bz2
From Craig Silverstein: don't permit -s and -r.
Diffstat (limited to 'gold/options.cc')
-rw-r--r--gold/options.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/gold/options.cc b/gold/options.cc
index bd9f797..89f4ff4 100644
--- a/gold/options.cc
+++ b/gold/options.cc
@@ -654,8 +654,28 @@ Command_line::process(int argc, char** argv)
this->options_.add_to_search_path_with_sysroot("/usr/lib");
this->options_.add_sysroot();
+
+ // Ensure options don't contradict each other and are otherwise kosher.
+ this->normalize_options();
+}
+
+// Ensure options don't contradict each other and are otherwise kosher.
+
+void
+Command_line::normalize_options()
+{
+ // If the user specifies both -s and -r, convert the -s as -S.
+ // -r requires us to keep externally visible symbols!
+ if (this->options_.strip_all() && this->options_.is_relocatable())
+ {
+ // Clears the strip_all() status, replacing it with strip_debug().
+ this->options_.set_strip_debug();
+ }
+
+ // FIXME: we can/should be doing a lot more sanity checking here.
}
+
// Apply a command line option.
void