{ bfd_set_error (bfd_error_no_memory); return (struct bfd_hash_entry *) ret; }
return (struct bfd_hash_entry *) ret;
static struct bfd_hash_entry *xcoff_link_hash_newfunc  PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));static struct internal_reloc *xcoff_read_internal_relocs  PARAMS ((bfd *, asection *, boolean, bfd_byte *, boolean,	   struct internal_reloc *));static boolean xcoff_link_add_object_symbols  PARAMS ((bfd *, struct bfd_link_info *));static boolean xcoff_link_check_archive_element  PARAMS ((bfd *, struct bfd_link_info *, boolean *));static boolean xcoff_link_check_ar_symbols  PARAMS ((bfd *, struct bfd_link_info *, boolean *));static bfd_size_type xcoff_find_reloc  PARAMS ((struct internal_reloc *, bfd_size_type, bfd_vma));static boolean xcoff_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *));static boolean xcoff_link_add_dynamic_symbols  PARAMS ((bfd *, struct bfd_link_info *));static boolean xcoff_mark PARAMS ((struct bfd_link_info *, asection *));static void xcoff_sweep PARAMS ((struct bfd_link_info *));static boolean xcoff_build_ldsyms  PARAMS ((struct xcoff_link_hash_entry *, PTR));static boolean xcoff_link_input_bfd  PARAMS ((struct xcoff_final_link_info *, bfd *));static boolean xcoff_write_global_symbol  PARAMS ((struct xcoff_link_hash_entry *, PTR));static boolean xcoff_reloc_link_order  PARAMS ((bfd *, struct xcoff_final_link_info *, asection *,	   struct bfd_link_order *));static int xcoff_sort_relocs PARAMS ((const PTR, const PTR));/* Routines to swap information in the XCOFF .loader section.  If we   ever need to write an XCOFF loader, this stuff will need to be   moved to another file shared by the linker (which XCOFF calls the   ``binder'') and the loader.  *//* Swap in the ldhdr structure.  */static voidxcoff_swap_ldhdr_in (abfd, src, dst)     bfd *abfd;     const struct external_ldhdr *src;     struct internal_ldhdr *dst;{  dst->l_version = bfd_get_32 (abfd, src->l_version);  dst->l_nsyms = bfd_get_32 (abfd, src->l_nsyms);  dst->l_nreloc = bfd_get_32 (abfd, src->l_nreloc);  dst->l_istlen = bfd_get_32 (abfd, src->l_istlen);  dst->l_nimpid = bfd_get_32 (abfd, src->l_nimpid);  dst->l_impoff = bfd_get_32 (abfd, src->l_impoff);  dst->l_stlen = bfd_get_32 (abfd, src->l_stlen);  dst->l_stoff = bfd_get_32 (abfd, src->l_stoff);}/* Swap out the ldhdr structure.  */static voidxcoff_swap_ldhdr_out (abfd, src, dst)     bfd *abfd;     const struct internal_ldhdr *src;     struct external_ldhdr *dst;{  bfd_put_32 (abfd, src->l_version, dst->l_version);  bfd_put_32 (abfd, src->l_nsyms, dst->l_nsyms);  bfd_put_32 (abfd, src->l_nreloc, dst->l_nreloc);  bfd_put_32 (abfd, src->l_istlen, dst->l_istlen);  bfd_put_32 (abfd, src->l_nimpid, dst->l_nimpid);  bfd_put_32 (abfd, src->l_impoff, dst->l_impoff);  bfd_put_32 (abfd, src->l_stlen, dst->l_stlen);  bfd_put_32 (abfd, src->l_stoff, dst->l_stoff);}/* Swap in the ldsym structure.  */static voidxcoff_swap_ldsym_in (abfd, src, dst)     bfd *abfd;     const struct external_ldsym *src;     struct internal_ldsym *dst;{  if (bfd_get_32 (abfd, src->_l._l_l._l_zeroes) != 0)    memcpy (dst->_l._l_name, src->_l._l_name, SYMNMLEN);  else    {      dst->_l._l_l._l_zeroes = 0;      dst->_l._l_l._l_offset = bfd_get_32 (abfd, src->_l._l_l._l_offset);    }  dst->l_value = bfd_get_32 (abfd, src->l_value);  dst->l_scnum = bfd_get_16 (abfd, src->l_scnum);  dst->l_smtype = bfd_get_8 (abfd, src->l_smtype);  dst->l_smclas = bfd_get_8 (abfd, src->l_smclas);  dst->l_ifile = bfd_get_32 (abfd, src->l_ifile);  dst->l_parm = bfd_get_32 (abfd, src->l_parm);}/* Swap out the ldsym structure.  */static voidxcoff_swap_ldsym_out (abfd, src, dst)     bfd *abfd;     const struct internal_ldsym *src;     struct external_ldsym *dst;{  if (src->_l._l_l._l_zeroes != 0)    memcpy (dst->_l._l_name, src->_l._l_name, SYMNMLEN);  else    {      bfd_put_32 (abfd, 0, dst->_l._l_l._l_zeroes);      bfd_put_32 (abfd, src->_l._l_l._l_offset, dst->_l._l_l._l_offset);    }  bfd_put_32 (abfd, src->l_value, dst->l_value);  bfd_put_16 (abfd, src->l_scnum, dst->l_scnum);  bfd_put_8 (abfd, src->l_smtype, dst->l_smtype);  bfd_put_8 (abfd, src->l_smclas, dst->l_smclas);  bfd_put_32 (abfd, src->l_ifile, dst->l_ifile);  bfd_put_32 (abfd, src->l_parm, dst->l_parm);}/* As it happens, we never need to swap in the ldrel structure.  *//* Swap out the ldrel structure.  */static voidxcoff_swap_ldrel_out (abfd, src, dst)     bfd *abfd;     const struct internal_ldrel *src;     struct external_ldrel *dst;{  bfd_put_32 (abfd, src->l_vaddr, dst->l_vaddr);  bfd_put_32 (abfd, src->l_symndx, dst->l_symndx);  bfd_put_16 (abfd, src->l_rtype, dst->l_rtype);  bfd_put_16 (abfd, src->l_rsecnm, dst->l_rsecnm);}/* Routine to create an entry in an XCOFF link hash table.  */static struct bfd_hash_entry *xcoff_link_hash_newfunc (entry, table, string)     struct bfd_hash_entry *entry;     struct bfd_hash_table *table;     const char *string;{  struct xcoff_link_hash_entry *ret = (struct xcoff_link_hash_entry *) entry;  /* Allocate the structure if it has not already been allocated by a     subclass.  */  if (ret == (struct xcoff_link_hash_entry *) NULL)    ret = ((struct xcoff_link_hash_entry *)	   bfd_hash_allocate (table, sizeof (struct xcoff_link_hash_entry)));  if (ret == (struct xcoff_link_hash_entry *) NULL)    {      bfd_set_error (bfd_error_no_memory);      return (struct bfd_hash_entry *) ret;    }  /* Call the allocation method of the superclass.  */  ret = ((struct xcoff_link_hash_entry *)	 _bfd_link_hash_newfunc ((struct bfd_hash_entry *) ret,				 table, string));  if (ret != NULL)    {      /* Set local fields.  */      ret->indx = -1;      ret->toc_section = NULL;      ret->u.toc_indx = -1;      ret->descriptor = NULL;      ret->ldsym = NULL;      ret->ldindx = -1;      ret->flags = 0;      ret->smclas = XMC_UA;    }  return (struct bfd_hash_entry *) ret;}