FreeBSD/contrib/binutils/bfd/elflink.c
/* Return the linker hash table entry of a symbol that might be
   satisfied by an archive symbol.  Return -1 on error.  */
Return the linker hash table entry of a symbol that might be
satisfied by an archive symbol.  Return -1 on error.
Return the linker hash table entry of a symbol that might be satisfied by an archive symbol . Return - 1 on error .
struct elf_link_hash_entry *
_bfd_elf_archive_symbol_lookup (bfd *abfd,
				struct bfd_link_info *info,
				const char *name)
{
  struct elf_link_hash_entry *h;
  char *p, *copy;
  size_t len, first;
  h = elf_link_hash_lookup (elf_hash_table (info), name, FALSE, FALSE, FALSE);
  if (h != NULL)
    return h;
  p = strchr (name, ELF_VER_CHR);
  if (p == NULL || p[1] != ELF_VER_CHR)
    return h;
  len = strlen (name);
  copy = bfd_alloc (abfd, len);
  if (copy == NULL)
    return (struct elf_link_hash_entry *) 0 - 1;
  first = p - name + 1;
  memcpy (copy, name, first);
  memcpy (copy + first, name + first + 1, len - first);
  h = elf_link_hash_lookup (elf_hash_table (info), copy, FALSE, FALSE, FALSE);
  if (h == NULL)
    {
      copy[first - 1] = '\0';
      h = elf_link_hash_lookup (elf_hash_table (info), copy,
				FALSE, FALSE, FALSE);
    }
  bfd_release (abfd, copy);
  return h;
}
struct elf_link_hash_entry * _bfd_elf_archive_symbol_lookup ( bfd * abfd , struct bfd_link_info * info , const char * name ) { struct elf_link_hash_entry * h ; char * p , * copy ; size_t len , first ; h = elf_link_hash_lookup ( elf_hash_table ( info ) , name , FALSE , FALSE , FALSE ) ; if ( h != NULL ) return h ; p = strchr ( name , ELF_VER_CHR ) ; if ( p == NULL || p [ 1 ] != ELF_VER_CHR ) return h ; len = strlen ( name ) ; copy = bfd_alloc ( abfd , len ) ; if ( copy == NULL ) return ( struct elf_link_hash_entry * ) 0 - 1 ; first = p - name + 1 ; memcpy ( copy , name , first ) ; memcpy ( copy + first , name + first + 1 , len - first ) ; h = elf_link_hash_lookup ( elf_hash_table ( info ) , copy , FALSE , FALSE , FALSE ) ; if ( h == NULL ) { copy [ first - 1 ] = ' \0 ' ; h = elf_link_hash_lookup ( elf_hash_table ( info ) , copy , FALSE , FALSE , FALSE ) ; } bfd_release ( abfd , copy ) ; return h ; }
Return the linker hash table entry of a symbol that might be
satisfied by an archive symbol.
Return the linker hash table entry of a symbol that might be satisfied by an archive symbol .
/* If this is a default version (the name contains @@), look up the
     symbol again with only one `@' as well as without the version.
     The effect is that references to the symbol with and without the
     version will be matched by the default symbol in the archive.  */ /* First check with only one `@'.  */ /* We also need to check references to the symbol without the
	 version.  */