From patchwork Wed Aug 24 14:04:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 662318 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 3sK8Hy2NNbz9sdm for ; Thu, 25 Aug 2016 00:06:54 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=N98pL2la; dkim-atps=neutral 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:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=CY8VGHCtNkwFy/+oXKwhgnGPfGeXBfi pnlZu/gV2+LTwyuhPne5/52eb0opCNqxcHls6HQu+qCsPIhHO0jPleQJXosxqTHB beP94HRfrRtEk79DjVDrgLvNqDS90Z9uBXpBiZGsMkotvUmzH3tyOA8Gz7rfG0bt K/axUFC4RodI= 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:cc:subject:date:in-reply-to:references :message-id; s=default; bh=6vCak5VyVChYvj34W7lqahJJH6k=; b=N98pL 2lanmxnM4kiFTMf6P+Apnp2GpYQWT5PnFbkPv9O1ikUpEz/ao6ya0l7rn8guWbAV SWjESRJ5hzdbSaCXNMe3zxj3UISuHTslV5Z6sLxCd5NKHDrSE49B6pvZ7u8nSkua zcRUCnkbQK5ter02vuA2XI7c4cvTR51/WdJMuE= Received: (qmail 78844 invoked by alias); 24 Aug 2016 14:05:35 -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 78640 invoked by uid 89); 24 Aug 2016 14:05:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=2.3.0, __typeof, verison, globl X-HELO: mx0a-001b2d01.pphosted.com X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: stli@linux.vnet.ibm.com X-IBM-RcptTo: libc-alpha@sourceware.org From: Stefan Liebler To: libc-alpha@sourceware.org Cc: stli@linux.vnet.ibm.com, fweimer@redhat.com, murphyp@linux.vnet.ibm.com, schwab@linux-m68k.org, joseph_myers@mentor.com Subject: [PATCH v3 9/9] Use libc_ifunc macro for siglongjmp, longjmp in libpthread. Date: Wed, 24 Aug 2016 16:04:32 +0200 In-Reply-To: <1472047472-30307-1-git-send-email-stli@linux.vnet.ibm.com> References: <1472047472-30307-1-git-send-email-stli@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16082414-0032-0000-0000-00000200AC74 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16082414-0033-0000-0000-00001C80ACE5 Message-Id: <1472047472-30307-9-git-send-email-stli@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-24_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608240127 This patch uses the libc_ifunc macro to create already existing ifunc functions longjmp_ifunc, siglongjmp_ifunc if HAVE_IFUNC is defined. The s390 pt-longjmp.c includes the common pt-longjmp.c and uses strong_alias to create the longjmp, siglongjmp symbols for glibc version 2.19. ChangeLog: * nptl/pt-longjmp.c (DEFINE_LONGJMP): Use libc_ifunc macro. * sysdeps/unix/sysv/linux/s390/pt-longjmp.c (longjmp, siglongjmp): Use strong_alias to create symbols for glibc verison 2.19. --- nptl/pt-longjmp.c | 24 ++++++------------------ sysdeps/unix/sysv/linux/s390/pt-longjmp.c | 4 ++-- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/nptl/pt-longjmp.c b/nptl/pt-longjmp.c index a1cc286..a19cd59 100644 --- a/nptl/pt-longjmp.c +++ b/nptl/pt-longjmp.c @@ -32,24 +32,12 @@ # if HAVE_IFUNC -static __typeof (longjmp) * -__attribute__ ((used)) -longjmp_resolve (void) -{ - return &__libc_longjmp; -} +# undef INIT_ARCH +# define INIT_ARCH() +# define DEFINE_LONGJMP(name) libc_ifunc (name, &__libc_longjmp) -# ifdef HAVE_ASM_SET_DIRECTIVE -# define DEFINE_LONGJMP(name) \ - asm (".set " #name ", longjmp_resolve\n" \ - ".globl " #name "\n" \ - ".type " #name ", %gnu_indirect_function"); -# else -# define DEFINE_LONGJMP(name) \ - asm (#name " = longjmp_resolve\n" \ - ".globl " #name "\n" \ - ".type " #name ", %gnu_indirect_function"); -# endif +extern __typeof(longjmp) longjmp_ifunc; +extern __typeof(siglongjmp) siglongjmp_ifunc; # else /* !HAVE_IFUNC */ @@ -66,7 +54,7 @@ longjmp_compat (jmp_buf env, int val) DEFINE_LONGJMP (longjmp_ifunc) compat_symbol (libpthread, longjmp_ifunc, longjmp, GLIBC_2_0); -DEFINE_LONGJMP (siglongjmp_ifunc) +strong_alias (longjmp_ifunc, siglongjmp_ifunc) compat_symbol (libpthread, siglongjmp_ifunc, siglongjmp, GLIBC_2_0); #endif diff --git a/sysdeps/unix/sysv/linux/s390/pt-longjmp.c b/sysdeps/unix/sysv/linux/s390/pt-longjmp.c index 10e825c..2abf112 100644 --- a/sysdeps/unix/sysv/linux/s390/pt-longjmp.c +++ b/sysdeps/unix/sysv/linux/s390/pt-longjmp.c @@ -26,8 +26,8 @@ /* In glibc release 2.19 new versions of longjmp-functions were introduced, but were reverted before 2.20. Thus both versions are the same function. */ -DEFINE_LONGJMP (__v2longjmp) +strong_alias (longjmp_ifunc, __v2longjmp) compat_symbol (libpthread, __v2longjmp, longjmp, GLIBC_2_19); -DEFINE_LONGJMP (__v2siglongjmp) +strong_alias (siglongjmp_ifunc, __v2siglongjmp) compat_symbol (libpthread, __v2siglongjmp, siglongjmp, GLIBC_2_19); #endif /* SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)) */