diff options
author | Ian Lance Taylor <ian@airs.com> | 2008-03-25 21:39:01 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2008-03-25 21:39:01 +0000 |
commit | e96caa791095788fe6b3cbbdc54547278ca70db7 (patch) | |
tree | eb8a097a06011ca8cd7e47ef21a458afb4ec07e5 /gold/x86_64.cc | |
parent | 874c5b289fe4dbacaf9679fb8331c6b7e39ea269 (diff) | |
download | gdb-e96caa791095788fe6b3cbbdc54547278ca70db7.zip gdb-e96caa791095788fe6b3cbbdc54547278ca70db7.tar.gz gdb-e96caa791095788fe6b3cbbdc54547278ca70db7.tar.bz2 |
* options.cc (options::help): Print list of supported targets.
* target-select.h: Include <vector>.
(class Target_selector): Make machine_, size_, and is_big_endian_
fields const. Add bfd_name_ and instantiated_target_ fields.
(Target_selector::Target_selector): Add bfd_name parameter.
(Target_selector::recognize): Make non-virtual, call
do_recognize.
(Target_selector::recognize_by_name): Make non-virtual, call
do_recognize_by_name.
(Target_selector::supported_names): New function.
(Target_selector::bfd_name): New function.
(Target_selector::do_instantiate_target): New pure virtual
function.
(Target_selector::do_recognize): New virtual function.
(Target_selector::do_recognize_by_name): New virtual function.
(Target_selector::instantiate_target): New private function.
(supported_target_names): Declare.
* target-select.cc (Target_selector::Target_selector): Update for
new parameter and fields.
(select_target_by_name): Check that the name matches before
calling recognize_by_name.
(supported_target_names): New function.
* i386.cc (class Target_selector_i386): Update Target_selector
constructor call. Remove recognize and recognize_by_name. Add
do_instantiate_target.
* x86_64.cc (class Target_selector_x86_64): Likewise.
* testsuite/testfile.cc (class Target_selector_test): Update for
changes to Target_selector.
Diffstat (limited to 'gold/x86_64.cc')
-rw-r--r-- | gold/x86_64.cc | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/gold/x86_64.cc b/gold/x86_64.cc index 72c0779..26f7348 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -2219,40 +2219,14 @@ class Target_selector_x86_64 : public Target_selector { public: Target_selector_x86_64() - : Target_selector(elfcpp::EM_X86_64, 64, false) + : Target_selector(elfcpp::EM_X86_64, 64, false, "elf64-x86-64") { } Target* - recognize(int machine, int osabi, int abiversion); - - Target* - recognize_by_name(const char*); - - private: - Target_x86_64* target_; + do_instantiate_target() + { return new Target_x86_64(); } }; -// Recognize an x86_64 object file when we already know that the machine -// number is EM_X86_64. - -Target* -Target_selector_x86_64::recognize(int, int, int) -{ - if (this->target_ == NULL) - this->target_ = new Target_x86_64(); - return this->target_; -} - -Target* -Target_selector_x86_64::recognize_by_name(const char* name) -{ - if (strcmp(name, "elf64-x86-64") != 0) - return NULL; - if (this->target_ == NULL) - this->target_ = new Target_x86_64(); - return this->target_; -} - Target_selector_x86_64 target_selector_x86_64; } // End anonymous namespace. |