aboutsummaryrefslogtreecommitdiff
path: root/gold/target-select.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-02-13 02:44:50 +0000
committerIan Lance Taylor <iant@google.com>2008-02-13 02:44:50 +0000
commit0daa6f62c88fe4d1dd680b09e855c4b8b7811403 (patch)
treef1d3948b1a9e9c87fa20dbac6b2437bcd81a3bf0 /gold/target-select.cc
parentcaa9d5d9191af934ff7949fea080d72524c92cfa (diff)
downloadgdb-0daa6f62c88fe4d1dd680b09e855c4b8b7811403.zip
gdb-0daa6f62c88fe4d1dd680b09e855c4b8b7811403.tar.gz
gdb-0daa6f62c88fe4d1dd680b09e855c4b8b7811403.tar.bz2
Support selecting target by name.
Diffstat (limited to 'gold/target-select.cc')
-rw-r--r--gold/target-select.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/gold/target-select.cc b/gold/target-select.cc
index 0cfa02b..fdf7b89 100644
--- a/gold/target-select.cc
+++ b/gold/target-select.cc
@@ -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.