{MWARN, WARN,  WARN,  CWARN, CWARN, WARN,  CWARN, CYCLE },
{MWARN, WARN,  WARN,  CWARN, CWARN, WARN,  CWARN, MWARN },
static bfd *hash_entry_bfd PARAMS ((struct bfd_link_hash_entry *));static void set_symbol_from_hash  PARAMS ((asymbol *, struct bfd_link_hash_entry *));static boolean generic_add_output_symbol  PARAMS ((bfd *, size_t *psymalloc, asymbol *));static boolean default_fill_link_order  PARAMS ((bfd *, struct bfd_link_info *, asection *,	   struct bfd_link_order *));static boolean default_indirect_link_order  PARAMS ((bfd *, struct bfd_link_info *, asection *,	   struct bfd_link_order *, boolean));/* The link hash table structure is defined in bfdlink.h.  It provides   a base hash table which the backend specific hash tables are built   upon.  *//* Routine to create an entry in the link hash table.  */struct bfd_hash_entry *_bfd_link_hash_newfunc (entry, table, string)     struct bfd_hash_entry *entry;     struct bfd_hash_table *table;     const char *string;{  struct bfd_link_hash_entry *ret = (struct bfd_link_hash_entry *) entry;  /* Allocate the structure if it has not already been allocated by a     subclass.  */  if (ret == (struct bfd_link_hash_entry *) NULL)    ret = ((struct bfd_link_hash_entry *)	   bfd_hash_allocate (table, sizeof (struct bfd_link_hash_entry)));  if (ret == (struct bfd_link_hash_entry *) NULL)    return NULL;  /* Call the allocation method of the superclass.  */  ret = ((struct bfd_link_hash_entry *)	 bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));  if (ret)    {      /* Initialize the local fields.  */      ret->type = bfd_link_hash_new;      ret->next = NULL;    }  return (struct bfd_hash_entry *) ret;}/* Initialize a link hash table.  The BFD argument is the one   responsible for creating this table.  */boolean_bfd_link_hash_table_init (table, abfd, newfunc)     struct bfd_link_hash_table *table;     bfd *abfd;     struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,						struct bfd_hash_table *,						const char *));{  table->creator = abfd->xvec;  table->undefs = NULL;  table->undefs_tail = NULL;  return bfd_hash_table_init (&table->table, newfunc);}/* Look up a symbol in a link hash table.  If follow is true, we   follow bfd_link_hash_indirect and bfd_link_hash_warning links to   the real symbol.  */struct bfd_link_hash_entry *bfd_link_hash_lookup (table, string, create, copy, follow)     struct bfd_link_hash_table *table;     const char *string;     boolean create;     boolean copy;     boolean follow;{  struct bfd_link_hash_entry *ret;  ret = ((struct bfd_link_hash_entry *)	 bfd_hash_lookup (&table->table, string, create, copy));  if (follow && ret != (struct bfd_link_hash_entry *) NULL)    {      while (ret->type == bfd_link_hash_indirect	     || ret->type == bfd_link_hash_warning)	ret = ret->u.i.link;    }  return ret;}/* Traverse a generic link hash table.  The only reason this is not a   macro is to do better type checking.  This code presumes that an   argument passed as a struct bfd_hash_entry * may be caught as a   struct bfd_link_hash_entry * with no explicit cast required on the   call.  */void bfd_link_hash_traverse (table, func, info)     struct bfd_link_hash_table *table;     boolean (*func) PARAMS ((struct bfd_link_hash_entry *, PTR));     PTR info;{  bfd_hash_traverse (&table->table,		     ((boolean (*) PARAMS ((struct bfd_hash_entry *, PTR)))		      func),		     info);}/* Add a symbol to the linker hash table undefs list.  */INLINE voidbfd_link_add_undef (table, h)     struct bfd_link_hash_table *table;     struct bfd_link_hash_entry *h;{  BFD_ASSERT (h->next == NULL);  if (table->undefs_tail != (struct bfd_link_hash_entry *) NULL)    table->undefs_tail->next = h;  if (table->undefs == (struct bfd_link_hash_entry *) NULL)    table->undefs = h;  table->undefs_tail = h;}/* Routine to create an entry in an generic link hash table.  */static struct bfd_hash_entry *generic_link_hash_newfunc (entry, table, string)     struct bfd_hash_entry *entry;     struct bfd_hash_table *table;     const char *string;{  struct generic_link_hash_entry *ret =    (struct generic_link_hash_entry *) entry;  /* Allocate the structure if it has not already been allocated by a     subclass.  */  if (ret == (struct generic_link_hash_entry *) NULL)    ret = ((struct generic_link_hash_entry *)	   bfd_hash_allocate (table, sizeof (struct generic_link_hash_entry)));  if (ret == (struct generic_link_hash_entry *) NULL)    return NULL;  /* Call the allocation method of the superclass.  */  ret = ((struct generic_link_hash_entry *)	 _bfd_link_hash_newfunc ((struct bfd_hash_entry *) ret,				 table, string));  if (ret)    {      /* Set local fields.  */      ret->written = false;      ret->sym = NULL;    }  return (struct bfd_hash_entry *) ret;}/* Create an generic link hash table.  */struct bfd_link_hash_table *_bfd_generic_link_hash_table_create (abfd)     bfd *abfd;{  struct generic_link_hash_table *ret;  ret = ((struct generic_link_hash_table *)	 bfd_alloc (abfd, sizeof (struct generic_link_hash_table)));  if (ret == NULL)    {      bfd_set_error (bfd_error_no_memory);      return (struct bfd_link_hash_table *) NULL;    }  if (! _bfd_link_hash_table_init (&ret->root, abfd,				   generic_link_hash_newfunc))    {      free (ret);      return (struct bfd_link_hash_table *) NULL;    }  return &ret->root;}/* Grab the symbols for an object file when doing a generic link.  We   store the symbols in the outsymbols field.  We need to keep them   around for the entire link to ensure that we only read them once.   If we read them multiple times, we might wind up with relocs and   the hash table pointing to different instances of the symbol   structure.  */static booleangeneric_link_read_symbols (abfd)     bfd *abfd;{  if (abfd->outsymbols == (asymbol **) NULL)    {      long symsize;      long symcount;      symsize = bfd_get_symtab_upper_bound (abfd);      if (symsize < 0)	return false;      abfd->outsymbols = (asymbol **) bfd_alloc (abfd, symsize);      if (abfd->outsymbols == NULL && symsize != 0)	{	  bfd_set_error (bfd_error_no_memory);	  return false;	}      symcount = bfd_canonicalize_symtab (abfd, abfd->outsymbols);      if (symcount < 0)	return false;      abfd->symcount = symcount;    }  return true;}/* Generic function to add symbols to from an object file to the   global hash table.  This version does not automatically collect   constructors by name.  */boolean_bfd_generic_link_add_symbols (abfd, info)     bfd *abfd;     struct bfd_link_info *info;{  return generic_link_add_symbols (abfd, info, false);}/* Generic function to add symbols from an object file to the global   hash table.  This version automatically collects constructors by   name, as the collect2 program does.  It should be used for any   target which does not provide some other mechanism for setting up   constructors and destructors; these are approximately those targets   for which gcc uses collect2 and do not support stabs.  */boolean_bfd_generic_link_add_symbols_collect (abfd, info)     bfd *abfd;     struct bfd_link_info *info;{  return generic_link_add_symbols (abfd, info, true);}/* Add symbols from an object file to the global hash table.  */static booleangeneric_link_add_symbols (abfd, info, collect)     bfd *abfd;     struct bfd_link_info *info;     boolean collect;{  boolean ret;  switch (bfd_get_format (abfd))    {    case bfd_object:      ret = generic_link_add_object_symbols (abfd, info, collect);      break;    case bfd_archive:      ret = (_bfd_generic_link_add_archive_symbols	     (abfd, info,	      (collect	       ? generic_link_check_archive_element_collect	       : generic_link_check_archive_element_no_collect)));      break;    default:      bfd_set_error (bfd_error_wrong_format);      ret = false;    }  return ret;}/* Add symbols from an object file to the global hash table.  */static booleangeneric_link_add_object_symbols (abfd, info, collect)     bfd *abfd;     struct bfd_link_info *info;     boolean collect;{  if (! generic_link_read_symbols (abfd))    return false;  return generic_link_add_symbol_list (abfd, info,				       _bfd_generic_link_get_symcount (abfd),				       _bfd_generic_link_get_symbols (abfd),				       collect);}/* We build a hash table of all symbols defined in an archive.  *//* An archive symbol may be defined by multiple archive elements.   This linked list is used to hold the elements.  */struct archive_list{  struct archive_list *next;  int indx;};/* An entry in an archive hash table.  */struct archive_hash_entry{  struct bfd_hash_entry root;  /* Where the symbol is defined.  */  struct archive_list *defs;};/* An archive hash table itself.  */struct archive_hash_table{  struct bfd_hash_table table;};static struct bfd_hash_entry *archive_hash_newfunc  PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));static boolean archive_hash_table_init  PARAMS ((struct archive_hash_table *,	   struct bfd_hash_entry *(*) (struct bfd_hash_entry *,				       struct bfd_hash_table *,				       const char *)));/* Create a new entry for an archive hash table.  */static struct bfd_hash_entry *archive_hash_newfunc (entry, table, string)     struct bfd_hash_entry *entry;     struct bfd_hash_table *table;     const char *string;{  struct archive_hash_entry *ret = (struct archive_hash_entry *) entry;  /* Allocate the structure if it has not already been allocated by a     subclass.  */  if (ret == (struct archive_hash_entry *) NULL)    ret = ((struct archive_hash_entry *)	   bfd_hash_allocate (table, sizeof (struct archive_hash_entry)));  if (ret == (struct archive_hash_entry *) NULL)    return NULL;  /* Call the allocation method of the superclass.  */  ret = ((struct archive_hash_entry *)	 bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));  if (ret)    {      /* Initialize the local fields.  */      ret->defs = (struct archive_list *) NULL;    }  return (struct bfd_hash_entry *) ret;}/* Initialize an archive hash table.  */static booleanarchive_hash_table_init (table, newfunc)     struct archive_hash_table *table;     struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,						struct bfd_hash_table *,						const char *));{  return bfd_hash_table_init (&table->table, newfunc);}/* Look up an entry in an archive hash table.  */#define archive_hash_lookup(t, string, create, copy) \  ((struct archive_hash_entry *) \   bfd_hash_lookup (&(t)->table, (string), (create), (copy)))/* Allocate space in an archive hash table.  */#define archive_hash_allocate(t, size) bfd_hash_allocate (&(t)->table, (size))/* Free an archive hash table.  */#define archive_hash_table_free(t) bfd_hash_table_free (&(t)->table)/* Generic function to add symbols from an archive file to the global   hash file.  This function presumes that the archive symbol table   has already been read in (this is normally done by the   bfd_check_format entry point).  It looks through the undefined and   common symbols and searches the archive symbol table for them.  If   it finds an entry, it includes the associated object file in the   link.   The old linker looked through the archive symbol table for   undefined symbols.  We do it the other way around, looking through   undefined symbols for symbols defined in the archive.  The   advantage of the newer scheme is that we only have to look through   the list of undefined symbols once, whereas the old method had to   re-search the symbol table each time a new object file was added.   The CHECKFN argument is used to see if an object file should be   included.  CHECKFN should set *PNEEDED to true if the object file   should be included, and must also call the bfd_link_info   add_archive_element callback function and handle adding the symbols   to the global hash table.  CHECKFN should only return false if some   sort of error occurs.   For some formats, such as a.out, it is possible to look through an   object file but not actually include it in the link.  The   archive_pass field in a BFD is used to avoid checking the symbols   of an object files too many times.  When an object is included in   the link, archive_pass is set to -1.  If an object is scanned but   not included, archive_pass is set to the pass number.  The pass   number is incremented each time a new object file is included.  The   pass number is used because when a new object file is included it   may create new undefined symbols which cause a previously examined   object file to be included.  */boolean_bfd_generic_link_add_archive_symbols (abfd, info, checkfn)     bfd *abfd;     struct bfd_link_info *info;     boolean (*checkfn) PARAMS ((bfd *, struct bfd_link_info *,				 boolean *pneeded));{  carsym *arsyms;  carsym *arsym_end;  register carsym *arsym;  int pass;  struct archive_hash_table arsym_hash;  int indx;  struct bfd_link_hash_entry **pundef;  if (! bfd_has_map (abfd))    {      /* An empty archive is a special case.  */      if (bfd_openr_next_archived_file (abfd, (bfd *) NULL) == NULL)	return true;      bfd_set_error (bfd_error_no_armap);      return false;    }  arsyms = bfd_ardata (abfd)->symdefs;  arsym_end = arsyms + bfd_ardata (abfd)->symdef_count;  /* In order to quickly determine whether an symbol is defined in     this archive, we build a hash table of the symbols.  */  if (! archive_hash_table_init (&arsym_hash, archive_hash_newfunc))    return false;  for (arsym = arsyms, indx = 0; arsym < arsym_end; arsym++, indx++)    {      struct archive_hash_entry *arh;      struct archive_list *l, **pp;      arh = archive_hash_lookup (&arsym_hash, arsym->name, true, false);      if (arh == (struct archive_hash_entry *) NULL)	goto error_return;      l = ((struct archive_list *)	   archive_hash_allocate (&arsym_hash, sizeof (struct archive_list)));      if (l == NULL)	goto error_return;      l->indx = indx;      for (pp = &arh->defs;	   *pp != (struct archive_list *) NULL;	   pp = &(*pp)->next)	;      *pp = l;      l->next = NULL;    }  /* The archive_pass field in the archive itself is used to     initialize PASS, sine we may search the same archive multiple     times.  */  pass = abfd->archive_pass + 1;  /* New undefined symbols are added to the end of the list, so we     only need to look through it once.  */  pundef = &info->hash->undefs;  while (*pundef != (struct bfd_link_hash_entry *) NULL)    {      struct bfd_link_hash_entry *h;      struct archive_hash_entry *arh;      struct archive_list *l;      h = *pundef;      /* When a symbol is defined, it is not necessarily removed from	 the list.  */      if (h->type != bfd_link_hash_undefined	  && h->type != bfd_link_hash_common)	{	  /* Remove this entry from the list, for general cleanliness	     and because we are going to look through the list again	     if we search any more libraries.  We can't remove the	     entry if it is the tail, because that would lose any	     entries we add to the list later on (it would also cause	     us to lose track of whether the symbol has been	     referenced).  */	  if (*pundef != info->hash->undefs_tail)	    *pundef = (*pundef)->next;	  else	    pundef = &(*pundef)->next;	  continue;	}      /* Look for this symbol in the archive symbol map.  */      arh = archive_hash_lookup (&arsym_hash, h->root.string, false, false);      if (arh == (struct archive_hash_entry *) NULL)	{	  pundef = &(*pundef)->next;	  continue;	}      /* Look at all the objects which define this symbol.  */      for (l = arh->defs; l != (struct archive_list *) NULL; l = l->next)	{	  bfd *element;	  boolean needed;	  /* If the symbol has gotten defined along the way, quit.  */	  if (h->type != bfd_link_hash_undefined	      && h->type != bfd_link_hash_common)	    break;	  element = bfd_get_elt_at_index (abfd, l->indx);	  if (element == (bfd *) NULL)	    goto error_return;	  /* If we've already included this element, or if we've	     already checked it on this pass, continue.  */	  if (element->archive_pass == -1	      || element->archive_pass == pass)	    continue;	  /* If we can't figure this element out, just ignore it.  */	  if (! bfd_check_format (element, bfd_object))	    {	      element->archive_pass = -1;	      continue;	    }	  /* CHECKFN will see if this element should be included, and	     go ahead and include it if appropriate.  */	  if (! (*checkfn) (element, info, &needed))	    goto error_return;	  if (! needed)	    element->archive_pass = pass;	  else	    {	      element->archive_pass = -1;	      /* Increment the pass count to show that we may need to		 recheck object files which were already checked.  */	      ++pass;	    }	}      pundef = &(*pundef)->next;    }  archive_hash_table_free (&arsym_hash);  /* Save PASS in case we are called again.  */  abfd->archive_pass = pass;  return true; error_return:  archive_hash_table_free (&arsym_hash);  return false;}/* See if we should include an archive element.  This version is used   when we do not want to automatically collect constructors based on   the symbol name, presumably because we have some other mechanism   for finding them.  */static booleangeneric_link_check_archive_element_no_collect (abfd, info, pneeded)     bfd *abfd;     struct bfd_link_info *info;     boolean *pneeded;{  return generic_link_check_archive_element (abfd, info, pneeded, false);}/* See if we should include an archive element.  This version is used   when we want to automatically collect constructors based on the   symbol name, as collect2 does.  */static booleangeneric_link_check_archive_element_collect (abfd, info, pneeded)     bfd *abfd;     struct bfd_link_info *info;     boolean *pneeded;{  return generic_link_check_archive_element (abfd, info, pneeded, true);}/* See if we should include an archive element.  Optionally collect   constructors.  */static booleangeneric_link_check_archive_element (abfd, info, pneeded, collect)     bfd *abfd;     struct bfd_link_info *info;     boolean *pneeded;     boolean collect;{  asymbol **pp, **ppend;  *pneeded = false;  if (! generic_link_read_symbols (abfd))    return false;  pp = _bfd_generic_link_get_symbols (abfd);  ppend = pp + _bfd_generic_link_get_symcount (abfd);  for (; pp < ppend; pp++)    {      asymbol *p;      struct bfd_link_hash_entry *h;      p = *pp;      /* We are only interested in globally visible symbols.  */      if (! bfd_is_com_section (p->section)	  && (p->flags & (BSF_GLOBAL | BSF_INDIRECT | BSF_WEAK)) == 0)	continue;      /* We are only interested if we know something about this	 symbol, and it is undefined or common.  An undefined weak	 symbol (type bfd_link_hash_undefweak) is not considered to be	 a reference when pulling files out of an archive.  See the	 SVR4 ABI, p. 4-27.  */      h = bfd_link_hash_lookup (info->hash, bfd_asymbol_name (p), false,				false, true);      if (h == (struct bfd_link_hash_entry *) NULL	  || (h->type != bfd_link_hash_undefined	      && h->type != bfd_link_hash_common))	continue;      /* P is a symbol we are looking for.  */      if (! bfd_is_com_section (p->section))	{	  bfd_size_type symcount;	  asymbol **symbols;	  /* This object file defines this symbol, so pull it in.  */	  if (! (*info->callbacks->add_archive_element) (info, abfd,							 bfd_asymbol_name (p)))	    return false;	  symcount = _bfd_generic_link_get_symcount (abfd);	  symbols = _bfd_generic_link_get_symbols (abfd);	  if (! generic_link_add_symbol_list (abfd, info, symcount,					      symbols, collect))	    return false;	  *pneeded = true;	  return true;	}      /* P is a common symbol.  */      if (h->type == bfd_link_hash_undefined)	{	  bfd *symbfd;	  bfd_vma size;	  unsigned int power;	  symbfd = h->u.undef.abfd;	  if (symbfd == (bfd *) NULL)	    {	      /* This symbol was created as undefined from outside		 BFD.  We assume that we should link in the object		 file.  This is for the -u option in the linker.  */	      if (! (*info->callbacks->add_archive_element)		  (info, abfd, bfd_asymbol_name (p)))		return false;	      *pneeded = true;	      return true;	    }	  /* Turn the symbol into a common symbol but do not link in	     the object file.  This is how a.out works.  Object	     formats that require different semantics must implement	     this function differently.  This symbol is already on the	     undefs list.  We add the section to a common section	     attached to symbfd to ensure that it is in a BFD which	     will be linked in.  */	  h->type = bfd_link_hash_common;	  h->u.c.p =	    ((struct bfd_link_hash_common_entry *)	     bfd_hash_allocate (&info->hash->table,				sizeof (struct bfd_link_hash_common_entry)));	  if (h->u.c.p == NULL)	    return false;	  size = bfd_asymbol_value (p);	  h->u.c.size = size;	  power = bfd_log2 (size);	  if (power > 4)	    power = 4;	  h->u.c.p->alignment_power = power;	  if (p->section == bfd_com_section_ptr)	    h->u.c.p->section = bfd_make_section_old_way (symbfd, "COMMON");	  else	    h->u.c.p->section = bfd_make_section_old_way (symbfd,							  p->section->name);	  h->u.c.p->section->flags = SEC_ALLOC;	}      else	{	  /* Adjust the size of the common symbol if necessary.  This	     is how a.out works.  Object formats that require	     different semantics must implement this function	     differently.  */	  if (bfd_asymbol_value (p) > h->u.c.size)	    h->u.c.size = bfd_asymbol_value (p);	}    }  /* This archive element is not needed.  */  return true;}/* Add the symbols from an object file to the global hash table.  ABFD   is the object file.  INFO is the linker information.  SYMBOL_COUNT   is the number of symbols.  SYMBOLS is the list of symbols.  COLLECT   is true if constructors should be automatically collected by name   as is done by collect2.  */static booleangeneric_link_add_symbol_list (abfd, info, symbol_count, symbols, collect)     bfd *abfd;     struct bfd_link_info *info;     bfd_size_type symbol_count;     asymbol **symbols;     boolean collect;{  asymbol **pp, **ppend;  pp = symbols;  ppend = symbols + symbol_count;  for (; pp < ppend; pp++)    {      asymbol *p;      p = *pp;      if ((p->flags & (BSF_INDIRECT		       | BSF_WARNING		       | BSF_GLOBAL		       | BSF_CONSTRUCTOR		       | BSF_WEAK)) != 0	  || bfd_is_und_section (bfd_get_section (p))	  || bfd_is_com_section (bfd_get_section (p))	  || bfd_is_ind_section (bfd_get_section (p)))	{	  const char *name;	  const char *string;	  struct generic_link_hash_entry *h;	  name = bfd_asymbol_name (p);	  if (((p->flags & BSF_INDIRECT) != 0	       || bfd_is_ind_section (p->section))	      && pp + 1 < ppend)	    {	      pp++;	      string = bfd_asymbol_name (*pp);	    }	  else if ((p->flags & BSF_WARNING) != 0		   && pp + 1 < ppend)	    {	      /* The name of P is actually the warning string, and the		 next symbol is the one to warn about.  */	      string = name;	      pp++;	      name = bfd_asymbol_name (*pp);	    }	  else	    string = NULL;	  h = NULL;	  if (! (_bfd_generic_link_add_one_symbol		 (info, abfd, name, p->flags, bfd_get_section (p),		  p->value, string, false, collect,		  (struct bfd_link_hash_entry **) &h)))	    return false;	  /* If this is a constructor symbol, and the linker didn't do             anything with it, then we want to just pass the symbol             through to the output file.  This will happen when             linking with -r.  */	  if ((p->flags & BSF_CONSTRUCTOR) != 0	      && (h == NULL || h->root.type == bfd_link_hash_new))	    {	      p->udata.p = NULL;	      continue;	    }	  /* Save the BFD symbol so that we don't lose any backend	     specific information that may be attached to it.  We only	     want this one if it gives more information than the	     existing one; we don't want to replace a defined symbol	     with an undefined one.  This routine may be called with a	     hash table other than the generic hash table, so we only	     do this if we are certain that the hash table is a	     generic one.  */	  if (info->hash->creator == abfd->xvec)	    {	      if (h->sym == (asymbol *) NULL		  || (! bfd_is_und_section (bfd_get_section (p))		      && (! bfd_is_com_section (bfd_get_section (p))			  || bfd_is_und_section (bfd_get_section (h->sym)))))		{		  h->sym = p;		  /* BSF_OLD_COMMON is a hack to support COFF reloc		     reading, and it should go away when the COFF		     linker is switched to the new version.  */		  if (bfd_is_com_section (bfd_get_section (p)))		    p->flags |= BSF_OLD_COMMON;		}	      /* Store a back pointer from the symbol to the hash		 table entry for the benefit of relaxation code until		 it gets rewritten to not use asymbol structures.		 Setting this is also used to check whether these		 symbols were set up by the generic linker.  */	      p->udata.p = (PTR) h;	    }	}    }  return true;}/* We use a state table to deal with adding symbols from an object   file.  The first index into the state table describes the symbol   from the object file.  The second index into the state table is the   type of the symbol in the hash table.  *//* The symbol from the object file is turned into one of these row   values.  */enum link_row{  UNDEF_ROW,		/* Undefined.  */  UNDEFW_ROW,		/* Weak undefined.  */  DEF_ROW,		/* Defined.  */  DEFW_ROW,		/* Weak defined.  */  COMMON_ROW,		/* Common.  */  INDR_ROW,		/* Indirect.  */  WARN_ROW,		/* Warning.  */  SET_ROW		/* Member of set.  */};/* apparently needed for Hitachi 3050R(HI-UX/WE2)? */#undef FAIL/* The actions to take in the state table.  */enum link_action{  FAIL,		/* Abort. */  UND,		/* Mark symbol undefined.  */  WEAK,		/* Mark symbol weak undefined.  */  DEF,		/* Mark symbol defined.  */  DEFW,		/* Mark symbol weak defined.  */  COM,		/* Mark symbol common.  */  REF,		/* Mark defined symbol referenced.  */  CREF,		/* Possibly warn about common reference to defined symbol.  */  CDEF,		/* Define existing common symbol.  */  NOACT,	/* No action.  */  BIG,		/* Mark symbol common using largest size.  */  MDEF,		/* Multiple definition error.  */  MIND,		/* Multiple indirect symbols.  */  IND,		/* Make indirect symbol.  */  CIND,		/* Make indirect symbol from existing common symbol.  */  SET,		/* Add value to set.  */  MWARN,	/* Make warning symbol.  */  WARN,		/* Issue warning.  */  CWARN,	/* Warn if referenced, else MWARN.  */  CYCLE,	/* Repeat with symbol pointed to.  */  REFC,		/* Mark indirect symbol referenced and then CYCLE.  */  WARNC		/* Issue warning and then CYCLE.  */};/* The state table itself.  The first index is a link_row and the   second index is a bfd_link_hash_type.  */static const enum link_action link_action[8][8] ={  /* current\prev    new    undef  undefw def    defw   com    indr   warn  */  /* UNDEF_ROW 	*/  {UND,   NOACT, UND,   REF,   REF,   NOACT, REFC,  WARNC },  /* UNDEFW_ROW	*/  {WEAK,  NOACT, NOACT, REF,   REF,   NOACT, REFC,  WARNC },  /* DEF_ROW 	*/  {DEF,   DEF,   DEF,   MDEF,  DEF,   CDEF,  MDEF,  CYCLE },  /* DEFW_ROW 	*/  {DEFW,  DEFW,  DEFW,  NOACT, NOACT, NOACT, NOACT, CYCLE },  /* COMMON_ROW	*/  {COM,   COM,   COM,   CREF,  CREF,  BIG,   CREF,  WARNC },  /* INDR_ROW	*/  {IND,   IND,   IND,   MDEF,  IND,   CIND,  MIND,  CYCLE },  /* WARN_ROW   */  {MWARN, WARN,  WARN,  CWARN, CWARN, WARN,  CWARN, CYCLE },  /* SET_ROW	*/  {SET,   SET,   SET,   SET,   SET,   SET,   CYCLE, CYCLE }};/* Most of the entries in the LINK_ACTION table are straightforward,   but a few are somewhat subtle.   A reference to an indirect symbol (UNDEF_ROW/indr or   UNDEFW_ROW/indr) is counted as a reference both to the indirect   symbol and to the symbol the indirect symbol points to.   A reference to a warning symbol (UNDEF_ROW/warn or UNDEFW_ROW/warn)   causes the warning to be issued.   A common definition of an indirect symbol (COMMON_ROW/indr) is   treated as a multiple definition error.  Likewise for an indirect   definition of a common symbol (INDR_ROW/com).   An indirect definition of a warning (INDR_ROW/warn) does not cause   the warning to be issued.   If a warning is created for an indirect symbol (WARN_ROW/indr) no   warning is created for the symbol the indirect symbol points to.   Adding an entry to a set does not count as a reference to a set,   and no warning is issued (SET_ROW/warn).  *//* Return the BFD in which a hash entry has been defined, if known.  */static bfd *hash_entry_bfd (h)     struct bfd_link_hash_entry *h;{  while (h->type == bfd_link_hash_warning)    h = h->u.i.link;  switch (h->type)    {    default:      return NULL;    case bfd_link_hash_undefined:    case bfd_link_hash_undefweak:      return h->u.undef.abfd;    case bfd_link_hash_defined:    case bfd_link_hash_defweak:      return h->u.def.section->owner;    case bfd_link_hash_common:      return h->u.c.p->section->owner;    }  /*NOTREACHED*/}