/* Generic target-file-type support for the BFD library.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support.
. boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
-The general target vector.
+The general target vector. These vectors are initialized using the
+BFD_JUMP_TABLE macros.
.
. {* Generic entry points. *}
. PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
.
+A pointer to an alternative bfd_target in case the current one is not
+satisfactory. This can happen when the target cpu supports both big
+and little endian code, and target chosen by the linker has the wrong
+endianness. The function open_output() in ld/ldlang.c uses this field
+to find an alternative output format that is suitable.
+
+. {* Opposite endian version of this target. *}
+. const struct bfd_target * alternative_target;
+.
+
Data for use by back-end routines, which isn't generic enough to belong
in this structure.
. PTR backend_data;
+.
.} bfd_target;
*/
extern const bfd_target apollocoff_vec;
extern const bfd_target armcoff_little_vec;
extern const bfd_target armcoff_big_vec;
+extern const bfd_target armnetbsd_vec;
extern const bfd_target armpe_little_vec;
extern const bfd_target armpe_big_vec;
extern const bfd_target armpei_little_vec;
extern const bfd_target bfd_elf32_hppa_vec;
extern const bfd_target bfd_elf32_i386_vec;
extern const bfd_target bfd_elf32_i860_vec;
+extern const bfd_target bfd_elf32_i960_vec;
extern const bfd_target bfd_elf32_little_generic_vec;
extern const bfd_target bfd_elf32_littlemips_vec;
extern const bfd_target bfd_elf64_littlemips_vec;
extern const bfd_target bfd_elf32_m88k_vec;
extern const bfd_target bfd_elf32_mn10200_vec;
extern const bfd_target bfd_elf32_mn10300_vec;
+extern const bfd_target bfd_elf32_pj_vec;
+extern const bfd_target bfd_elf32_pjl_vec;
extern const bfd_target bfd_elf32_powerpc_vec;
extern const bfd_target bfd_elf32_powerpcle_vec;
extern const bfd_target bfd_elf32_sh_vec;
/* All of the xvecs for core files. */
extern const bfd_target aix386_core_vec;
-extern const bfd_target cisco_core_vec;
+extern const bfd_target cisco_core_big_vec;
+extern const bfd_target cisco_core_little_vec;
extern const bfd_target hpux_core_vec;
extern const bfd_target hppabsd_core_vec;
extern const bfd_target irix_core_vec;
&bfd_elf32_hppa_vec,
&bfd_elf32_i386_vec,
&bfd_elf32_i860_vec,
+ &bfd_elf32_i960_vec,
&bfd_elf32_little_generic_vec,
&bfd_elf32_littlearc_vec,
&bfd_elf32_littlearm_vec,
&bfd_elf32_m68k_vec,
&bfd_elf32_m88k_vec,
&bfd_elf32_sparc_vec,
+ &bfd_elf32_pj_vec,
+ &bfd_elf32_pjl_vec,
&bfd_elf32_powerpc_vec,
&bfd_elf32_powerpcle_vec,
&bfd_elf32_v850_vec,
#if 0
&bfd_elf64_sparc_vec,
#endif
- /* We don't include cisco_core_vec. Although it has a magic number,
+ /* We don't include cisco_core_*_vec. Although it has a magic number,
the magic number isn't at the beginning of the file, and thus
might spuriously match other kinds of files. */
#ifdef BFD64
&i386pei_vec,
&armcoff_little_vec,
&armcoff_big_vec,
+ &armnetbsd_vec,
&armpe_little_vec,
&armpe_big_vec,
&armpei_little_vec,
return name_list;
}
+
+/*
+FUNCTION
+ bfd_seach_for_target
+
+SYNOPSIS
+ const bfd_target * bfd_search_for_target (int (* search_func)(const bfd_target *, void *), void *);
+
+DESCRIPTION
+ Return a pointer to the first transfer vector in the list of
+ transfer vectors maintained by BFD that produces a non-zero
+ result when passed to the function @var{search_func}. The
+ parameter @var{data} is passed, unexamined, to the search
+ function.
+*/
+
+const bfd_target *
+bfd_search_for_target (search_func, data)
+ int (* search_func) PARAMS ((const bfd_target * target, void * data));
+ void * data;
+{
+ const bfd_target * const * target;
+
+ for (target = bfd_target_vector; * target != NULL; target ++)
+ if (search_func (* target, data))
+ return * target;
+
+ return NULL;
+}