From de41601f6913604e475d530763356d0ce309383a Mon Sep 17 00:00:00 2001 From: kettenis Date: Tue, 19 May 2015 13:38:29 +0000 Subject: [PATCH] Keep visibility information for references to discarded sections. --- gnu/usr.bin/binutils-2.17/bfd/elflink.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gnu/usr.bin/binutils-2.17/bfd/elflink.c b/gnu/usr.bin/binutils-2.17/bfd/elflink.c index b572921706f..75fff26a14b 100644 --- a/gnu/usr.bin/binutils-2.17/bfd/elflink.c +++ b/gnu/usr.bin/binutils-2.17/bfd/elflink.c @@ -3585,12 +3585,10 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) 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; -- 2.20.1