From patchwork Mon Jul 4 13:45:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 13618 Received: (qmail 56032 invoked by alias); 4 Jul 2016 14:10:13 -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 56017 invoked by uid 89); 4 Jul 2016 14:10:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: plane.gmane.org To: libc-alpha@sourceware.org From: Stefan Liebler Subject: Re: [PATCH 6/8] Use libc_ifunc macro for system in libpthread. Date: Mon, 4 Jul 2016 15:45:18 +0200 Lines: 106 Message-ID: References: <1466682952-6301-1-git-send-email-stli@linux.vnet.ibm.com> <1466682952-6301-6-git-send-email-stli@linux.vnet.ibm.com> Mime-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: <1466682952-6301-6-git-send-email-stli@linux.vnet.ibm.com> This updated patch first undefines INIT_ARCH before it is defined. On 06/23/2016 01:55 PM, Stefan Liebler wrote: > This patch uses the libc_ifunc macro to create already existing ifunc function > system_ifunc if HAVE_IFUNC is defined. > > ChangeLog: > > * nptl/pt-system.c (system_ifunc): Use libc_ifunc macro. > --- > nptl/pt-system.c | 18 +++--------------- > 1 file changed, 3 insertions(+), 15 deletions(-) > > diff --git a/nptl/pt-system.c b/nptl/pt-system.c > index 56f2a89..6515056 100644 > --- a/nptl/pt-system.c > +++ b/nptl/pt-system.c > @@ -32,21 +32,9 @@ > > # if HAVE_IFUNC > > -static __typeof (system) * > -__attribute__ ((used)) > -system_resolve (void) > -{ > - return &__libc_system; > -} > - > -asm (".globl system_ifunc\n" > - ".type system_ifunc, %gnu_indirect_function"); > - > -# ifdef HAVE_ASM_SET_DIRECTIVE > -asm (".set system_ifunc, system_resolve"); > -# else > -asm ("system_ifunc = system_resolve"); > -# endif > +extern __typeof(system) system_ifunc; > +# define INIT_ARCH() > +libc_ifunc (system_ifunc, &__libc_system) > > # else /* !HAVE_IFUNC */ > > From e8236a40057b8efd9d16096b023d0ce8a085d3e2 Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Mon, 4 Jul 2016 15:33:56 +0200 Subject: [PATCH 6/8] Use libc_ifunc macro for system in libpthread. This patch uses the libc_ifunc macro to create already existing ifunc function system_ifunc if HAVE_IFUNC is defined. ChangeLog: * nptl/pt-system.c (system_ifunc): Use libc_ifunc macro. --- nptl/pt-system.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/nptl/pt-system.c b/nptl/pt-system.c index 56f2a89..cc415da 100644 --- a/nptl/pt-system.c +++ b/nptl/pt-system.c @@ -32,21 +32,10 @@ # if HAVE_IFUNC -static __typeof (system) * -__attribute__ ((used)) -system_resolve (void) -{ - return &__libc_system; -} - -asm (".globl system_ifunc\n" - ".type system_ifunc, %gnu_indirect_function"); - -# ifdef HAVE_ASM_SET_DIRECTIVE -asm (".set system_ifunc, system_resolve"); -# else -asm ("system_ifunc = system_resolve"); -# endif +extern __typeof(system) system_ifunc; +# undef INIT_ARCH +# define INIT_ARCH() +libc_ifunc (system_ifunc, &__libc_system) # else /* !HAVE_IFUNC */ -- 2.3.0