diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2009-09-24 15:56:52 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2009-09-24 15:56:52 +0000 |
commit | 935bd1e079100b6d6fa0fa7cfd7c20a7f588cfea (patch) | |
tree | 34a9f4aee3919efc35841a55229dfaa2ad7cb83b /bfd/elflink.c | |
parent | f4be36b3fb26d687944e39d46cef536fb1fa4de4 (diff) | |
download | gdb-935bd1e079100b6d6fa0fa7cfd7c20a7f588cfea.zip gdb-935bd1e079100b6d6fa0fa7cfd7c20a7f588cfea.tar.gz gdb-935bd1e079100b6d6fa0fa7cfd7c20a7f588cfea.tar.bz2 |
bfd/
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.
ld/testsuite/
2009-09-24 H.J. Lu <hongjiu.lu@intel.com>
PR ld/10630
* ld-alpha/tlsbin.rd: Remove HIDDEN/.hidden on local symbols.
* ld-alpha/tlsbinr.rd: Likewise.
* ld-alpha/tlspic.rd: Likewise.
* ld-cris/libdso-2.d: Likewise.
* ld-cris/locref1.d: Likewise.
* ld-cris/locref2.d: Likewise.
* ld-cris/tls-e-20a.d: Likewise.
* ld-cris/tls-e-20.d: Likewise.
* ld-cris/tls-e-80.d: Likewise.
* ld-cris/tls-gc-68.d: Likewise.
* ld-cris/tls-gc-69.d: Likewise.
* ld-cris/tls-gc-70.d: Likewise.
* ld-cris/tls-gc-75.d: Likewise.
* ld-cris/tls-gc-76.d: Likewise.
* ld-cris/tls-gc-79.d: Likewise.
* ld-cris/tls-gd-1h.d: Likewise.
* ld-cris/tls-gd-2h.d: Likewise.
* ld-cris/tls-ld-4.d: Likewise.
* ld-cris/tls-ld-5.d: Likewise.
* ld-cris/tls-ld-6.d: Likewise.
* ld-cris/tls-ld-7.d: Likewise.
* ld-cris/tls-ldgd-14.d: Likewise.
* ld-cris/tls-ldgd-15.d: Likewise.
* ld-cris/tls-local-63.d: Likewise.
* ld-cris/tls-local-64.d: Likewise.
* ld-elf/pr9676.rd: Likewise.
* ld-elf/pr9679.rd: Likewise.
* ld-elfvsb/hidden2.d: Likewise.
* ld-i386/tlsbindesc.rd: Likewise.
* ld-i386/tlsbin.rd: Likewise.
* ld-i386/tlsdesc.rd: Likewise.
* ld-i386/tlsgdesc.rd: Likewise.
* ld-i386/tlsnopic.rd: Likewise.
* ld-i386/tlspic.rd: Likewise.
* ld-ia64/tlsbin.rd: Likewise.
* ld-ia64/tlspic.rd: Likewise.
* ld-powerpc/tlsexe32.r: Likewise.
* ld-powerpc/tlsexe.r: Likewise.
* ld-powerpc/tlsexetoc.r: Likewise.
* ld-powerpc/tlsso32.r: Likewise.
* ld-powerpc/tlsso.r: Likewise.
* ld-powerpc/tlstocso.r: Likewise.
* ld-s390/tlsbin_64.rd: Likewise.
* ld-s390/tlsbin.rd: Likewise.
* ld-s390/tlspic_64.rd: Likewise.
* ld-s390/tlspic.rd: Likewise.
* ld-sparc/gotop32.rd: Likewise.
* ld-sparc/gotop64.rd: Likewise.
* ld-sparc/tlssunbin32.rd: Likewise.
* ld-sparc/tlssunbin64.rd: Likewise.
* ld-sparc/tlssunnopic32.rd: Likewise.
* ld-sparc/tlssunnopic64.rd: Likewise.
* ld-sparc/tlssunpic32.rd: Likewise.
* ld-sparc/tlssunpic64.rd: Likewise.
* ld-x86-64/tlsbindesc.rd: Likewise.
* ld-x86-64/tlsbin.rd: Likewise.
* ld-x86-64/tlsdesc.rd: Likewise.
* ld-x86-64/tlsgdesc.rd: Likewise.
* ld-x86-64/tlspic.rd: Likewise.
* ld-xtensa/tlsbin.rd: Likewise.
* ld-xtensa/tlspic.rd: Likewise.
* ld-elf/local1.d: New.
* ld-elf/local1.map: Likewise.
* ld-elf/local1.s: Likewise.
* ld-ia64/local1.d: Likewise.
* ld-ia64/local1.map: Likewise.
* ld-ia64/local1.s: Likewise.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r-- | bfd/elflink.c | 12 |
1 files changed, 7 insertions, 5 deletions
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); |