This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
internal visibility and HIDDEN in scripts
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 21 Aug 2013 13:29:30 +0930
- Subject: internal visibility and HIDDEN in scripts
This fixes a corner case. When defining hidden symbols in a linker
script, any symbol with internal visibility should stay that way.
Committed.
* elflink.c (_bfd_elf_define_linkage_sym): Don't set STV_INTERNAL
symbols to STV_HIDDEN.
Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.496
diff -u -p -r1.496 elflink.c
--- bfd/elflink.c 25 Jul 2013 00:14:11 -0000 1.496
+++ bfd/elflink.c 21 Aug 2013 03:30:26 -0000
@@ -85,7 +85,8 @@ _bfd_elf_define_linkage_sym (bfd *abfd,
h->def_regular = 1;
h->non_elf = 0;
h->type = STT_OBJECT;
- h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN;
+ if (ELF_ST_VISIBILITY (h->other) != STV_INTERNAL)
+ h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN;
bed = get_elf_backend_data (abfd);
(*bed->elf_backend_hide_symbol) (info, h, TRUE);
--
Alan Modra
Australia Development Lab, IBM