From: kettenis Date: Tue, 19 May 2015 13:38:29 +0000 (+0000) Subject: Keep visibility information for references to discarded sections. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=de41601f6913604e475d530763356d0ce309383a;p=openbsd Keep visibility information for references to discarded sections. --- 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;