aboutsummaryrefslogtreecommitdiff
path: root/bfd/targets.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/targets.c')
-rw-r--r--bfd/targets.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/bfd/targets.c b/bfd/targets.c
index 1ada260..cc9d083 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -144,6 +144,7 @@ DESCRIPTION
.enum bfd_flavour
.{
+. {* N.B. Update bfd_flavour_name if you change this. *}
. bfd_target_unknown_flavour,
. bfd_target_aout_flavour,
. bfd_target_coff_flavour,
@@ -1829,3 +1830,50 @@ bfd_search_for_target (int (*search_func) (const bfd_target *, void *),
return NULL;
}
+
+/*
+FUNCTION
+ bfd_flavour_name
+
+SYNOPSIS
+ const char *bfd_flavour_name (enum bfd_flavour flavour);
+
+DESCRIPTION
+ Return the string form of @var{flavour}.
+*/
+
+const char *
+bfd_flavour_name (enum bfd_flavour flavour)
+{
+ switch (flavour)
+ {
+ case bfd_target_unknown_flavour: return "unknown file format";
+ case bfd_target_aout_flavour: return "a.out";
+ case bfd_target_coff_flavour: return "COFF";
+ case bfd_target_ecoff_flavour: return "ECOFF";
+ case bfd_target_xcoff_flavour: return "XCOFF";
+ case bfd_target_elf_flavour: return "ELF";
+ case bfd_target_ieee_flavour: return "IEEE";
+ case bfd_target_nlm_flavour: return "NLM";
+ case bfd_target_oasys_flavour: return "Oasys";
+ case bfd_target_tekhex_flavour: return "Tekhex";
+ case bfd_target_srec_flavour: return "Srec";
+ case bfd_target_verilog_flavour: return "Verilog";
+ case bfd_target_ihex_flavour: return "Ihex";
+ case bfd_target_som_flavour: return "SOM";
+ case bfd_target_os9k_flavour: return "OS9K";
+ case bfd_target_versados_flavour: return "Versados";
+ case bfd_target_msdos_flavour: return "MSDOS";
+ case bfd_target_ovax_flavour: return "Ovax";
+ case bfd_target_evax_flavour: return "Evax";
+ case bfd_target_mmo_flavour: return "MMO";
+ case bfd_target_mach_o_flavour: return "MACH_O";
+ case bfd_target_pef_flavour: return "PEF";
+ case bfd_target_pef_xlib_flavour: return "PEF_XLIB";
+ case bfd_target_sym_flavour: return "SYM";
+ /* There is no "default" case here so that -Wswitch (part of -Wall)
+ catches missing entries. */
+ }
+
+ abort ();
+}