targets.c

来自「基于4个mips核的noc设计」· C语言 代码 · 共 1,201 行 · 第 1/3 页

C
1,201
字号
	&h8300coff_vec,	&h8500coff_vec,#if 0	/* Since a.out files lack decent magic numbers, no way to recognize	   which kind of a.out file it is.  */	&host_aout_vec,#endif#if 0				/* Clashes with sunos_big_vec magic no.  */	&hp300bsd_vec,#endif	&hp300hpux_vec,#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF)        &som_vec,#endif	&i386aout_vec,	&i386bsd_vec,	&i386coff_vec,	&i386freebsd_vec,	&i860coff_vec,	&bfd_powerpc_pe_vec,	&bfd_powerpcle_pe_vec,	&bfd_powerpc_pei_vec,	&bfd_powerpcle_pei_vec,	&go32coff_vec,	&go32stubbedcoff_vec,#if 0	/* Since a.out files lack decent magic numbers, no way to recognize	   which kind of a.out file it is.  */	&i386linux_vec,#endif	&i386lynx_aout_vec,	&i386lynx_coff_vec,#if 0	/* No distinguishing features for Mach 3 executables.  */	&i386mach3_vec,#endif	&i386msdos_vec,	&i386netbsd_vec,	&i386os9k_vec,	&i386pe_vec,	&i386pei_vec,	&armcoff_little_vec,	&armcoff_big_vec,	&armnetbsd_vec,	&armpe_little_vec,	&armpe_big_vec,	&armpei_little_vec,	&armpei_big_vec,	&arm_epoc_pe_little_vec,	&arm_epoc_pe_big_vec,	&arm_epoc_pei_little_vec,	&arm_epoc_pei_big_vec,	&icoff_big_vec,	&icoff_little_vec,	&ieee_vec,	&m68kcoff_vec,	&m68kcoffun_vec,#if 0	/* Since a.out files lack decent magic numbers, no way to recognize	   which kind of a.out file it is.  */	&m68klinux_vec,#endif	&m68klynx_aout_vec,	&m68klynx_coff_vec,	&m68knetbsd_vec,	&m68ksysvcoff_vec,	&m88kbcs_vec,	&m88kmach3_vec,	&mcore_pe_big_vec,	&mcore_pe_little_vec,	&mcore_pei_big_vec,	&mcore_pei_little_vec,	&newsos3_vec,	&nlm32_i386_vec,	&nlm32_sparc_vec,#ifdef BFD64	&nlm32_alpha_vec,#endif	&pc532netbsd_vec,#if 0	/* We have no oasys tools anymore, so we can't test any of this	   anymore. If you want to test the stuff yourself, go ahead...	   steve@cygnus.com	   Worse, since there is no magic number for archives, there	   can be annoying target mis-matches.  */	&oasys_vec,#endif	&pc532machaout_vec,#if 0	/* We have no way of distinguishing these from other a.out variants */	&aout_arm_big_vec,	&aout_arm_little_vec,	&riscix_vec,#endif#if 0	/* This has the same magic number as RS/6000.  */	&pmac_xcoff_vec,#endif	&rs6000coff_vec,#ifdef BFD64	&rs6000coff64_vec,#endif	&ppcboot_vec,	&shcoff_vec,	&shlcoff_vec,	&shcoff_small_vec,	&shlcoff_small_vec,	&sparcle_aout_vec,	&sparclinux_vec,	&sparclynx_aout_vec,	&sparclynx_coff_vec,	&sparcnetbsd_vec,	&sunos_big_vec,	&aout0_big_vec,	&tic30_aout_vec,	&tic30_coff_vec,	&tic54x_coff0_vec,	&tic54x_coff0_beh_vec,	&tic54x_coff1_vec,	&tic54x_coff1_beh_vec,	&tic54x_coff2_vec,	&tic54x_coff2_beh_vec,	&tic80coff_vec,	&vaxnetbsd_vec,	&versados_vec,#ifdef BFD64	&vms_alpha_vec,#endif	&vms_vax_vec,	&we32kcoff_vec,	&z8kcoff_vec,#endif /* not SELECT_VECS *//* Always support S-records, for convenience.  */	&srec_vec,	&symbolsrec_vec,/* And tekhex */	&tekhex_vec,/* Likewise for binary output.  */	&binary_vec,/* Likewise for ihex.  */	&ihex_vec,/* Add any required traditional-core-file-handler.  */#ifdef AIX386_CORE	&aix386_core_vec,#endif#ifdef HPUX_CORE	&hpux_core_vec,#endif#ifdef HPPABSD_CORE	&hppabsd_core_vec,#endif#ifdef IRIX_CORE	&irix_core_vec,#endif#ifdef NETBSD_CORE	&netbsd_core_vec,#endif#ifdef OSF_CORE	&osf_core_vec,#endif#ifdef SCO5_CORE	&sco5_core_vec,#endif#ifdef	TRAD_CORE	&trad_core_vec,#endif#ifdef	PTRACE_CORE	&ptrace_core_vec,#endif	NULL /* end of list marker */};const bfd_target * const *bfd_target_vector = _bfd_target_vector;/* bfd_default_vector[0] contains either the address of the default vector,   if there is one, or zero if there isn't.  */const bfd_target *bfd_default_vector[] = {#ifdef DEFAULT_VECTOR	&DEFAULT_VECTOR,#endif	NULL};/* When there is an ambiguous match, bfd_check_format_matches puts the   names of the matching targets in an array.  This variable is the maximum   number of entries that the array could possibly need.  */const size_t _bfd_target_vector_entries = sizeof (_bfd_target_vector)/sizeof (*_bfd_target_vector);/* This array maps configuration triplets onto BFD vectors.  */struct targmatch{  /* The configuration triplet.  */  const char *triplet;  /* The BFD vector.  If this is NULL, then the vector is found by     searching forward for the next structure with a non NULL vector     field.  */  const bfd_target *vector;};/* targmatch.h is built by Makefile out of config.bfd.  */static const struct targmatch bfd_target_match[] = {#include "targmatch.h"  { NULL, NULL }};static const bfd_target *find_target PARAMS ((const char *));/* Find a target vector, given a name or configuration triplet.  */static const bfd_target *find_target (name)     const char *name;{  const bfd_target * const *target;  const struct targmatch *match;  for (target = &bfd_target_vector[0]; *target != NULL; target++)    if (strcmp (name, (*target)->name) == 0)      return *target;  /* If we couldn't match on the exact name, try matching on the     configuration triplet.  FIXME: We should run the triplet through     config.sub first, but that is hard.  */  for (match = &bfd_target_match[0]; match->triplet != NULL; match++)    {      if (fnmatch (match->triplet, name, 0) == 0)	{	  while (match->vector == NULL)	    ++match;	  return match->vector;	  break;	}    }  bfd_set_error (bfd_error_invalid_target);  return NULL;}/*FUNCTION	bfd_set_default_targetSYNOPSIS	boolean bfd_set_default_target (const char *name);DESCRIPTION	Set the default target vector to use when recognizing a BFD.	This takes the name of the target, which may be a BFD target	name or a configuration triplet.*/booleanbfd_set_default_target (name)     const char *name;{  const bfd_target *target;  if (bfd_default_vector[0] != NULL      && strcmp (name, bfd_default_vector[0]->name) == 0)    return true;  target = find_target (name);  if (target == NULL)    return false;  bfd_default_vector[0] = target;  return true;}/*FUNCTION	bfd_find_targetSYNOPSIS	const bfd_target *bfd_find_target(CONST char *target_name, bfd *abfd);DESCRIPTION	Return a pointer to the transfer vector for the object target	named @var{target_name}.  If @var{target_name} is <<NULL>>, choose the	one in the environment variable <<GNUTARGET>>; if that is null or not	defined, then choose the first entry in the target list.	Passing in the string "default" or setting the environment	variable to "default" will cause the first entry in the target	list to be returned, and "target_defaulted" will be set in the	BFD.  This causes <<bfd_check_format>> to loop over all the	targets to find the one that matches the file being read.*/const bfd_target *bfd_find_target (target_name, abfd)     const char *target_name;     bfd *abfd;{  const char *targname;  const bfd_target *target;  if (target_name != NULL)    targname = target_name;  else    targname = getenv ("GNUTARGET");  /* This is safe; the vector cannot be null */  if (targname == NULL || strcmp (targname, "default") == 0)    {      abfd->target_defaulted = true;      if (bfd_default_vector[0] != NULL)	abfd->xvec = bfd_default_vector[0];      else	abfd->xvec = bfd_target_vector[0];      return abfd->xvec;    }  abfd->target_defaulted = false;  target = find_target (targname);  if (target == NULL)    return NULL;  abfd->xvec = target;  return target;}/*FUNCTION	bfd_target_listSYNOPSIS	const char **bfd_target_list(void);DESCRIPTION	Return a freshly malloced NULL-terminated	vector of the names of all the valid BFD targets. Do not	modify the names.*/const char **bfd_target_list (){  int vec_length= 0;#if defined (HOST_HPPAHPUX) && ! defined (__STDC__)  /* The native compiler on the HP9000/700 has a bug which causes it     to loop endlessly when compiling this file.  This avoids it.  */  volatile#endif    const bfd_target * const *target;  CONST  char **name_list, **name_ptr;  for (target = &bfd_target_vector[0]; *target != NULL; target++)    vec_length++;  name_ptr = name_list = (CONST char **)    bfd_zmalloc ((vec_length + 1) * sizeof (char **));  if (name_list == NULL)    return NULL;  for (target = &bfd_target_vector[0]; *target != NULL; target++)    *(name_ptr++) = (*target)->name;  return name_list;}/*FUNCTION	bfd_seach_for_targetSYNOPSIS	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;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?