return true;  outsym = finfo->outsyms;
{ BFD_ASSERT (outsym == finfo->outsyms); return true; }
xcoff_write_global_symbol (h, p)     struct xcoff_link_hash_entry *h;     PTR p;{  struct xcoff_final_link_info *finfo = (struct xcoff_final_link_info *) p;  bfd *output_bfd;  bfd_byte *outsym;  struct internal_syment isym;  union internal_auxent aux;  output_bfd = finfo->output_bfd;  /* If this symbol was garbage collected, just skip it.  */  if (xcoff_hash_table (finfo->info)->gc      && (h->flags & XCOFF_MARK) == 0)    return true;  /* If we need a .loader section entry, write it out.  */  if (h->ldsym != NULL)    {      struct internal_ldsym *ldsym;      bfd *impbfd;      ldsym = h->ldsym;      if (h->root.type == bfd_link_hash_undefined	  || h->root.type == bfd_link_hash_undefweak)	{	  ldsym->l_value = 0;	  ldsym->l_scnum = N_UNDEF;	  ldsym->l_smtype = XTY_ER;	  impbfd = h->root.u.undef.abfd;	}      else if (h->root.type == bfd_link_hash_defined	       || h->root.type == bfd_link_hash_defweak)	{	  asection *sec;	  sec = h->root.u.def.section;	  ldsym->l_value = (sec->output_section->vma			    + sec->output_offset			    + h->root.u.def.value);	  ldsym->l_scnum = sec->output_section->target_index;	  ldsym->l_smtype = XTY_SD;	  impbfd = sec->owner;	}      else	abort ();      if (((h->flags & XCOFF_DEF_REGULAR) == 0	   && (h->flags & XCOFF_DEF_DYNAMIC) != 0)	  || (h->flags & XCOFF_IMPORT) != 0)	ldsym->l_smtype |= L_IMPORT;      if (((h->flags & XCOFF_DEF_REGULAR) != 0	   && (h->flags & XCOFF_DEF_DYNAMIC) != 0)	  || (h->flags & XCOFF_EXPORT) != 0)	ldsym->l_smtype |= L_EXPORT;      if ((h->flags & XCOFF_ENTRY) != 0)	ldsym->l_smtype |= L_ENTRY;      ldsym->l_smclas = h->smclas;      if (ldsym->l_ifile == (bfd_size_type) -1)	ldsym->l_ifile = 0;      else if (ldsym->l_ifile == 0)	{	  if ((ldsym->l_smtype & L_IMPORT) == 0)	    ldsym->l_ifile = 0;	  else if (impbfd == NULL)	    ldsym->l_ifile = 0;	  else	    {	      BFD_ASSERT (impbfd->xvec == output_bfd->xvec);	      ldsym->l_ifile = xcoff_data (impbfd)->import_file_id;	    }	}      ldsym->l_parm = 0;      BFD_ASSERT (h->ldindx >= 0);      BFD_ASSERT (LDSYMSZ == sizeof (struct external_ldsym));      xcoff_swap_ldsym_out (output_bfd, ldsym, finfo->ldsym + h->ldindx - 3);      h->ldsym = NULL;    }  /* If this symbol needs global linkage code, write it out.  */  if (h->root.type == bfd_link_hash_defined      && (h->root.u.def.section	  == xcoff_hash_table (finfo->info)->linkage_section))    {      bfd_byte *p;      bfd_vma tocoff;      unsigned int i;      p = h->root.u.def.section->contents + h->root.u.def.value;      /* The first instruction in the global linkage code loads a         specific TOC element.  */      tocoff = (h->descriptor->toc_section->output_section->vma		+ h->descriptor->toc_section->output_offset		- xcoff_data (output_bfd)->toc);      if ((h->descriptor->flags & XCOFF_SET_TOC) != 0)	tocoff += h->descriptor->u.toc_offset;      bfd_put_32 (output_bfd, XCOFF_GLINK_FIRST | (tocoff & 0xffff), p);      for (i = 0, p += 4;	   i < sizeof xcoff_glink_code / sizeof xcoff_glink_code[0];	   i++, p += 4)	bfd_put_32 (output_bfd, xcoff_glink_code[i], p);    }  /* If we created a TOC entry for this symbol, write out the required     relocs.  */  if ((h->flags & XCOFF_SET_TOC) != 0)    {      asection *tocsec;      asection *osec;      int oindx;      struct internal_reloc *irel;      struct internal_ldrel ldrel;      tocsec = h->toc_section;      osec = tocsec->output_section;      oindx = osec->target_index;      irel = finfo->section_info[oindx].relocs + osec->reloc_count;      irel->r_vaddr = (osec->vma		       + tocsec->output_offset		       + h->u.toc_offset);      if (h->indx >= 0)	irel->r_symndx = h->indx;      else	{	  h->indx = -2;	  irel->r_symndx = obj_raw_syment_count (output_bfd);	}      irel->r_type = R_POS;      irel->r_size = 31;      finfo->section_info[oindx].rel_hashes[osec->reloc_count] = NULL;      ++osec->reloc_count;      BFD_ASSERT (h->ldindx >= 0);      ldrel.l_vaddr = irel->r_vaddr;      ldrel.l_symndx = h->ldindx;      ldrel.l_rtype = (31 << 8) | R_POS;      ldrel.l_rsecnm = oindx;      xcoff_swap_ldrel_out (output_bfd, &ldrel, finfo->ldrel);      ++finfo->ldrel;    }  /* If this symbol is a specially defined function descriptor, write     it out.  The first word is the address of the function code     itself, the second word is the address of the TOC, and the third     word is zero.  */  if ((h->flags & XCOFF_DESCRIPTOR) != 0      && h->root.type == bfd_link_hash_defined      && (h->root.u.def.section	  == xcoff_hash_table (finfo->info)->descriptor_section))    {      asection *sec;      asection *osec;      int oindx;      bfd_byte *p;      struct xcoff_link_hash_entry *hentry;      asection *esec;      struct internal_reloc *irel;      struct internal_ldrel ldrel;      asection *tsec;      sec = h->root.u.def.section;      osec = sec->output_section;      oindx = osec->target_index;      p = sec->contents + h->root.u.def.value;      hentry = h->descriptor;      BFD_ASSERT (hentry != NULL		  && (hentry->root.type == bfd_link_hash_defined		      || hentry->root.type == bfd_link_hash_defweak));      esec = hentry->root.u.def.section;      bfd_put_32 (output_bfd,		  (esec->output_section->vma		   + esec->output_offset		   + hentry->root.u.def.value),		  p);      irel = finfo->section_info[oindx].relocs + osec->reloc_count;      irel->r_vaddr = (osec->vma		       + sec->output_offset		       + h->root.u.def.value);      irel->r_symndx = esec->output_section->target_index;      irel->r_type = R_POS;      irel->r_size = 31;      finfo->section_info[oindx].rel_hashes[osec->reloc_count] = NULL;      ++osec->reloc_count;      ldrel.l_vaddr = irel->r_vaddr;      if (strcmp (esec->output_section->name, ".text") == 0)	ldrel.l_symndx = 0;      else if (strcmp (esec->output_section->name, ".data") == 0)	ldrel.l_symndx = 1;      else if (strcmp (esec->output_section->name, ".bss") == 0)	ldrel.l_symndx = 2;      else	{	  (*_bfd_error_handler)	    ("%s: loader reloc in unrecognized section `%s'",	     bfd_get_filename (output_bfd),	     esec->output_section->name);	  bfd_set_error (bfd_error_nonrepresentable_section);	  return false;	}      ldrel.l_rtype = (31 << 8) | R_POS;      ldrel.l_rsecnm = oindx;      xcoff_swap_ldrel_out (output_bfd, &ldrel, finfo->ldrel);      ++finfo->ldrel;      bfd_put_32 (output_bfd, xcoff_data (output_bfd)->toc, p + 4);      tsec = coff_section_from_bfd_index (output_bfd,					  xcoff_data (output_bfd)->sntoc);      ++irel;      irel->r_vaddr = (osec->vma		       + sec->output_offset		       + h->root.u.def.value		       + 4);      irel->r_symndx = tsec->output_section->target_index;      irel->r_type = R_POS;      irel->r_size = 31;      finfo->section_info[oindx].rel_hashes[osec->reloc_count] = NULL;      ++osec->reloc_count;      ldrel.l_vaddr = irel->r_vaddr;      if (strcmp (tsec->output_section->name, ".text") == 0)	ldrel.l_symndx = 0;      else if (strcmp (tsec->output_section->name, ".data") == 0)	ldrel.l_symndx = 1;      else if (strcmp (tsec->output_section->name, ".bss") == 0)	ldrel.l_symndx = 2;      else	{	  (*_bfd_error_handler)	    ("%s: loader reloc in unrecognized section `%s'",	     bfd_get_filename (output_bfd),	     tsec->output_section->name);	  bfd_set_error (bfd_error_nonrepresentable_section);	  return false;	}      ldrel.l_rtype = (31 << 8) | R_POS;      ldrel.l_rsecnm = oindx;      xcoff_swap_ldrel_out (output_bfd, &ldrel, finfo->ldrel);      ++finfo->ldrel;    }  if (h->indx >= 0)    return true;  if (h->indx != -2      && (finfo->info->strip == strip_all	  || (finfo->info->strip == strip_some	      && (bfd_hash_lookup (finfo->info->keep_hash,				   h->root.root.string, false, false)		  == NULL))))    return true;  if (h->indx != -2      && (h->flags & (XCOFF_REF_REGULAR | XCOFF_DEF_REGULAR)) == 0)    return true;  outsym = finfo->outsyms;  memset (&aux, 0, sizeof aux);  h->indx = obj_raw_syment_count (output_bfd);  if (strlen (h->root.root.string) <= SYMNMLEN)    strncpy (isym._n._n_name, h->root.root.string, SYMNMLEN);  else    {      boolean hash;      bfd_size_type indx;      hash = true;      if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0)	hash = false;      indx = _bfd_stringtab_add (finfo->strtab, h->root.root.string, hash,				 false);      if (indx == (bfd_size_type) -1)	return false;      isym._n._n_n._n_zeroes = 0;      isym._n._n_n._n_offset = STRING_SIZE_SIZE + indx;    }  if (h->root.type == bfd_link_hash_undefined      || h->root.type == bfd_link_hash_undefweak)    {      isym.n_value = 0;      isym.n_scnum = N_UNDEF;      isym.n_sclass = C_EXT;      aux.x_csect.x_smtyp = XTY_ER;    }  else if (h->root.type == bfd_link_hash_defined	   || h->root.type == bfd_link_hash_defweak)    {      struct xcoff_link_size_list *l;      isym.n_value = (h->root.u.def.section->output_section->vma		      + h->root.u.def.section->output_offset		      + h->root.u.def.value);      isym.n_scnum = h->root.u.def.section->output_section->target_index;      isym.n_sclass = C_HIDEXT;      aux.x_csect.x_smtyp = XTY_SD;      if ((h->flags & XCOFF_HAS_SIZE) != 0)	{	  for (l = xcoff_hash_table (finfo->info)->size_list;	       l != NULL;	       l = l->next)	    {	      if (l->h == h)		{		  aux.x_csect.x_scnlen.l = l->size;		  break;		}	    }	}    }  else if (h->root.type == bfd_link_hash_common)    {      isym.n_value = (h->root.u.c.p->section->output_section->vma		      + h->root.u.c.p->section->output_offset);      isym.n_scnum = h->root.u.c.p->section->output_section->target_index;      isym.n_sclass = C_EXT;      aux.x_csect.x_smtyp = XTY_CM;      aux.x_csect.x_scnlen.l = h->root.u.c.size;    }  else    abort ();  isym.n_type = T_NULL;  isym.n_numaux = 1;  bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) outsym);  outsym += bfd_coff_symesz (output_bfd);  aux.x_csect.x_smclas = h->smclas;  bfd_coff_swap_aux_out (output_bfd, (PTR) &aux, T_NULL, isym.n_sclass, 0, 1,			 (PTR) outsym);  outsym += bfd_coff_auxesz (output_bfd);  if (h->root.type == bfd_link_hash_defined      || h->root.type == bfd_link_hash_defweak)    {      /* We just output an SD symbol.  Now output an LD symbol.  */      h->indx += 2;      isym.n_sclass = C_EXT;      bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) outsym);      outsym += bfd_coff_symesz (output_bfd);      aux.x_csect.x_smtyp = XTY_LD;      aux.x_csect.x_scnlen.l = obj_raw_syment_count (output_bfd);      bfd_coff_swap_aux_out (output_bfd, (PTR) &aux, T_NULL, C_EXT, 0, 1,			     (PTR) outsym);      outsym += bfd_coff_auxesz (output_bfd);    }  if (bfd_seek (output_bfd,		(obj_sym_filepos (output_bfd)		 + (obj_raw_syment_count (output_bfd)		    * bfd_coff_symesz (output_bfd))),		SEEK_SET) != 0      || (bfd_write (finfo->outsyms, outsym - finfo->outsyms, 1, output_bfd)	  != (bfd_size_type) (outsym - finfo->outsyms)))    return false;  obj_raw_syment_count (output_bfd) +=    (outsym - finfo->outsyms) / bfd_coff_symesz (output_bfd);  return true;}