From patchwork Tue Dec 17 18:58:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 181906 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp6157906ile; Tue, 17 Dec 2019 10:58:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwqxJy4ZPCksVytAVymI3tKRdhBOqYjf5YTVvJqs1UqXCzHjL6018DhCNdxmQBXInowL3w0 X-Received: by 2002:a54:4712:: with SMTP id k18mr1356497oik.94.1576609114199; Tue, 17 Dec 2019 10:58:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576609114; cv=none; d=google.com; s=arc-20160816; b=Pi0Tm7KI3mackwWlHDAYpZ2mWT3V048qsF4jvIkAC2BY3JLqtoNJvi4gaAErA3Z2p0 g3ssm3kE0umaWZRzUMrHHfliMyoLfrQ4GrA0gyNueNLLb95L93IPqA2MwDIIymWGeDeX VZ329kgohyLP85TeQz+hkWc+l+RS8qDJTNQhZ8CBzNb9+mbUG+iboebRuwPgPhr11gdN qpMnf1+wh7lFYGMXV4/1I1FWDNLnXXF4usv5TJjUAhNrwigxdm5uQq1AS0xvn7Vs/wDF gaFvi0L7Y0/fRUuQQCycN7y+PsI+j7XA3Bx899202twRtJ2qUd0XNIQ/GCY6qgd9QyCu LWFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-subscribe:list-unsubscribe :list-id:precedence:mailing-list:dkim-signature:domainkey-signature; bh=cFClYSCob12JYUW8KEX3PDsQ9Rmdu+nZEeOdNSvvmO4=; b=kUseYmkj4m/hHPdHN4bV2/MtmLDWeOfU3SmadPDyH60z5uPHQN2rkRjw0HfUpPQEqy yqFoYYNhnSBbuZOaQQ+4C0IyOxvL5ibChI5A5LELIT8f1VV1I82djgZeqm2KM/JJM6n5 et7lA0egmxpV6OUqt4A0x/iGN+8xhGNC2N/2ZjvpZNuU/JNQccNaL+DDIx9hXivl7SO/ gU6UVsE0awgbPB6zu2guX0lVBHLmwa+HzqKjmKh3wLhfqv6BF+3wfyxSiF/EWZ3NctYT 0v9RYbAyZFqL7Z1kyeP3etuqKxQHknjV6XMFqJKufdebCugt2TX3c+kxHvmWY81v+Xh3 NH4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=lfbVpVE4; dkim=pass header.i=@linaro.org header.s=google header.b=ibLZeDiC; spf=pass (google.com: domain of libc-alpha-return-108157-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108157-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id x193si13101618oia.131.2019.12.17.10.58.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Dec 2019 10:58:34 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-108157-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=lfbVpVE4; dkim=pass header.i=@linaro.org header.s=google header.b=ibLZeDiC; spf=pass (google.com: domain of libc-alpha-return-108157-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108157-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=pgAPoD+qIKmFUHfWc6sLA2D6fm1bKCMY7UY5Hl1FesmSiYq2MNVZm xXDd0KgCFp8jfCyhlCGUJRwopmV18NrHDxzNUfDJEOWNBUuV3GJEFeF2qGhRNrdM iPJ3s129OE1qfdjgQWb7j56bKqQGjfPCznJLZ1v1LrvPvQWXUwH4+A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=4uJ3Lk1Z8g3F9u+hqNyLOZZ2j+k=; b=lfbVpVE41abqzg1IPJnxM66tD4mx fIy5aI2eT3XOXYaeqd6onfMZj5AIefCPqhAJaoRdBsFsmKWKp15o3JR3Pmq12PLa OpPZqdBElFj+c4AC42llRNS2kA9isgvli1HkOECxKeU94cxWryPAZIzqG/SOleT6 +I/CZ9QGyjHfb3M= Received: (qmail 107757 invoked by alias); 17 Dec 2019 18:58:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 107748 invoked by uid 89); 17 Dec 2019 18:58:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=LD_DEBUG, ld_debug X-HELO: mail-pg1-f196.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=cFClYSCob12JYUW8KEX3PDsQ9Rmdu+nZEeOdNSvvmO4=; b=ibLZeDiCtnyExizUCpFoC8UUd+H81Hqt1nUUAfc1bwTsgTrrttpMGu89keqQOtlmeQ VLPhFn11xbI3yLRbusKvmWxor+vTH8VC4HsaKAXUiskEkd5/WxtS8srtxa5MXH561aod nKYWLorAEFjXIsC6IiGJ3HhcHZThln3uxqWLxU6sGkw/a2ijEodYI4aagukAJApQukO4 fAfxBOFKR0zOy1+xZcZIdDG/u1KOpQQI96xe11HPpUR4K1HGWcXxjUZmGQvsOpJUaZAS iyqwDh0oTKDxm010bWhVvwnA95DNQYVO9xFmc+UJE/L7PPazRTmHfneML3IKxaW7B+Jv NnXg== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH] powerpc: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214] Date: Tue, 17 Dec 2019 15:58:16 -0300 Message-Id: <20191217185816.29521-1-adhemerval.zanella@linaro.org> This patch adds the missing bits for powerpc and fixes both tst-ifunc-fault-lazy and tst-ifunc-fault-bindnow failures on powerpc-linux-gnu. Checked on powerpc-linux-gnu and powerpc-linux-gnu-power4. --- sysdeps/powerpc/powerpc32/dl-machine.c | 5 +++-- sysdeps/powerpc/powerpc32/dl-machine.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) -- 2.17.1 Reviewed-by: Tulio Magno Quites Machado Filho diff --git a/sysdeps/powerpc/powerpc32/dl-machine.c b/sysdeps/powerpc/powerpc32/dl-machine.c index d3ce2c17a9..a90cbc1ae3 100644 --- a/sysdeps/powerpc/powerpc32/dl-machine.c +++ b/sysdeps/powerpc/powerpc32/dl-machine.c @@ -414,7 +414,7 @@ __process_machine_rela (struct link_map *map, const Elf32_Sym *refsym, Elf32_Addr *const reloc_addr, Elf32_Addr const finaladdr, - int rinfo) + int rinfo, bool skip_ifunc) { union unaligned { @@ -434,7 +434,8 @@ __process_machine_rela (struct link_map *map, return; case R_PPC_IRELATIVE: - *reloc_addr = ((Elf32_Addr (*) (void)) finaladdr) (); + if (__glibc_likely (!skip_ifunc)) + *reloc_addr = ((Elf32_Addr (*) (void)) finaladdr) (); return; case R_PPC_UADDR32: diff --git a/sysdeps/powerpc/powerpc32/dl-machine.h b/sysdeps/powerpc/powerpc32/dl-machine.h index 528690107b..4b1265282e 100644 --- a/sysdeps/powerpc/powerpc32/dl-machine.h +++ b/sysdeps/powerpc/powerpc32/dl-machine.h @@ -273,7 +273,8 @@ extern void __process_machine_rela (struct link_map *map, const Elf32_Sym *refsym, Elf32_Addr *const reloc_addr, Elf32_Addr finaladdr, - int rinfo) attribute_hidden; + int rinfo, bool skip_ifunc) + attribute_hidden; /* Call _dl_signal_error when a resolved value overflows a relocated area. */ extern void _dl_reloc_overflow (struct link_map *map, @@ -436,7 +437,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, default: __process_machine_rela (map, reloc, sym_map, sym, refsym, - reloc_addr, value, r_type); + reloc_addr, value, r_type, skip_ifunc); } }