From: guenther Date: Sat, 9 Aug 2014 05:52:43 +0000 (+0000) Subject: Backport from 2.17: mark the _GLOBAL_OFFSET_TABLE_, _DYNAMIC, and X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=76ddd5585df6191e112e5edb4c566170a99f95b2;p=openbsd Backport from 2.17: mark the _GLOBAL_OFFSET_TABLE_, _DYNAMIC, and _PROCEDURE_LINKAGE_TABLE_ symbols as (at least) hidden. --- diff --git a/gnu/usr.bin/binutils/bfd/elflink.c b/gnu/usr.bin/binutils/bfd/elflink.c index 32aa2343586..e4714460559 100644 --- a/gnu/usr.bin/binutils/bfd/elflink.c +++ b/gnu/usr.bin/binutils/bfd/elflink.c @@ -89,6 +89,9 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) h = (struct elf_link_hash_entry *) bh; h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; h->type = STT_OBJECT; + if (ELF_ST_VISIBILITY (h->other) != STV_INTERNAL) + h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN; + (*bed->elf_backend_hide_symbol) (info, h, TRUE); if (! info->executable && ! bfd_elf_link_record_dynamic_symbol (info, h)) @@ -219,6 +222,9 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) h = (struct elf_link_hash_entry *) bh; h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; h->type = STT_OBJECT; + if (ELF_ST_VISIBILITY (h->other) != STV_INTERNAL) + h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN; + (*bed->elf_backend_hide_symbol) (info, h, TRUE); if (! info->executable && ! bfd_elf_link_record_dynamic_symbol (info, h)) @@ -284,6 +290,9 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) h = (struct elf_link_hash_entry *) bh; h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; h->type = STT_OBJECT; + if (ELF_ST_VISIBILITY (h->other) != STV_INTERNAL) + h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN; + (*bed->elf_backend_hide_symbol) (info, h, TRUE); if (! info->executable && ! bfd_elf_link_record_dynamic_symbol (info, h))