FreeBSD/contrib/binutils/bfd/elflink.c
/* This function will be called though elf_link_hash_traverse to store
   all hash value of the exported symbols in an array.  */
This function will be called though elf_link_hash_traverse to store
all hash value of the exported symbols in an array.
This function will be called though elf_link_hash_traverse to store all hash value of the exported symbols in an array .
static bfd_boolean
elf_collect_gnu_hash_codes (struct elf_link_hash_entry *h, void *data)
{
  struct collect_gnu_hash_codes *s = data;
  const char *name;
  char *p;
  unsigned long ha;
  char *alc = NULL;
  if (h->root.type == bfd_link_hash_warning)
    h = (struct elf_link_hash_entry *) h->root.u.i.link;
  if (h->dynindx == -1)
    return TRUE;
  if (! (*s->bed->elf_hash_symbol) (h))
    return TRUE;
  name = h->root.root.string;
  p = strchr (name, ELF_VER_CHR);
  if (p != NULL)
    {
      alc = bfd_malloc (p - name + 1);
      memcpy (alc, name, p - name);
      alc[p - name] = '\0';
      name = alc;
    }
  ha = bfd_elf_gnu_hash (name);
  s->hashcodes[s->nsyms] = ha;
  s->hashval[h->dynindx] = ha;
  ++s->nsyms;
  if (s->min_dynindx < 0 || s->min_dynindx > h->dynindx)
    s->min_dynindx = h->dynindx;
  if (alc != NULL)
    free (alc);
  return TRUE;
}
static bfd_boolean elf_collect_gnu_hash_codes ( struct elf_link_hash_entry * h , void * data ) { struct collect_gnu_hash_codes * s = data ; const char * name ; char * p ; unsigned long ha ; char * alc = NULL ; if ( h -> root . type == bfd_link_hash_warning ) h = ( struct elf_link_hash_entry * ) h -> root . u . i . link ; if ( h -> dynindx == -1 ) return TRUE ; if ( ! ( * s -> bed -> elf_hash_symbol ) ( h ) ) return TRUE ; name = h -> root . root . string ; p = strchr ( name , ELF_VER_CHR ) ; if ( p != NULL ) { alc = bfd_malloc ( p - name + 1 ) ; memcpy ( alc , name , p - name ) ; alc [ p - name ] = ' \0 ' ; name = alc ; } ha = bfd_elf_gnu_hash ( name ) ; s -> hashcodes [ s -> nsyms ] = ha ; s -> hashval [ h -> dynindx ] = ha ; ++ s -> nsyms ; if ( s -> min_dynindx < 0 || s -> min_dynindx > h -> dynindx ) s -> min_dynindx = h -> dynindx ; if ( alc != NULL ) free ( alc ) ; return TRUE ; }
This function will be called though elf_link_hash_traverse to store
all hash value of the exported symbols in an array.
This function will be called though elf_link_hash_traverse to store all hash value of the exported symbols in an array .
/* Ignore indirect symbols.  These are added by the versioning code.  */ /* Ignore also local symbols and undefined symbols.  */ /* Compute the hash value.  */ /* Store the found hash value in the array for compute_bucket_count,
     and also for .dynsym reordering purposes.  */