FreeBSD/contrib/binutils/bfd/elflink.c
/* Look through the symbols which are defined in other shared
   libraries and referenced here.  Update the list of version
   dependencies.  This will be put into the .gnu.version_r section.
   This function is called via elf_link_hash_traverse.  */
Look through the symbols which are defined in other shared
libraries and referenced here.  Update the list of version
dependencies.  This will be put into the .gnu.version_r section.
This function is called via elf_link_hash_traverse.
Look through the symbols which are defined in other shared libraries and referenced here . Update the list of version dependencies . This will be put into the . gnu . version_r section . This function is called via elf_link_hash_traverse .
bfd_boolean
_bfd_elf_link_find_version_dependencies (struct elf_link_hash_entry *h,
					 void *data)
{
  struct elf_find_verdep_info *rinfo = data;
  Elf_Internal_Verneed *t;
  Elf_Internal_Vernaux *a;
  bfd_size_type amt;
  if (h->root.type == bfd_link_hash_warning)
    h = (struct elf_link_hash_entry *) h->root.u.i.link;
  if (!h->def_dynamic
      || h->def_regular
      || h->dynindx == -1
      || h->verinfo.verdef == NULL)
    return TRUE;
  for (t = elf_tdata (rinfo->output_bfd)->verref; t != NULL; t = t->vn_nextref)
    {
      if (t->vn_bfd != h->verinfo.verdef->vd_bfd)
	continue;
      for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
	if (a->vna_nodename == h->verinfo.verdef->vd_nodename)
	  return TRUE;
      break;
    }
  if (t == NULL)
    {
      amt = sizeof *t;
      t = bfd_zalloc (rinfo->output_bfd, amt);
      if (t == NULL)
	{
	  rinfo->failed = TRUE;
	  return FALSE;
	}
      t->vn_bfd = h->verinfo.verdef->vd_bfd;
      t->vn_nextref = elf_tdata (rinfo->output_bfd)->verref;
      elf_tdata (rinfo->output_bfd)->verref = t;
    }
  amt = sizeof *a;
  a = bfd_zalloc (rinfo->output_bfd, amt);
  a->vna_nodename = h->verinfo.verdef->vd_nodename;
  a->vna_flags = h->verinfo.verdef->vd_flags;
  a->vna_nextptr = t->vn_auxptr;
  h->verinfo.verdef->vd_exp_refno = rinfo->vers;
  ++rinfo->vers;
  a->vna_other = h->verinfo.verdef->vd_exp_refno + 1;
  t->vn_auxptr = a;
  return TRUE;
}
bfd_boolean _bfd_elf_link_find_version_dependencies ( struct elf_link_hash_entry * h , void * data ) { struct elf_find_verdep_info * rinfo = data ; Elf_Internal_Verneed * t ; Elf_Internal_Vernaux * a ; bfd_size_type amt ; if ( h -> root . type == bfd_link_hash_warning ) h = ( struct elf_link_hash_entry * ) h -> root . u . i . link ; if ( ! h -> def_dynamic || h -> def_regular || h -> dynindx == -1 || h -> verinfo . verdef == NULL ) return TRUE ; for ( t = elf_tdata ( rinfo -> output_bfd ) -> verref ; t != NULL ; t = t -> vn_nextref ) { if ( t -> vn_bfd != h -> verinfo . verdef -> vd_bfd ) continue ; for ( a = t -> vn_auxptr ; a != NULL ; a = a -> vna_nextptr ) if ( a -> vna_nodename == h -> verinfo . verdef -> vd_nodename ) return TRUE ; break ; } if ( t == NULL ) { amt = sizeof * t ; t = bfd_zalloc ( rinfo -> output_bfd , amt ) ; if ( t == NULL ) { rinfo -> failed = TRUE ; return FALSE ; } t -> vn_bfd = h -> verinfo . verdef -> vd_bfd ; t -> vn_nextref = elf_tdata ( rinfo -> output_bfd ) -> verref ; elf_tdata ( rinfo -> output_bfd ) -> verref = t ; } amt = sizeof * a ; a = bfd_zalloc ( rinfo -> output_bfd , amt ) ; a -> vna_nodename = h -> verinfo . verdef -> vd_nodename ; a -> vna_flags = h -> verinfo . verdef -> vd_flags ; a -> vna_nextptr = t -> vn_auxptr ; h -> verinfo . verdef -> vd_exp_refno = rinfo -> vers ; ++ rinfo -> vers ; a -> vna_other = h -> verinfo . verdef -> vd_exp_refno + 1 ; t -> vn_auxptr = a ; return TRUE ; }
Look through the symbols which are defined in other shared
libraries and referenced here.
Look through the symbols which are defined in other shared libraries and referenced here .
/* We only care about symbols defined in shared objects with version
     information.  */ /* See if we already know about this version.  */ /* This is a new version.  Add it to tree we are building.  */ /* Note that we are copying a string pointer here, and testing it
     above.  If bfd_elf_string_from_elf_section is ever changed to
     discard the string data when low in memory, this will have to be
     fixed.  */