aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2013-02-15 15:44:03 +0000
committerIan Lance Taylor <ian@airs.com>2013-02-15 15:44:03 +0000
commit214383dd76c20399a8212ec30d98b70b76490af3 (patch)
tree581c898d840628255aec03583b15a1301a8fd0b2 /gold
parent9d1df426e214b12fa6b728de55367d8621996be9 (diff)
downloadgdb-214383dd76c20399a8212ec30d98b70b76490af3.zip
gdb-214383dd76c20399a8212ec30d98b70b76490af3.tar.gz
gdb-214383dd76c20399a8212ec30d98b70b76490af3.tar.bz2
* options.h (DEFINE_uint64_alias): Define.
(class General_options): Add -Ttext-segment as an alias for -Ttext.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog6
-rw-r--r--gold/options.h29
2 files changed, 35 insertions, 0 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index c025205..e9de821 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2013-02-15 Ian Lance Taylor <iant@google.com>
+
+ * options.h (DEFINE_uint64_alias): Define.
+ (class General_options): Add -Ttext-segment as an alias for
+ -Ttext.
+
2013-02-15 Alan Modra <amodra@gmail.com>
* powerpc.cc (Stub_table::plt_off): New function, extracted from..
diff --git a/gold/options.h b/gold/options.h
index c138fa2..66fcf3e 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -498,6 +498,32 @@ struct Struct_special : public Struct_var
}; \
Struct_no_##option__ no_##option__##_initializer_
+// This is like DEFINE_uint64, but VARNAME is the name of a different
+// option. This option becomes an alias for that one.
+#define DEFINE_uint64_alias(option__, varname__, dashes__, shortname__, \
+ helpstring__, helparg__) \
+ private: \
+ struct Struct_##option__ : public options::Struct_var \
+ { \
+ Struct_##option__() \
+ : option(#option__, dashes__, shortname__, "", helpstring__, \
+ helparg__, false, this) \
+ { } \
+ \
+ void \
+ parse_to_value(const char* option_name, const char* arg, \
+ Command_line*, General_options* options) \
+ { \
+ uint64_t value; \
+ options::parse_uint64(option_name, arg, &value); \
+ options->set_##varname__(value); \
+ options->set_user_set_##varname__(); \
+ } \
+ \
+ options::One_option option; \
+ }; \
+ Struct_##option__ option__##_;
+
// This is used for non-standard flags. It defines no functions; it
// just calls General_options::parse_VARNAME whenever the flag is
// seen. We declare parse_VARNAME as a static member of
@@ -1113,6 +1139,9 @@ class General_options
N_("Set the address of the data segment"), N_("ADDRESS"));
DEFINE_uint64(Ttext, options::ONE_DASH, '\0', -1U,
N_("Set the address of the text segment"), N_("ADDRESS"));
+ DEFINE_uint64_alias(Ttext_segment, Ttext, options::ONE_DASH, '\0',
+ N_("Set the address of the text segment"),
+ N_("ADDRESS"));
DEFINE_bool(toc_optimize, options::TWO_DASHES, '\0', true,
N_("(PowerPC64 only) Optimize TOC code sequences"),