From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76970 invoked by alias); 18 Mar 2019 12:30:47 -0000 Mailing-List: contact gdb-testers-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-testers-owner@sourceware.org Received: (qmail 76933 invoked by uid 89); 18 Mar 2019 12:30:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=amodra@gmail.com, amodragmailcom X-HELO: kwanyin.sergiodj.net Received: from kwanyin.sergiodj.net (HELO kwanyin.sergiodj.net) (158.69.185.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Mar 2019 12:30:45 +0000 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [binutils-gdb] PR24355, segmentation fault in function called from ppc_finish_symbols From: sergiodj+buildbot@sergiodj.net To: gdb-testers@sourceware.org Message-Id: <8cd1fe1bf525b59f4d07e5790d11d49eee7e8494@gdb-build> Date: Mon, 18 Mar 2019 12:30:00 -0000 X-SW-Source: 2019-q1/txt/msg05192.txt.bz2 *** TEST RESULTS FOR COMMIT 8cd1fe1bf525b59f4d07e5790d11d49eee7e8494 *** Author: Alan Modra Branch: master Commit: 8cd1fe1bf525b59f4d07e5790d11d49eee7e8494 PR24355, segmentation fault in function called from ppc_finish_symbols This one looks to be a bug going back to 2009, git commit e054468f6c "STT_GNU_IFUNC support for PowerPC". That bug was carried over with git commit 49c09209d0 "Rearrange PLT reloc output on powerpc". If the refcount for an ifunc local sym plt entry was zero, ppc_elf_size_dynamic_sections would correctly set plt.offset to -1 but leave glink_offset uninitialized. That leads to occasional segfaults (which can be made solid with MALLOC_PERTURB_=1 when using glibc). So, guard the write_glink_stub call with plt.offset != -1. Also, remove the totally ineffective attempt at writing multiple-use glink stubs only once. PR 24355 * elf32-ppc.c (ppc_finish_symbols): Don't call write_glink_stub for local iplt syms with ent->plt.offset == -1. Remove ineffective attempt at writing glink stubs only once.