bfd/
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 7 Dec 2005 14:43:54 +0000 (14:43 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 7 Dec 2005 14:43:54 +0000 (14:43 +0000)
2005-12-07  Thiemo Seufer  <ths@networkno.de>
    H.J. Lu  <hongjiu.lu@intel.com>

PR ld/1932
* bfd-in.h (bfd_elf_record_link_assignment): Add output_bfd
and hidden arguments.

* bfd.c (bfd_hide_symbol): Removed.

* bfd-in2.h: Regenerated.

* elflink.c (bfd_elf_record_link_assignment): Handle hidden
symbols which were provided by a linker script.

ld/

2005-12-07  Thiemo Seufer  <ths@networkno.de>
    H.J. Lu  <hongjiu.lu@intel.com>

PR ld/1932
* emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment):
Adjust bfd_elf_record_link_assignment call.

* ldexp.c (exp_fold_tree_1): Remove call to bfd_hide_symbol.

bfd/ChangeLog
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/bfd.c
bfd/elflink.c
ld/ChangeLog
ld/emultempl/elf32.em
ld/ldexp.c

index eeae34fc9790564a304dfc1e766e7d9a45329f3f..e34e2dba24b42c22d6cf6238f665ee7ec5e5931c 100644 (file)
@@ -1,3 +1,17 @@
+2005-12-07  Thiemo Seufer  <ths@networkno.de>
+           H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/1932
+       * bfd-in.h (bfd_elf_record_link_assignment): Add output_bfd
+       and hidden arguments.
+
+       * bfd.c (bfd_hide_symbol): Removed.
+
+       * bfd-in2.h: Regenerated.
+
+       * elflink.c (bfd_elf_record_link_assignment): Handle hidden
+       symbols which were provided by a linker script.
+
 2005-12-06  Paul Gilliam  <pgilliam@us.ibm.com>
 
        * cpu-powerpc.c (bfd_powerpc_archs): Add ppc 750.
index eaecb920047b1fc0accb0c9372ad1ae11c580089..74aded86db7d35a5d86cc2f956aab9db36a6fb2e 100644 (file)
@@ -633,7 +633,8 @@ enum dynamic_lib_link_class {
 };
 
 extern bfd_boolean bfd_elf_record_link_assignment
-  (struct bfd_link_info *, const char *, bfd_boolean);
+  (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
+   bfd_boolean);
 extern struct bfd_link_needed_list *bfd_elf_get_needed_list
   (bfd *, struct bfd_link_info *);
 extern bfd_boolean bfd_elf_get_bfd_needed_list
index 81fb66627dfd9240e3f21a9315bfa4a850a6c03e..fc02ecf96a03a1c765eef25e4928493e89da5f5f 100644 (file)
@@ -640,7 +640,8 @@ enum dynamic_lib_link_class {
 };
 
 extern bfd_boolean bfd_elf_record_link_assignment
-  (struct bfd_link_info *, const char *, bfd_boolean);
+  (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
+   bfd_boolean);
 extern struct bfd_link_needed_list *bfd_elf_get_needed_list
   (bfd *, struct bfd_link_info *);
 extern bfd_boolean bfd_elf_get_bfd_needed_list
@@ -4613,11 +4614,6 @@ 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);
index 3783ccfc39dcee73db971667dea529fa1d7782e8..af1b730d4f3c3a9d9df025fce8ee4bcdf32f32f2 100644 (file)
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -1511,29 +1511,3 @@ 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);
-}
index 1fcfce352d8989abc781b6dd48cd0dd40880cdfe..f31c5c1741a8df186eb6d1eeb8672969631c0a5d 100644 (file)
@@ -424,9 +424,11 @@ bfd_elf_link_record_dynamic_symbol (struct bfd_link_info *info,
    this in case some dynamic object refers to this symbol.  */
 
 bfd_boolean
-bfd_elf_record_link_assignment (struct bfd_link_info *info,
+bfd_elf_record_link_assignment (bfd *output_bfd,
+                               struct bfd_link_info *info,
                                const char *name,
-                               bfd_boolean provide)
+                               bfd_boolean provide,
+                               bfd_boolean hidden)
 {
   struct elf_link_hash_entry *h;
   struct elf_link_hash_table *htab;
@@ -473,6 +475,14 @@ bfd_elf_record_link_assignment (struct bfd_link_info *info,
 
   h->def_regular = 1;
 
+  if (provide && hidden)
+    {
+      const struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
+
+      h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN;
+      (*bed->elf_backend_hide_symbol) (info, h, TRUE);
+    }
+
   /* STV_HIDDEN and STV_INTERNAL symbols must be STB_LOCAL in shared objects
      and executables.  */
   if (!info->relocatable
index 42b1e6248c84fd2e40378594f9a00631693cf925..9927ab8304ea20c5f90068910ad1b0f74a945338 100644 (file)
@@ -1,3 +1,12 @@
+2005-12-07  Thiemo Seufer  <ths@networkno.de>
+           H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/1932
+       * emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment):
+       Adjust bfd_elf_record_link_assignment call.
+
+       * ldexp.c (exp_fold_tree_1): Remove call to bfd_hide_symbol.
+
 2005-11-25  Jan Beulich  <jbeulich@novell.com>
 
        * Makefile.am: Make configdoc.texi writeable before trying
index 55e1663e324041bc1c10cc568f05cff35216165c..703248a5ce4855e06f1166fcae0fa770b84996bf 100644 (file)
@@ -986,8 +986,9 @@ gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
         will do no harm.  */
       if (strcmp (exp->assign.dst, ".") != 0)
        {
-         if (!bfd_elf_record_link_assignment (&link_info, exp->assign.dst,
-                                              provide))
+         if (!bfd_elf_record_link_assignment (output_bfd, &link_info,
+                                              exp->assign.dst, provide,
+                                              exp->assign.hidden))
            einfo ("%P%F: failed to record assignment to %s: %E\n",
                   exp->assign.dst);
        }
index cee1da533266b5af2c2a8d159caecb736179ea07..c9d707e793e64950cc8256a6ca4a5bf46174baab 100644 (file)
@@ -735,8 +735,6 @@ exp_fold_tree_1 (etree_type *tree)
                     defined by some object.  */
                  break;
                }
-             if (tree->assign.hidden)
-               bfd_hide_symbol (output_bfd, &link_info, h, TRUE);
            }
 
          exp_fold_tree_1 (tree->assign.src);