FreeBSD/contrib/binutils/bfd/elflink.c
/* This function will be called though elf_link_hash_traverse to do
   final dynaminc symbol renumbering.  */
This function will be called though elf_link_hash_traverse to do
final dynaminc symbol renumbering.
This function will be called though elf_link_hash_traverse to do final dynaminc symbol renumbering .
static bfd_boolean
elf_renumber_gnu_hash_syms (struct elf_link_hash_entry *h, void *data)
{
  struct collect_gnu_hash_codes *s = data;
  unsigned long int bucket;
  unsigned long int val;
  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))
    {
      if (h->dynindx >= s->min_dynindx)
	h->dynindx = s->local_indx++;
      return TRUE;
    }
  bucket = s->hashval[h->dynindx] % s->bucketcount;
  val = (s->hashval[h->dynindx] >> s->shift1)
	& ((s->maskbits >> s->shift1) - 1);
  s->bitmask[val] |= ((bfd_vma) 1) << (s->hashval[h->dynindx] & s->mask);
  s->bitmask[val]
    |= ((bfd_vma) 1) << ((s->hashval[h->dynindx] >> s->shift2) & s->mask);
  val = s->hashval[h->dynindx] & ~(unsigned long int) 1;
  if (s->counts[bucket] == 1)
    val |= 1;
  bfd_put_32 (s->output_bfd, val,
	      s->contents + (s->indx[bucket] - s->symindx) * 4);
  --s->counts[bucket];
  h->dynindx = s->indx[bucket]++;
  return TRUE;
}
static bfd_boolean elf_renumber_gnu_hash_syms ( struct elf_link_hash_entry * h , void * data ) { struct collect_gnu_hash_codes * s = data ; unsigned long int bucket ; unsigned long int val ; 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 ) ) { if ( h -> dynindx >= s -> min_dynindx ) h -> dynindx = s -> local_indx ++ ; return TRUE ; } bucket = s -> hashval [ h -> dynindx ] % s -> bucketcount ; val = ( s -> hashval [ h -> dynindx ] >> s -> shift1 ) & ( ( s -> maskbits >> s -> shift1 ) - 1 ) ; s -> bitmask [ val ] |= ( ( bfd_vma ) 1 ) << ( s -> hashval [ h -> dynindx ] & s -> mask ) ; s -> bitmask [ val ] |= ( ( bfd_vma ) 1 ) << ( ( s -> hashval [ h -> dynindx ] >> s -> shift2 ) & s -> mask ) ; val = s -> hashval [ h -> dynindx ] & ~ ( unsigned long int ) 1 ; if ( s -> counts [ bucket ] == 1 ) val |= 1 ; bfd_put_32 ( s -> output_bfd , val , s -> contents + ( s -> indx [ bucket ] - s -> symindx ) * 4 ) ; -- s -> counts [ bucket ] ; h -> dynindx = s -> indx [ bucket ] ++ ; return TRUE ; }
This function will be called though elf_link_hash_traverse to do
final dynaminc symbol renumbering.
This function will be called though elf_link_hash_traverse to do final dynaminc symbol renumbering .
/* Ignore indirect symbols.  */ /* Ignore also local symbols and undefined symbols.  */ /* Last element terminates the chain.  */