2005-01-19 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 19 Jan 2005 16:15:11 +0000 (16:15 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 19 Jan 2005 16:15:11 +0000 (16:15 +0000)
PR 679
* elflink.c (_bfd_elf_dynamic_symbol_p): Only protected
non-function symbols are local.
(_bfd_elf_symbol_refs_local_p): Likewise.

bfd/ChangeLog
bfd/elflink.c

index 97a61bdfdf7186f8a15c6d01d1321a949a4ceda2..e2abbe8a97fbea75d5b96301b9477df374e1d09c 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-19  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR 679
+       * elflink.c (_bfd_elf_dynamic_symbol_p): Only protected
+       non-function symbols are local.
+       (_bfd_elf_symbol_refs_local_p): Likewise.
+
 2005-01-18  Alan Modra  <amodra@bigpond.net.au>
 
        * bfd.c (bfd_link_just_syms): Add abfd param.
index a973cd59a342262d137548007e56b32b74770905..7a02d3415f04b4a42fb5dfb7500f33e1820cd090 100644 (file)
@@ -2479,7 +2479,7 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
       /* 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 (!ignore_protected)
+      if (!ignore_protected || h->type != STT_FUNC)
        binding_stays_local_p = TRUE;
       break;
 
@@ -2542,6 +2542,10 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h,
   if (ELF_ST_VISIBILITY (h->other) != STV_PROTECTED)
     return TRUE;
 
+  /* STV_PROTECTED non-function symbols are local.  */
+  if (h->type != STT_FUNC)
+    return TRUE;
+
   /* 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.  */