From patchwork Mon Aug 8 14:39:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 656770 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 3s7Kp46ZS0z9sf9 for ; Tue, 9 Aug 2016 00:40:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=hUerDR8S; 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=gfitGSWN40yg+LvpwEAkKkVfvO5udrz RFlBiqS5dB+YgwczgPAgJ+dwtjfN8Lmc/0SGM4FxqaU6ftmmhpreRUrJvbKftD1R 2J+EK+cP+GDJP3XkHRfyegqwAY/bKHO2W5Fs6dfVLBvSQsWaAIKUx6N2YnQqGys1 GY4hGhOZyGVM= 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=dkxFLwhFE20dscUPl9aW7Ra94TA=; b=hUerD R8Sh2zDJ3/oIp01FsH1Ka6PJQsGzmI+Cm3wJW7cDlk0RFLKZc/3CJHcpMnlGAVRV guU3WIP+JQjiaVi07800RcaHBwTUAJt6kYlHj+3nDeA09Q1YjeX8Thaa+xd17AOQ Gv9ofnoBmME1xukKJdYwzEt6O3RX3EllVa+A+s= Received: (qmail 63055 invoked by alias); 8 Aug 2016 14:40:05 -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 62930 invoked by uid 89); 8 Aug 2016 14:40:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=Hx-languages-length:1508, H*Ad:D*linux-m68k.org X-HELO: mx0a-001b2d01.pphosted.com X-IBM-Helo: d06dlp01.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 v2 8/9] Use libc_ifunc macro for vfork in libpthread. Date: Mon, 8 Aug 2016 16:39:04 +0200 In-Reply-To: <1470667145-18563-1-git-send-email-stli@linux.vnet.ibm.com> References: <1470667145-18563-1-git-send-email-stli@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16080814-0012-0000-0000-0000044197B7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16080814-0013-0000-0000-000014F472D4 Message-Id: <1470667145-18563-8-git-send-email-stli@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-08_11:, , 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-1608080161 This patch uses the libc_ifunc macro to create already existing ifunc functions vfork_ifunc and __vfork_ifunc if HAVE_IFUNC is defined. ChangeLog: * nptl/pt-vfork.c (DEFINE_VFORK): Use libc_ifunc macro. --- nptl/pt-vfork.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/nptl/pt-vfork.c b/nptl/pt-vfork.c index 8f4be0c..563e3ec 100644 --- a/nptl/pt-vfork.c +++ b/nptl/pt-vfork.c @@ -46,32 +46,20 @@ extern __typeof (vfork) __libc_vfork; /* Defined in libc. */ -static __typeof (vfork) * -__attribute__ ((used)) -vfork_resolve (void) -{ - return &__libc_vfork; -} +# undef INIT_ARCH +# define INIT_ARCH() +# define DEFINE_VFORK(name) libc_ifunc (name, &__libc_vfork) -# ifdef HAVE_ASM_SET_DIRECTIVE -# define DEFINE_VFORK(name) \ - asm (".set " #name ", vfork_resolve\n" \ - ".globl " #name "\n" \ - ".type " #name ", %gnu_indirect_function"); -# else -# define DEFINE_VFORK(name) \ - asm (#name " = vfork_resolve\n" \ - ".globl " #name "\n" \ - ".type " #name ", %gnu_indirect_function"); -# endif #endif #if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) +extern __typeof(vfork) vfork_ifunc; DEFINE_VFORK (vfork_ifunc) compat_symbol (libpthread, vfork_ifunc, vfork, GLIBC_2_0); #endif #if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20) +extern __typeof(vfork) __vfork_ifunc; DEFINE_VFORK (__vfork_ifunc) compat_symbol (libpthread, __vfork_ifunc, __vfork, GLIBC_2_1_2); #endif