FreeBSD/contrib/binutils/bfd/elflink.c
/* Define a symbol in a dynamic linkage section.  */
Define a symbol in a dynamic linkage section.
Define a symbol in a dynamic linkage section .
struct elf_link_hash_entry *
_bfd_elf_define_linkage_sym (bfd *abfd,
			     struct bfd_link_info *info,
			     asection *sec,
			     const char *name)
{
  struct elf_link_hash_entry *h;
  struct bfd_link_hash_entry *bh;
  const struct elf_backend_data *bed;
  h = elf_link_hash_lookup (elf_hash_table (info), name, FALSE, FALSE, FALSE);
  if (h != NULL)
    {
      h->root.type = bfd_link_hash_new;
    }
  bh = &h->root;
  if (!_bfd_generic_link_add_one_symbol (info, abfd, name, BSF_GLOBAL,
					 sec, 0, NULL, FALSE,
					 get_elf_backend_data (abfd)->collect,
					 &bh))
    return NULL;
  h = (struct elf_link_hash_entry *) bh;
  h->def_regular = 1;
  h->type = STT_OBJECT;
  h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN;
  bed = get_elf_backend_data (abfd);
  (*bed->elf_backend_hide_symbol) (info, h, TRUE);
  return h;
}
struct elf_link_hash_entry * _bfd_elf_define_linkage_sym ( bfd * abfd , struct bfd_link_info * info , asection * sec , const char * name ) { struct elf_link_hash_entry * h ; struct bfd_link_hash_entry * bh ; const struct elf_backend_data * bed ; h = elf_link_hash_lookup ( elf_hash_table ( info ) , name , FALSE , FALSE , FALSE ) ; if ( h != NULL ) { h -> root . type = bfd_link_hash_new ; } bh = & h -> root ; if ( ! _bfd_generic_link_add_one_symbol ( info , abfd , name , BSF_GLOBAL , sec , 0 , NULL , FALSE , get_elf_backend_data ( abfd ) -> collect , & bh ) ) return NULL ; h = ( struct elf_link_hash_entry * ) bh ; h -> def_regular = 1 ; h -> type = STT_OBJECT ; h -> other = ( h -> other & ~ ELF_ST_VISIBILITY ( -1 ) ) | STV_HIDDEN ; bed = get_elf_backend_data ( abfd ) ; ( * bed -> elf_backend_hide_symbol ) ( info , h , TRUE ) ; return h ; }
Define a symbol in a dynamic linkage section.
Define a symbol in a dynamic linkage section .
/* Zap symbol defined in an as-needed lib that wasn't linked.
	 This is a symptom of a larger problem:  Absolute symbols
	 defined in shared libraries can't be overridden, because we
	 lose the link to the bfd which is via the symbol section.  */