]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove declare_mgen_alias_2.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 12 Sep 2017 20:00:00 +0000 (20:00 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 12 Sep 2017 20:00:00 +0000 (20:00 +0000)
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 <internal-func>l as an alias of <internal-func>, so
cannot be called twice for aliases of the same function.

Now, I suspect the <internal-func>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<suffix>
as an alias of __ldexp<suffix>, 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.)

* 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.

ChangeLog
math/s_ldexp_template.c
sysdeps/generic/math-type-macros-double.h
sysdeps/generic/math-type-macros.h

index 2bb21f021dc41de1681f14b1e6426b013fe2c667..e77d24c4aeb56637bc47992ff1682129819ee6af 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2017-09-12  Joseph Myers  <joseph@codesourcery.com>
+
+       * 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.
+
 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
 
        * grp/initgroups.c: Include config.h.
index 42a83334c3a9f0a9764470521c4417a80185a704..3aa56f9f8999c10f9bd5a1922e3ad44457e314af 100644 (file)
@@ -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.  */
index a75569919042b5d775f0627a9cfc80d2090289ea..f2c1bb872b52cafb0f32e77d781dc9c0285ef67d 100644 (file)
    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 <math-type-macros.h>
 
index b4c2aee6aa5981abb4711f18bfe1e25e38ef83aa..5656724f40439d3dcacb0f989cbc9e7b25b0e6f9 100644 (file)
       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.
 # 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