FreeBSD/contrib/binutils/bfd/elflink.c
/* Returns false if the symbol referred to by H should be considered
   to resolve local to the current module, and true if it should be
   considered to bind dynamically.  */
Returns false if the symbol referred to by H should be considered
to resolve local to the current module, and true if it should be
considered to bind dynamically.
Returns false if the symbol referred to by H should be considered to resolve local to the current module and true if it should be considered to bind dynamically .
bfd_boolean
_bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
			   struct bfd_link_info *info,
			   bfd_boolean ignore_protected)
{
  bfd_boolean binding_stays_local_p;
  const struct elf_backend_data *bed;
  struct elf_link_hash_table *hash_table;
  if (h == NULL)
    return FALSE;
  while (h->root.type == bfd_link_hash_indirect
	 || h->root.type == bfd_link_hash_warning)
    h = (struct elf_link_hash_entry *) h->root.u.i.link;
  if (h->dynindx == -1)
    return FALSE;
  if (h->forced_local)
    return FALSE;
  binding_stays_local_p = info->executable || SYMBOLIC_BIND (info, h);
  switch (ELF_ST_VISIBILITY (h->other))
    {
    case STV_INTERNAL:
    case STV_HIDDEN:
      return FALSE;
    case STV_PROTECTED:
      hash_table = elf_hash_table (info);
      if (!is_elf_hash_table (hash_table))
	return FALSE;
      bed = get_elf_backend_data (hash_table->dynobj);
      if (!ignore_protected || !bed->is_function_type (h->type))
	binding_stays_local_p = TRUE;
      break;
    default:
      break;
    }
  if (!h->def_regular)
    return TRUE;
  return !binding_stays_local_p;
}
bfd_boolean _bfd_elf_dynamic_symbol_p ( struct elf_link_hash_entry * h , struct bfd_link_info * info , bfd_boolean ignore_protected ) { bfd_boolean binding_stays_local_p ; const struct elf_backend_data * bed ; struct elf_link_hash_table * hash_table ; if ( h == NULL ) return FALSE ; while ( h -> root . type == bfd_link_hash_indirect || h -> root . type == bfd_link_hash_warning ) h = ( struct elf_link_hash_entry * ) h -> root . u . i . link ; if ( h -> dynindx == -1 ) return FALSE ; if ( h -> forced_local ) return FALSE ; binding_stays_local_p = info -> executable || SYMBOLIC_BIND ( info , h ) ; switch ( ELF_ST_VISIBILITY ( h -> other ) ) { case STV_INTERNAL : case STV_HIDDEN : return FALSE ; case STV_PROTECTED : hash_table = elf_hash_table ( info ) ; if ( ! is_elf_hash_table ( hash_table ) ) return FALSE ; bed = get_elf_backend_data ( hash_table -> dynobj ) ; if ( ! ignore_protected || ! bed -> is_function_type ( h -> type ) ) binding_stays_local_p = TRUE ; break ; default : break ; } if ( ! h -> def_regular ) return TRUE ; return ! binding_stays_local_p ; }
Returns false if the symbol referred to by H should be considered
to resolve local to the current module, and true if it should be
considered to bind dynamically.
Returns false if the symbol referred to by H should be considered to resolve local to the current module and true if it should be considered to bind dynamically .
/* If it was forced local, then clearly it's not dynamic.  */ /* Identify the cases where name binding rules say that a
     visible symbol resolves locally.  */ /* Proper resolution for function pointer equality may require
	 that these symbols perhaps be resolved dynamically, even though
	 we should be resolving them to the current module.  */ /* If it isn't defined locally, then clearly it's dynamic.  */ /* Otherwise, the symbol is dynamic if binding rules don't tell
     us that it remains local.  */