aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elflink.c12
2 files changed, 15 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 20e3628..fb20d07 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/10630
+ * elflink.c (elf_link_output_extsym): Turn off visibility on
+ local symbol.
+ (bfd_elf_final_link): Turn off visibility on dynamic local
+ symbol.
+
2009-09-24 Alan Modra <amodra@bigpond.net.au>
PR binutils/10654
diff --git a/bfd/elflink.c b/bfd/elflink.c
index b99acea..f8029b0 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -8632,7 +8632,11 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
sym.st_size = h->size;
sym.st_other = h->other;
if (h->forced_local)
- sym.st_info = ELF_ST_INFO (STB_LOCAL, h->type);
+ {
+ sym.st_info = ELF_ST_INFO (STB_LOCAL, h->type);
+ /* Turn off visibility on local symbol. */
+ sym.st_other &= ~ELF_ST_VISIBILITY (-1);
+ }
else if (h->unique_global)
sym.st_info = ELF_ST_INFO (STB_GNU_UNIQUE, h->type);
else if (h->root.type == bfd_link_hash_undefweak
@@ -10704,13 +10708,11 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
asection *s;
bfd_byte *dest;
- sym.st_size = e->isym.st_size;
- sym.st_other = e->isym.st_other;
-
- /* Copy the internal symbol as is.
+ /* Copy the internal symbol and turn off visibility.
Note that we saved a word of storage and overwrote
the original st_name with the dynstr_index. */
sym = e->isym;
+ sym.st_other &= ~ELF_ST_VISIBILITY (-1);
s = bfd_section_from_elf_index (e->input_bfd,
e->isym.st_shndx);