This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: PR ld/3666: Comdat/linkonce doesn't merge symbol visibility
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Wed, 6 Dec 2006 07:14:49 -0800
- Subject: PATCH: PR ld/3666: Comdat/linkonce doesn't merge symbol visibility
We shouldn't ignore symbol visibility for symbols from discarded
section. I will add a testcase later.
H.J.
---
bfd/
2006-12-06 H.J. Lu <hjl@gnu.org>
PR ld/3666
* elflink.c (elf_link_add_object_symbols): Keep symbol
visibility for symbols from discarded section.
--- binutils/bfd/elflink.c.merge 2006-12-06 06:43:24.000000000 -0800
+++ binutils/bfd/elflink.c 2006-12-06 07:10:18.000000000 -0800
@@ -3702,12 +3702,10 @@ elf_link_add_object_symbols (bfd *abfd,
sec = bfd_abs_section_ptr;
else if (sec->kept_section)
{
- /* Symbols from discarded section are undefined, and have
- default visibility. */
+ /* Symbols from discarded section are undefined. We keep
+ its visibility. */
sec = bfd_und_section_ptr;
isym->st_shndx = SHN_UNDEF;
- isym->st_other = (STV_DEFAULT
- | (isym->st_other & ~ ELF_ST_VISIBILITY (-1)));
}
else if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0)
value -= sec->vma;