daily update
[deliverable/binutils-gdb.git] / gold / target-select.cc
index 0cfa02bc6add1996f01ec019c525f9ba3b198108..8a7570807891a699dacf2071d30ec753dd4eb410 100644 (file)
@@ -1,6 +1,6 @@
 // target-select.cc -- select a target for an object file
 
-// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -50,7 +50,7 @@ Target_selector::Target_selector(int machine, int size, bool is_big_endian)
 
 // Find the target for an ELF file.
 
-extern Target*
+Target*
 select_target(int machine, int size, bool is_big_endian, int osabi,
              int abiversion)
 {
@@ -69,4 +69,19 @@ select_target(int machine, int size, bool is_big_endian, int osabi,
   return NULL;
 }
 
+// Find a target using a BFD name.  This is used to support the
+// --oformat option.
+
+Target*
+select_target_by_name(const char* name)
+{
+  for (Target_selector* p = target_selectors; p != NULL; p = p->next())
+    {
+      Target* ret = p->recognize_by_name(name);
+      if (ret != NULL)
+       return ret;
+    }
+  return NULL;
+}
+
 } // End namespace gold.
This page took 0.022878 seconds and 4 git commands to generate.