FreeBSD/contrib/binutils/bfd/elflink.c
/* Return true if the symbol referred to by H should be considered
   to resolve local to the current module, and false otherwise.  Differs
   from (the inverse of) _bfd_elf_dynamic_symbol_p in the treatment of
   undefined symbols and weak symbols.  */
Return true if the symbol referred to by H should be considered
to resolve local to the current module, and false otherwise.  Differs
from (the inverse of) _bfd_elf_dynamic_symbol_p in the treatment of
undefined symbols and weak symbols.
Return true if the symbol referred to by H should be considered to resolve local to the current module and false otherwise . Differs from ( the inverse of ) _bfd_elf_dynamic_symbol_p in the treatment of undefined symbols and weak symbols .
bfd_boolean
_bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h,
			      struct bfd_link_info *info,
			      bfd_boolean local_protected)
{
  const struct elf_backend_data *bed;
  struct elf_link_hash_table *hash_table;
  if (h == NULL)
    return TRUE;
  if (ELF_COMMON_DEF_P (h))
    ;
  else if (!h->def_regular)
    return FALSE;
  if (h->forced_local)
    return TRUE;
  if (h->dynindx == -1)
    return TRUE;
  if (info->executable || SYMBOLIC_BIND (info, h))
    return TRUE;
  if (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
    return FALSE;
  if (ELF_ST_VISIBILITY (h->other) != STV_PROTECTED)
    return TRUE;
  hash_table = elf_hash_table (info);
  if (!is_elf_hash_table (hash_table))
    return TRUE;
  bed = get_elf_backend_data (hash_table->dynobj);
  if (!bed->is_function_type (h->type))
    return TRUE;
  return local_protected;
}
bfd_boolean _bfd_elf_symbol_refs_local_p ( struct elf_link_hash_entry * h , struct bfd_link_info * info , bfd_boolean local_protected ) { const struct elf_backend_data * bed ; struct elf_link_hash_table * hash_table ; if ( h == NULL ) return TRUE ; if ( ELF_COMMON_DEF_P ( h ) ) ; else if ( ! h -> def_regular ) return FALSE ; if ( h -> forced_local ) return TRUE ; if ( h -> dynindx == -1 ) return TRUE ; if ( info -> executable || SYMBOLIC_BIND ( info , h ) ) return TRUE ; if ( ELF_ST_VISIBILITY ( h -> other ) == STV_DEFAULT ) return FALSE ; if ( ELF_ST_VISIBILITY ( h -> other ) != STV_PROTECTED ) return TRUE ; hash_table = elf_hash_table ( info ) ; if ( ! is_elf_hash_table ( hash_table ) ) return TRUE ; bed = get_elf_backend_data ( hash_table -> dynobj ) ; if ( ! bed -> is_function_type ( h -> type ) ) return TRUE ; return local_protected ; }
Return true if the symbol referred to by H should be considered
to resolve local to the current module, and false otherwise.
Return true if the symbol referred to by H should be considered to resolve local to the current module and false otherwise .
/* If it's a local sym, of course we resolve locally.  */ /* Common symbols that become definitions don't get the DEF_REGULAR
     flag set, so test it first, and don't bail out.  */ /* Do nothing.  */ /* If we don't have a definition in a regular file, then we can't
     resolve locally.  The sym is either undefined or dynamic.  */ /* Forced local symbols resolve locally.  */ /* As do non-dynamic symbols.  */ /* At this point, we know the symbol is defined and dynamic.  In an
     executable it must resolve locally, likewise when building symbolic
     shared libraries.  */ /* Now deal with defined dynamic symbols in shared libraries.  Ones
     with default visibility might not resolve locally.  */ /* However, STV_HIDDEN or STV_INTERNAL ones must be local.  */ /* STV_PROTECTED non-function symbols are local.  */ /* Function pointer equality tests may require that STV_PROTECTED
     symbols be treated as dynamic symbols, even when we know that the
     dynamic linker will resolve them locally.  */