diff options
author | Ian Lance Taylor <ian@airs.com> | 2008-04-09 00:48:13 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2008-04-09 00:48:13 +0000 |
commit | 0864d55193d9ad757c26cba29da1de1c00be4ba8 (patch) | |
tree | bd0b661d221890ae9c1e7211dd2a861f5140f2a7 /gold/options.h | |
parent | 789aa6de31480d7b322e515b43451b1b1108fedc (diff) | |
download | ppe42-binutils-0864d55193d9ad757c26cba29da1de1c00be4ba8.tar.gz ppe42-binutils-0864d55193d9ad757c26cba29da1de1c00be4ba8.zip |
* options.h (class General_options): Define --wrap as a special
option. Add wrap_symbols_ field.
(General_options::any_wrap_symbols): New function.
(General_options::is_wrap_symbol): New function.
* options.cc (General_options::parse_wrap): New function.
(General_options::General_options): Initialize wrap_symbols_.
* symtab.cc (Symbol_table::wrap_symbol): New function.
(Symbol_table::add_from_object): Handle --wrap.
* symtab.h (class Symbol_table): Declare wrap_symbol.
* target.h (Target::wrap_char): New function.
(Target::Target_info): Add wrap_char field.
* i386.cc (Target_i386::i386_info): Initialize wrap_char.
* x86_64.cc (Target_x86_64::x86_64_info): Likewise.
* testsuite/testfile.cc (Target_test::test_target_info):
Likewise.
Diffstat (limited to 'gold/options.h')
-rw-r--r-- | gold/options.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gold/options.h b/gold/options.h index b95a70524a..487603fa87 100644 --- a/gold/options.h +++ b/gold/options.h @@ -620,6 +620,9 @@ class General_options N_("Include all archive contents"), N_("Include only needed archive contents")); + DEFINE_special(wrap, options::TWO_DASHES, '\0', + N_("Use wrapper functions for SYMBOL"), N_("SYMBOL")); + DEFINE_special(start_group, options::TWO_DASHES, '(', N_("Start a library search group"), NULL); DEFINE_special(end_group, options::TWO_DASHES, ')', @@ -702,6 +705,19 @@ class General_options do_demangle() const { return this->do_demangle_; } + // Whether there are any symbols to wrap. + bool + any_wrap_symbols() const + { return !this->wrap_symbols_.empty(); } + + // Whether to wrap SYMBOL. + bool + is_wrap_symbol(const char* symbol) const + { + return (this->wrap_symbols_.find(std::string(symbol)) + != this->wrap_symbols_.end()); + } + private: // Don't copy this structure. General_options(const General_options&); @@ -745,6 +761,8 @@ class General_options bool static_; // Whether to do demangling. bool do_demangle_; + // List of symbols used with --wrap. + Unordered_set<std::string> wrap_symbols_; }; // The position-dependent options. We use this to store the state of |