From ead0700b97a141c5f4ae240669952fa09f8d3a99 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 5 Aug 2005 13:52:13 +0000 Subject: bfd/ 2005-08-05 H.J. Lu * bfd.c (bfd_hide_symbol): New. * bfd-in2.h: Regenerated. ld/ 2005-08-05 H.J. Lu * ld.texinfo: Document PROVIDE_HIDDEN. * ldexp.c (exp_fold_tree_1): Hide a provided symbol if asked. (exp_provide): Add and set hidden. * ldexp.h (etree_type): Add hidden to assign. * ldgram.y (PROVIDE_HIDDEN): New. * ldlex.l (PROVIDE_HIDDEN): Likewise. * scripttempl/elf.sc: Use PROVIDE_HIDDEN on array bound symbols. --- bfd/ChangeLog | 5 +++++ bfd/bfd-in2.h | 4 ++++ bfd/bfd.c | 26 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index db023c91c9..ced5b40767 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2005-08-05 H.J. Lu + + * bfd.c (bfd_hide_symbol): New. + * bfd-in2.h: Regenerated. + 2005-08-04 H.J. Lu * elf64-x86-64.c (elf64_x86_64_merge_symbol): When mixing a diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 8ca1d6f8b1..1c99cc20e4 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -4486,6 +4486,10 @@ void bfd_preserve_restore (bfd *, struct bfd_preserve *); void bfd_preserve_finish (bfd *, struct bfd_preserve *); +void bfd_hide_symbol + (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *, bfd_boolean); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); diff --git a/bfd/bfd.c b/bfd/bfd.c index 908d79471f..c8be7396cc 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -1508,3 +1508,29 @@ bfd_preserve_finish (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_preserve *preserve) objalloc. */ bfd_hash_table_free (&preserve->section_htab); } + +/* +FUNCTION + bfd_hide_symbol + +SYNOPSIS + void bfd_hide_symbol (bfd *, + struct bfd_link_info *, + struct bfd_link_hash_entry *, + bfd_boolean); + +DESCRIPTION + This function hides a symbol so that it won't be exported. + +*/ + +void +bfd_hide_symbol (bfd *abfd, + struct bfd_link_info *link_info, + struct bfd_link_hash_entry *h, + bfd_boolean force_local) +{ + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) + (get_elf_backend_data (abfd)->elf_backend_hide_symbol) + (link_info, (struct elf_link_hash_entry *) h, force_local); +} -- cgit v1.2.1