From patchwork Tue Sep 12 20:01:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 813036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-84526-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="eZShyWUo"; dkim-atps=neutral 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 3xsFzm2qP3z9s7f for ; Wed, 13 Sep 2017 06:01:24 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=mk9nGa3Yzf4YibWZixdYJekMNldr+ Oy2AeUICOLW7kEjOX2J4VQsuP1m2UZQD3CtQCmpOZWZrpYAlU374FxRm+WZby02I jYnZZjrokV1nx7D1N+XhW0dDEftadzTOEwCqqjzcIZEuYcLBfvpHyvepLD7uHMxj WngpIvNIg03Bzg= 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:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=UuTkbaYTX1Cgh9LWLsvwYUOZ2zg=; b=eZS hyWUoXV5N74i1XEs1bBd7D4JueciCRWQgUWhy1YIntEdkwBrew2QpMuXGh7DYhlq Ze0BK42oLqbP98SFFyrFJiF+swaQjYw2VStKtpiOfV2a7oEizAYPiIzm7BS5+p5T IRZeyn97LcOEvnXiRDi4Ml6CfICr4LZntsSopLZ8= Received: (qmail 22995 invoked by alias); 12 Sep 2017 20:01:18 -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 22985 invoked by uid 89); 12 Sep 2017 20:01:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Tue, 12 Sep 2017 20:01:06 +0000 From: Joseph Myers To: Subject: Remove declare_mgen_alias_2 [committed] Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) The libm template machinery includes a macro declare_mgen_alias_2, to define two function aliases rather than one. This macro is only used in one place, to define ldexp and scalbn, and only has one nondefault definition, for double in the case where long double has the same format. That definition is because declare_mgen_alias for double, in that case, defines l as an alias of , so cannot be called twice for aliases of the same function. Now, I suspect the l aliases are generally not needed (with maybe a few exceptions such as __clog10l, which is an exported function). But even in the presence of them, there is no need for a special declare_mgen_alias_2 macro for this case. This patch eliminates the need for such a macro by defining __wrap_scalbn as an alias of __ldexp, and then using that when defining the scalbn public aliases. This is similar to how such internal aliases are created for functions with multiple symbol versions, for example. Tested for x86_64, and with build-many-glibcs.py. (There *are* some cases where installed stripped shared libraries change - not in the generated code but because such changes to static symbols on input to ld, even nonexported symbols that don't affect the code or dynamic symbols, can affect the particular representation in the output of string tables, hash tables etc.) Committed. 2017-09-12 Joseph Myers * sysdeps/generic/math-type-macros.h [!declare_mgen_alias_2] (declare_mgen_alias_2): Remove. * sysdeps/generic/math-type-macros-double.h [NO_LONG_DOUBLE && !declare_mgen_alias_2] (declare_mgen_alias_2): Likewise. * math/s_ldexp_template.c (M_SUF (__wrap_scalbn)): Define strong alias. (ldexp): Define with declare_mgen_alias. (scalbn): Likewise. diff --git a/math/s_ldexp_template.c b/math/s_ldexp_template.c index 42a8333..3aa56f9 100644 --- a/math/s_ldexp_template.c +++ b/math/s_ldexp_template.c @@ -27,6 +27,8 @@ M_SUF (__ldexp) (FLOAT value, int exp) return value; } -declare_mgen_alias_2 (__ldexp, ldexp, scalbn); +declare_mgen_alias (__ldexp, ldexp) +strong_alias (M_SUF (__ldexp), M_SUF (__wrap_scalbn)) +declare_mgen_alias (__wrap_scalbn, scalbn) /* Note, versioning issues are punted to ldbl-opt in this case. */ diff --git a/sysdeps/generic/math-type-macros-double.h b/sysdeps/generic/math-type-macros-double.h index a755699..f2c1bb8 100644 --- a/sysdeps/generic/math-type-macros-double.h +++ b/sysdeps/generic/math-type-macros-double.h @@ -37,13 +37,6 @@ weak_alias (from, to ## l) #endif -#if defined NO_LONG_DOUBLE && !defined declare_mgen_alias_2 -# define declare_mgen_alias_2(from, to, to2) \ - declare_mgen_alias (from, to) \ - weak_alias (from, to2) \ - weak_alias (from, to2 ## l) -#endif - /* Supply the generic macros. */ #include diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h index b4c2aee..5656724 100644 --- a/sysdeps/generic/math-type-macros.h +++ b/sysdeps/generic/math-type-macros.h @@ -41,11 +41,6 @@ This exposes the appropriate symbol(s) for a function f of type FLOAT. - declare_mgen_alias_2(from,to,to2) - This exposes the appropriate symbol(s) for a - function f of type FLOAT when it is aliased - to two symbols. - M_LIBM_NEED_COMPAT(func) This is utilized in macro context to indicate whether func should declare compat symbols. @@ -121,13 +116,6 @@ # define declare_mgen_alias(from, to) weak_alias (M_SUF (from), M_SUF (to)) #endif -/* Likewise, if two aliases are derived from the same symbol. */ -#ifndef declare_mgen_alias_2 -# define declare_mgen_alias_2(from, to, to2) \ - declare_mgen_alias (from, to) \ - declare_mgen_alias (from, to2) -#endif - /* Do not generate anything for compat symbols by default. */ #ifndef M_LIBM_NEED_COMPAT # define M_LIBM_NEED_COMPAT(func) 0