aboutsummaryrefslogtreecommitdiff
path: root/gold/options.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-02-28 20:35:39 +0000
committerIan Lance Taylor <iant@google.com>2008-02-28 20:35:39 +0000
commit0dfbdef4c43cfe12bb3e2505ebe5acc651a35c98 (patch)
treefe965d8393ecdd9c81b7f29ff4ce89fdd79d92c6 /gold/options.cc
parentda769d5629564b82d4eec1b256ffc562d5c01624 (diff)
downloadgdb-0dfbdef4c43cfe12bb3e2505ebe5acc651a35c98.zip
gdb-0dfbdef4c43cfe12bb3e2505ebe5acc651a35c98.tar.gz
gdb-0dfbdef4c43cfe12bb3e2505ebe5acc651a35c98.tar.bz2
Support -d/--define-common.
Diffstat (limited to 'gold/options.cc')
-rw-r--r--gold/options.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/gold/options.cc b/gold/options.cc
index 716b133..41fa678 100644
--- a/gold/options.cc
+++ b/gold/options.cc
@@ -488,6 +488,14 @@ options::Command_line_options::options[] =
N_("--compress-debug-sections=[none" ZLIB_STR "]"),
TWO_DASHES,
&General_options::set_compress_debug_sections),
+ GENERAL_NOARG('d', "define-common", N_("Define common symbols"),
+ NULL, TWO_DASHES, &General_options::set_define_common),
+ GENERAL_NOARG('\0', "dc", NULL, NULL, ONE_DASH,
+ &General_options::set_define_common),
+ GENERAL_NOARG('\0', "dp", NULL, NULL, ONE_DASH,
+ &General_options::set_define_common),
+ GENERAL_NOARG('\0', "no-define-common", N_("Do not define common symbols"),
+ NULL, TWO_DASHES, &General_options::set_no_define_common),
SPECIAL('\0', "defsym", N_("Define a symbol"),
N_("--defsym SYMBOL=EXPRESSION"), TWO_DASHES,
&add_to_defsym),
@@ -664,7 +672,9 @@ const int options::Command_line_options::debug_options_size =
// The default values for the general options.
General_options::General_options()
- : entry_(NULL),
+ : define_common_(false),
+ user_set_define_common_(false),
+ entry_(NULL),
export_dynamic_(false),
soname_(NULL),
dynamic_linker_(NULL),
@@ -1138,6 +1148,10 @@ Command_line::normalize_options()
this->options_.set_strip_debug(true);
}
+ // Set default value for define_common.
+ if (!this->options_.user_set_define_common())
+ this->options_.set_define_common(!this->options_.relocatable());
+
// FIXME: we can/should be doing a lot more sanity checking here.
}