internal visibility and HIDDEN in scripts
Alan Modra
amodra@gmail.com
Wed Aug 21 03:59:00 GMT 2013
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
More information about the Binutils
mailing list