From patchwork Thu May 22 13:00:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 351532 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 20E75140084 for ; Fri, 23 May 2014 01:28:15 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; q=dns; s=default; b=Uw+ fpu7Pffw78e/wt/KNzdSRMyhRpUZCkx6gmm7cLKs+Etv6NhogUqdpm9g4qatFVl3 YqYK0GnzH8tQMEV4770FGjVcm2W8LBmgezA48IOMHzNcQhesnfJ4onLmikzB9LEW bHe6UoLZy86fmyV7aVRSMYWkQEmhH5yB8krQRP28= 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:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; s=default; bh=0mSNKEu65 h8RE2kOEGDcboeKqN4=; b=HJ0vNwk4EqNf6NSm7uy7rr7rxL3Fjix8ngsLXsYgt ikJBtB6w2v0nzrBTVd/09oPZ7z3atwHxuROaphShBUiww3hyHTQBE5fSn0zZu6YI ncaBla6qch80NcaR/nDDpCPJ3KRqbapskkWMwLpeWUqAjyiALTULDdmAMnGsSroM 3Y= Received: (qmail 26818 invoked by alias); 22 May 2014 15:28:11 -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 26809 invoked by uid 89); 22 May 2014 15:28:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e24smtp01.br.ibm.com Message-ID: <537DF4F9.3080303@linux.vnet.ibm.com> Date: Thu, 22 May 2014 10:00:41 -0300 From: Adhemerval Zanella User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "GNU C. Library" Subject: [COMMITTED] PowerPC: Fix memchr ifunc hidden symbol for PPC32 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14052213-1524-0000-0000-000009C78EDD This patch fixes a similar issue to 736c304a1ab4cee36a2f3343f1698bc0abae4608, where for PPC32 if the symbol is defined as hidden (memchr) then compiler will create a local branc (symbol@local) and the linker will not create a required PLT call to make the ifunc work. It changes the default hidden symbol (__GI_memchr) to default memchr symbol for powerpc32 (__memchr_ppc32). It fixes some segfaults due internal wrong calculation after memchr calls in some iconv testcases. I'm trying to figure out why it didn't have showed up earlier. --- 2014-05-22 Adhemerval Zanella * sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c (memchr): Remove libc_hidden_builtin_def to ifunc. * sysdeps/powerpc/powerpc32/power4/multiarch/memchr-ppc32.c [libc_hidden_builtin_def]: Define hidden definition to __memchr_ppc32. --- diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memchr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memchr-ppc32.c index 4bd6bb9..f5db4a8 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/memchr-ppc32.c +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memchr-ppc32.c @@ -25,7 +25,8 @@ #ifdef SHARED # undef libc_hidden_builtin_def -# define libc_hidden_builtin_def(name) +# define libc_hidden_builtin_def(name) \ + __hidden_ver1(__memchr_ppc, __GI_memchr, __memchr_ppc); #endif extern __typeof (memchr) __memchr_ppc attribute_hidden; diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c index ca0f714..94c22ef 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c @@ -17,22 +17,25 @@ . */ #ifndef NOT_IN_libc +# undef memcpy +/* Redefine memchr so that the compiler won't make the weak_alias point + to internal hidden definition (__GI_memchr), since PPC32 does not + support local IFUNC calls. */ +# define memchr __redirect_memchr # include -# include # include "init-arch.h" -extern __typeof (__memchr) __memchr_ppc attribute_hidden; -extern __typeof (__memchr) __memchr_power7 attribute_hidden; +extern __typeof (__redirect_memchr) __memchr_ppc attribute_hidden; +extern __typeof (__redirect_memchr) __memchr_power7 attribute_hidden; -/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle - ifunc symbol properly. */ -libc_ifunc (__memchr, +extern __typeof (__redirect_memchr) __libc_memchr; + +libc_ifunc (__libc_memchr, (hwcap & PPC_FEATURE_HAS_VSX) ? __memchr_power7 : __memchr_ppc); - -weak_alias (__memchr, memchr) -libc_hidden_builtin_def (memchr) +#undef memchr +weak_alias (__libc_memchr, memchr) #else #include #endif