Support selecting target by name.

This commit is contained in:
Ian Lance Taylor
2008-02-13 02:44:50 +00:00
parent caa9d5d919
commit 0daa6f62c8
10 changed files with 112 additions and 34 deletions

View File

@@ -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.