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 Netto X-Patchwork-Id: 1078 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 739D9360079 for ; Thu, 22 May 2014 08:28:13 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14307373) id 1EE6941CDF4A6; Thu, 22 May 2014 08:28:13 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx20.g.dreamhost.com 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 homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id E9A1141CC190A for ; Thu, 22 May 2014 08:28:12 -0700 (PDT) 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=HRh 3XI8i4LQvUeGl9wEPQp7RXfbD+U92DNFBggbKut3gLwwqakZK8WBtkp0Z1l9mb+J t0SlZEr6XXLPlQmdVpavSdqjo+/lewTujJwgNqq5XLA5Z410a8IH81lsBYzjnkC2 Aey5Fe8HPNbC/5lymBVQYf73jI0dGMUXaSYGaxSw= 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=SCDVGMhi1SHbPXtsUvwKOUqE7+oo2R7wDfKN/bcFZ 1T9THMqWfVWBv+Ly7/nM220DnpBwBGtSQ1nyK7T+QGgpS51huGDTFmZyFik1vNup GFgrmTWm9r71CfG/qPeIeu6BZADevD8XXESx+PKqekqxtvAe7aOyx4fSjVsqJk8J K8= 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 X-DH-Original-To: glibc@patchwork.siddhesh.in 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