From patchwork Mon Jul 6 17:29:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 39922 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3732E3857C79; Mon, 6 Jul 2020 17:29:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3732E3857C79 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594056599; bh=BobGLlCF3VPNKJ2fyPcNln74jzj38hu0VJiXxHdSJcQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=oFvFB2DtP/z4kpb7e+3oDx2llP6ChRbkVwHgzvk+zZhpbP3YHQ1Cldva7msSX/i3C JIwHWUKyRrG8mFtOxkd/hnQLfodj4apjlDbQtO0uqD/ZdgtqITDKcXV9YIANB56y8r 3bcpYAxnI0sH5D7XGRdR9tJHBDbTP5CDntdxx02M= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by sourceware.org (Postfix) with ESMTP id D1F7B3858D35 for ; Mon, 6 Jul 2020 17:29:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D1F7B3858D35 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-163-bZvmbfOHO82gqBEII0uNCg-1; Mon, 06 Jul 2020 13:29:54 -0400 X-MC-Unique: bZvmbfOHO82gqBEII0uNCg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 12DA164A74 for ; Mon, 6 Jul 2020 17:29:54 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-112-118.ams2.redhat.com [10.36.112.118]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 62BE519C71; Mon, 6 Jul 2020 17:29:50 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] sunrpc: Remove hidden aliases for global data symbols [BZ #26210] Date: Mon, 06 Jul 2020 19:29:49 +0200 Message-ID: <87sge4362a.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It is generally not possible to add hidden aliases for global data symbols: If the main executable contains a copy relocation against the symbol, the hidden aliases keep pointing to the glibc-internal copy of the symbol, instead of the symbol actually used by the application. Fixes commit 89aacb513eb77549a29df2638913a0f8178cf3f5 ("sunrpc: Remove stray exports without --enable-obsolete-rpc [BZ #23166]"). Tested on x86_64-linux-gnu, with and without --enable-obsolete-rpc. Manually checked for compat symbol status. Okay for glibc 2.32? Reviewed-by: Carlos O'Donell --- include/rpc/clnt.h | 1 - include/rpc/svc.h | 4 ---- sunrpc/rpc_common.c | 12 ++++++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/rpc/clnt.h b/include/rpc/clnt.h index 80be0a9cec..a397023a93 100644 --- a/include/rpc/clnt.h +++ b/include/rpc/clnt.h @@ -28,7 +28,6 @@ libc_hidden_proto (clntudp_create) libc_hidden_proto (get_myaddress) libc_hidden_proto (clntunix_create) libc_hidden_proto (__libc_clntudp_bufcreate) -libc_hidden_proto (rpc_createerr) # endif /* !_ISOMAC */ #endif diff --git a/include/rpc/svc.h b/include/rpc/svc.h index 40ba2546a9..465bf4427d 100644 --- a/include/rpc/svc.h +++ b/include/rpc/svc.h @@ -3,10 +3,6 @@ # ifndef _ISOMAC -libc_hidden_proto (svc_pollfd) -libc_hidden_proto (svc_max_pollfd) -libc_hidden_proto (svc_fdset) - libc_hidden_proto (xprt_register) libc_hidden_proto (xprt_unregister) libc_hidden_proto (svc_register) diff --git a/sunrpc/rpc_common.c b/sunrpc/rpc_common.c index 2a5d0dc1c7..05abab2a1d 100644 --- a/sunrpc/rpc_common.c +++ b/sunrpc/rpc_common.c @@ -48,10 +48,14 @@ libc_hidden_nolink_sunrpc (_null_auth, GLIBC_2_0) /* The variables need the nocommon attribute, so that it is possible to create aliases and specify symbol versions. */ fd_set svc_fdset __attribute__ ((nocommon)); -libc_hidden_nolink_sunrpc (svc_fdset, GLIBC_2_0) struct rpc_createerr rpc_createerr __attribute__ ((nocommon)); -libc_hidden_nolink_sunrpc (rpc_createerr, GLIBC_2_0) struct pollfd *svc_pollfd __attribute__ ((nocommon)); -libc_hidden_nolink_sunrpc (svc_pollfd, GLIBC_2_2) int svc_max_pollfd __attribute__ ((nocommon)); -libc_hidden_nolink_sunrpc (svc_max_pollfd, GLIBC_2_2) +#ifdef SHARED +# ifndef EXPORT_RPC_SYMBOLS +compat_symbol (libc, svc_fdset, svc_fdset, GLIBC_2_0); +compat_symbol (libc, rpc_createerr, rpc_createerr, GLIBC_2_0); +compat_symbol (libc, svc_pollfd, svc_pollfd, GLIBC_2_2); +compat_symbol (libc, svc_max_pollfd, svc_max_pollfd, GLIBC_2_2); +# endif +#endif