From patchwork Fri May 23 23:15:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 352048 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 C2DF1140082 for ; Sat, 24 May 2014 09:16:13 +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:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=E2aqYAzxkzt/HtFJHmy2B0jR1xRIkZG AOnKtYdfiMYbG384zIPc9y7xStj3PAYy14sAYCrtyDzkn/F2wPN/NVl10BP2GzsN 7NM6OxuV03qskAw9i27QDDV+mTg+CI4AWT8ixYlyGdvgMtWynKfzuIZBkbDZopo6 HcLZdNYEULSQ= 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:message-id:in-reply-to :references; s=default; bh=NmmuZ2hb0/IHw4+Id2b1ys4qkBA=; b=q4Pm9 T7TdyqA6CABhCdSokXOzRhSuz0M47LI//divQLjYJheKwK5G4/MRCUzE/lZrt/3t 4UJZ2JydKkk7JyAJH91e5teoNZxnFzKU6hwXDHCyG8ZgxaoZB00O0pvdxP6LLPjJ aVzeklH6Fn8Kx63TUP6QD6DqCnQC4FszWoem6Q= Received: (qmail 20145 invoked by alias); 23 May 2014 23:15:50 -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 20063 invoked by uid 89); 23 May 2014 23:15:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-qg0-f46.google.com X-Received: by 10.140.91.5 with SMTP id y5mr11116537qgd.12.1400886945676; Fri, 23 May 2014 16:15:45 -0700 (PDT) From: Richard Henderson To: libc-alpha@sourceware.org Cc: roland@hack.frob.com Subject: [PATCH 2/2] Only provide non-default symbols in libpthread for vfork Date: Fri, 23 May 2014 16:15:36 -0700 Message-Id: <1400886936-16338-3-git-send-email-rth@twiddle.net> In-Reply-To: <1400886936-16338-1-git-send-email-rth@twiddle.net> References: <1400886936-16338-1-git-send-email-rth@twiddle.net> * nptl/pt-vfork.c (vfork_resolve): Rename from vfork_ifunc. (vfork_ifunc): Define via attribute ifunc. (DEFINE_VFORK): Remove. (vfork, __vfork): Define via compat_symbol. --- nptl/pt-vfork.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/nptl/pt-vfork.c b/nptl/pt-vfork.c index 8beb121..78c0781 100644 --- a/nptl/pt-vfork.c +++ b/nptl/pt-vfork.c @@ -42,30 +42,21 @@ extern __typeof (vfork) __libc_vfork; /* Defined in libc. */ -attribute_hidden __attribute__ ((used)) -__typeof (vfork) * -vfork_ifunc (void) +static __typeof (vfork) * +vfork_resolve (void) { return &__libc_vfork; } -# ifdef HAVE_ASM_SET_DIRECTIVE -# define DEFINE_VFORK(name) \ - asm (".set " #name ", vfork_ifunc\n" \ - ".globl " #name "\n" \ - ".type " #name ", %gnu_indirect_function"); -# else -# define DEFINE_VFORK(name) \ - asm (#name " = vfork_ifunc\n" \ - ".globl " #name "\n" \ - ".type " #name ", %gnu_indirect_function"); -# endif +void *vfork_ifunc(void *, const void *, size_t) + __attribute__ ((ifunc ("vfork_resolve"))); #endif #if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) -DEFINE_VFORK (vfork) +compat_symbol (libpthread, vfork_ifunc, vfork, GLIBC_2_0); #endif #if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20) -DEFINE_VFORK (__vfork) +strong_alias (vfork_ifunc, vfork_ifunc2) +compat_symbol (libpthread, vfork_ifunc2, __vfork, GLIBC_2_1_2); #endif