From 0daa6f62c88fe4d1dd680b09e855c4b8b7811403 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 13 Feb 2008 02:44:50 +0000 Subject: Support selecting target by name. --- gold/i386.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gold/i386.cc') diff --git a/gold/i386.cc b/gold/i386.cc index 2d8efdd..8bd3f32 100644 --- a/gold/i386.cc +++ b/gold/i386.cc @@ -2433,6 +2433,9 @@ public: Target* recognize(int machine, int osabi, int abiversion); + Target* + recognize_by_name(const char* name); + private: Target_i386* target_; }; @@ -2448,6 +2451,16 @@ Target_selector_i386::recognize(int, int, int) return this->target_; } +Target* +Target_selector_i386::recognize_by_name(const char* name) +{ + if (strcmp(name, "elf32-i386") != 0) + return NULL; + if (this->target_ == NULL) + this->target_ = new Target_i386(); + return this->target_; +} + Target_selector_i386 target_selector_i386; } // End anonymous namespace. -- cgit v1.1