summaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2008-03-02 22:26:09 +0000
committerH.J. Lu <hjl@lucon.org>2008-03-02 22:26:09 +0000
commitc881be3e3ac60a83eeb3dbc42dcbbc68a381d712 (patch)
tree3a3300008f4810837eff1d8857167361a45b4bb6 /bfd/elflink.c
parentf039e3913a4b048607dee270f7b1c56679478ac8 (diff)
downloadgdb-c881be3e3ac60a83eeb3dbc42dcbbc68a381d712.tar.gz
2008-03-02 H.J. Lu <hongjiu.lu@intel.com>
PR ld/5789 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return true for hidden and local symbols.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 3a00a51f765..513979926b4 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -2789,6 +2789,11 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h,
if (h == NULL)
return TRUE;
+ /* STV_HIDDEN or STV_INTERNAL ones must be local. */
+ if (ELF_ST_VISIBILITY (h->other) == STV_HIDDEN
+ || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL)
+ return TRUE;
+
/* Common symbols that become definitions don't get the DEF_REGULAR
flag set, so test it first, and don't bail out. */
if (ELF_COMMON_DEF_P (h))
@@ -2817,10 +2822,6 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h,
if (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
return FALSE;
- /* However, STV_HIDDEN or STV_INTERNAL ones must be local. */
- 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;