FreeBSD/contrib/binutils/bfd/elf.c
/* Copy data from an indirect symbol to its direct symbol, hiding the
   old indirect symbol.  Also used for copying flags to a weakdef.  */
Copy data from an indirect symbol to its direct symbol, hiding the
old indirect symbol.  Also used for copying flags to a weakdef.
Copy data from an indirect symbol to its direct symbol hiding the old indirect symbol . Also used for copying flags to a weakdef .
void
_bfd_elf_link_hash_copy_indirect (struct bfd_link_info *info,
				  struct elf_link_hash_entry *dir,
				  struct elf_link_hash_entry *ind)
{
  struct elf_link_hash_table *htab;
  dir->ref_dynamic |= ind->ref_dynamic;
  dir->ref_regular |= ind->ref_regular;
  dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
  dir->non_got_ref |= ind->non_got_ref;
  dir->needs_plt |= ind->needs_plt;
  dir->pointer_equality_needed |= ind->pointer_equality_needed;
  if (ind->root.type != bfd_link_hash_indirect)
    return;
  htab = elf_hash_table (info);
  if (ind->got.refcount > htab->init_got_refcount.refcount)
    {
      if (dir->got.refcount < 0)
	dir->got.refcount = 0;
      dir->got.refcount += ind->got.refcount;
      ind->got.refcount = htab->init_got_refcount.refcount;
    }
  if (ind->plt.refcount > htab->init_plt_refcount.refcount)
    {
      if (dir->plt.refcount < 0)
	dir->plt.refcount = 0;
      dir->plt.refcount += ind->plt.refcount;
      ind->plt.refcount = htab->init_plt_refcount.refcount;
    }
  if (ind->dynindx != -1)
    {
      if (dir->dynindx != -1)
	_bfd_elf_strtab_delref (htab->dynstr, dir->dynstr_index);
      dir->dynindx = ind->dynindx;
      dir->dynstr_index = ind->dynstr_index;
      ind->dynindx = -1;
      ind->dynstr_index = 0;
    }
}
void _bfd_elf_link_hash_copy_indirect ( struct bfd_link_info * info , struct elf_link_hash_entry * dir , struct elf_link_hash_entry * ind ) { struct elf_link_hash_table * htab ; dir -> ref_dynamic |= ind -> ref_dynamic ; dir -> ref_regular |= ind -> ref_regular ; dir -> ref_regular_nonweak |= ind -> ref_regular_nonweak ; dir -> non_got_ref |= ind -> non_got_ref ; dir -> needs_plt |= ind -> needs_plt ; dir -> pointer_equality_needed |= ind -> pointer_equality_needed ; if ( ind -> root . type != bfd_link_hash_indirect ) return ; htab = elf_hash_table ( info ) ; if ( ind -> got . refcount > htab -> init_got_refcount . refcount ) { if ( dir -> got . refcount < 0 ) dir -> got . refcount = 0 ; dir -> got . refcount += ind -> got . refcount ; ind -> got . refcount = htab -> init_got_refcount . refcount ; } if ( ind -> plt . refcount > htab -> init_plt_refcount . refcount ) { if ( dir -> plt . refcount < 0 ) dir -> plt . refcount = 0 ; dir -> plt . refcount += ind -> plt . refcount ; ind -> plt . refcount = htab -> init_plt_refcount . refcount ; } if ( ind -> dynindx != -1 ) { if ( dir -> dynindx != -1 ) _bfd_elf_strtab_delref ( htab -> dynstr , dir -> dynstr_index ) ; dir -> dynindx = ind -> dynindx ; dir -> dynstr_index = ind -> dynstr_index ; ind -> dynindx = -1 ; ind -> dynstr_index = 0 ; } }
Copy data from an indirect symbol to its direct symbol, hiding the
old indirect symbol.
Copy data from an indirect symbol to its direct symbol hiding the old indirect symbol .
/* Copy down any references that we may have already seen to the
     symbol which just became indirect.  */ /* Copy over the global and procedure linkage table refcount entries.
     These may have been already set up by a check_relocs routine.  */