FreeBSD/contrib/binutils/bfd/elflink.c
/* This routine is used to export all defined symbols into the dynamic
   symbol table.  It is called via elf_link_hash_traverse.  */
This routine is used to export all defined symbols into the dynamic
symbol table.  It is called via elf_link_hash_traverse.
This routine is used to export all defined symbols into the dynamic symbol table . It is called via elf_link_hash_traverse .
bfd_boolean
_bfd_elf_export_symbol (struct elf_link_hash_entry *h, void *data)
{
  struct elf_info_failed *eif = data;
  if (!eif->info->export_dynamic && !h->dynamic)
    return TRUE;
  if (h->root.type == bfd_link_hash_indirect)
    return TRUE;
  if (h->root.type == bfd_link_hash_warning)
    h = (struct elf_link_hash_entry *) h->root.u.i.link;
  if (h->dynindx == -1
      && (h->def_regular
	  || h->ref_regular))
    {
      struct bfd_elf_version_tree *t;
      struct bfd_elf_version_expr *d;
      for (t = eif->verdefs; t != NULL; t = t->next)
	{
	  if (t->globals.list != NULL)
	    {
	      d = (*t->match) (&t->globals, NULL, h->root.root.string);
	      if (d != NULL)
		goto doit;
	    }
	  if (t->locals.list != NULL)
	    {
	      d = (*t->match) (&t->locals, NULL, h->root.root.string);
	      if (d != NULL)
		return TRUE;
	    }
	}
      if (!eif->verdefs)
	{
	doit:
	  if (! bfd_elf_link_record_dynamic_symbol (eif->info, h))
	    {
	      eif->failed = TRUE;
	      return FALSE;
	    }
	}
    }
  return TRUE;
}
bfd_boolean _bfd_elf_export_symbol ( struct elf_link_hash_entry * h , void * data ) { struct elf_info_failed * eif = data ; if ( ! eif -> info -> export_dynamic && ! h -> dynamic ) return TRUE ; if ( h -> root . type == bfd_link_hash_indirect ) return TRUE ; if ( h -> root . type == bfd_link_hash_warning ) h = ( struct elf_link_hash_entry * ) h -> root . u . i . link ; if ( h -> dynindx == -1 && ( h -> def_regular || h -> ref_regular ) ) { struct bfd_elf_version_tree * t ; struct bfd_elf_version_expr * d ; for ( t = eif -> verdefs ; t != NULL ; t = t -> next ) { if ( t -> globals . list != NULL ) { d = ( * t -> match ) ( & t -> globals , NULL , h -> root . root . string ) ; if ( d != NULL ) goto doit ; } if ( t -> locals . list != NULL ) { d = ( * t -> match ) ( & t -> locals , NULL , h -> root . root . string ) ; if ( d != NULL ) return TRUE ; } } if ( ! eif -> verdefs ) { doit : if ( ! bfd_elf_link_record_dynamic_symbol ( eif -> info , h ) ) { eif -> failed = TRUE ; return FALSE ; } } } return TRUE ; }
This routine is used to export all defined symbols into the dynamic
symbol table.
This routine is used to export all defined symbols into the dynamic symbol table .
/* Ignore this if we won't export it.  */ /* Ignore indirect symbols.  These are added by the versioning code.  */