else if (bfd_is_und_section (bfd_get_section (sym))) h = ((struct generic_link_hash_entry *) bfd_wrapped_link_hash_lookup (output_bfd, info, bfd_asymbol_name (sym), false, false, true));
_bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc)     bfd *output_bfd;     bfd *input_bfd;     struct bfd_link_info *info;     size_t *psymalloc;{  asymbol **sym_ptr;  asymbol **sym_end;  if (! generic_link_read_symbols (input_bfd))    return false;  /* Create a filename symbol if we are supposed to.  */  if (info->create_object_symbols_section != (asection *) NULL)    {      asection *sec;      for (sec = input_bfd->sections;	   sec != (asection *) NULL;	   sec = sec->next)	{	  if (sec->output_section == info->create_object_symbols_section)	    {	      asymbol *newsym;	      newsym = bfd_make_empty_symbol (input_bfd);	      if (!newsym)		return false;	      newsym->name = input_bfd->filename;	      newsym->value = 0;	      newsym->flags = BSF_LOCAL | BSF_FILE;	      newsym->section = sec;	      if (! generic_add_output_symbol (output_bfd, psymalloc,					       newsym))		return false;	      break;	    }	}    }  /* Adjust the values of the globally visible symbols, and write out     local symbols.  */  sym_ptr = _bfd_generic_link_get_symbols (input_bfd);  sym_end = sym_ptr + _bfd_generic_link_get_symcount (input_bfd);  for (; sym_ptr < sym_end; sym_ptr++)    {      asymbol *sym;      struct generic_link_hash_entry *h;      boolean output;      h = (struct generic_link_hash_entry *) NULL;      sym = *sym_ptr;      if ((sym->flags & (BSF_INDIRECT			 | BSF_WARNING			 | BSF_GLOBAL			 | BSF_CONSTRUCTOR			 | BSF_WEAK)) != 0	  || bfd_is_und_section (bfd_get_section (sym))	  || bfd_is_com_section (bfd_get_section (sym))	  || bfd_is_ind_section (bfd_get_section (sym)))	{	  if (sym->udata.p != NULL)	    h = (struct generic_link_hash_entry *) sym->udata.p;	  else if ((sym->flags & BSF_CONSTRUCTOR) != 0)	    {	      /* This case normally means that the main linker code                 deliberately ignored this constructor symbol.  We                 should just pass it through.  This will screw up if                 the constructor symbol is from a different,                 non-generic, object file format, but the case will                 only arise when linking with -r, which will probably                 fail anyhow, since there will be no way to represent                 the relocs in the output format being used.  */	      h = NULL;	    }	  else	    h = _bfd_generic_link_hash_lookup (_bfd_generic_hash_table (info),					       bfd_asymbol_name (sym),					       false, false, true);	  if (h != (struct generic_link_hash_entry *) NULL)	    {	      /* Force all references to this symbol to point to		 the same area in memory.  It is possible that		 this routine will be called with a hash table		 other than a generic hash table, so we double		 check that.  */	      if (info->hash->creator == input_bfd->xvec)		{		  if (h->sym != (asymbol *) NULL)		    *sym_ptr = sym = h->sym;		}	      switch (h->root.type)		{		default:		case bfd_link_hash_new:		  abort ();		case bfd_link_hash_undefined:		  break;		case bfd_link_hash_undefweak:		  sym->flags |= BSF_WEAK;		  break;		case bfd_link_hash_indirect:		  h = (struct generic_link_hash_entry *) h->root.u.i.link;		  /* fall through */		case bfd_link_hash_defined:		  sym->flags |= BSF_GLOBAL;		  sym->flags &=~ BSF_CONSTRUCTOR;		  sym->value = h->root.u.def.value;		  sym->section = h->root.u.def.section;		  break;		case bfd_link_hash_defweak:		  sym->flags |= BSF_WEAK;		  sym->flags &=~ BSF_CONSTRUCTOR;		  sym->value = h->root.u.def.value;		  sym->section = h->root.u.def.section;		  break;		case bfd_link_hash_common:		  sym->value = h->root.u.c.size;		  sym->flags |= BSF_GLOBAL;		  if (! bfd_is_com_section (sym->section))		    {		      BFD_ASSERT (bfd_is_und_section (sym->section));		      sym->section = bfd_com_section_ptr;		    }		  /* We do not set the section of the symbol to		     h->root.u.c.p->section.  That value was saved so		     that we would know where to allocate the symbol		     if it was defined.  In this case the type is		     still bfd_link_hash_common, so we did not define		     it, so we do not want to use that section.  */		  break;		}	    }	}      /* This switch is straight from the old code in	 write_file_locals in ldsym.c.  */      if (info->strip == strip_some	  && (bfd_hash_lookup (info->keep_hash, bfd_asymbol_name (sym),			       false, false)	      == (struct bfd_hash_entry *) NULL))	output = false;      else if ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0)	{	  /* If this symbol is marked as occurring now, rather	     than at the end, output it now.  This is used for	     COFF C_EXT FCN symbols.  FIXME: There must be a	     better way.  */	  if (bfd_asymbol_bfd (sym) == input_bfd	      && (sym->flags & BSF_NOT_AT_END) != 0)	    output = true;	  else	    output = false;	}      else if (bfd_is_ind_section (sym->section))	output = false;      else if ((sym->flags & BSF_DEBUGGING) != 0)	{	  if (info->strip == strip_none)	    output = true;	  else	    output = false;	}      else if (bfd_is_und_section (sym->section)	       || bfd_is_com_section (sym->section))	output = false;      else if ((sym->flags & BSF_LOCAL) != 0)	{	  if ((sym->flags & BSF_WARNING) != 0)	    output = false;	  else	    {	      switch (info->discard)		{		default:		case discard_all:		  output = false;		  break;		case discard_l:		  if (bfd_asymbol_name (sym)[0] == info->lprefix[0]		      && (info->lprefix_len == 1			  || strncmp (bfd_asymbol_name (sym), info->lprefix,				      info->lprefix_len) == 0))		    output = false;		  else		    output = true;		  break;		case discard_none:		  output = true;		  break;		}	    }	}      else if ((sym->flags & BSF_CONSTRUCTOR))	{	  if (info->strip != strip_all)	    output = true;	  else	    output = false;	}      else	abort ();      if (output)	{	  if (! generic_add_output_symbol (output_bfd, psymalloc, sym))	    return false;	  if (h != (struct generic_link_hash_entry *) NULL)	    h->written = true;	}    }  return true;}