aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-10-03 23:46:23 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-10-03 23:46:23 +0000
commitd8f619b393a230497d201398e184e3b384a263d3 (patch)
treedd2fc038ebf8c16b15911f2dd8aa03faa504dbb4
parent4699cb8b5f25827eec50f071183a4abba04f16e5 (diff)
downloadglibc-d8f619b393a230497d201398e184e3b384a263d3.tar
glibc-d8f619b393a230497d201398e184e3b384a263d3.tar.gz
glibc-d8f619b393a230497d201398e184e3b384a263d3.tar.bz2
glibc-d8f619b393a230497d201398e184e3b384a263d3.zip
Use libm_alias_double for dbl-64 modf.
This patch makes dbl-64 modf use libm_alias_double. Both the dbl-64 and dbl-64/wordsize-64 versions are changed, and the ldbl-opt version is changed to define the libc compat symbol only. Because of multiarch wrappers, the changed implementations are made not to define aliases at all if __modf is defined as a macro, as with other functions, so avoiding duplicate compat symbols while allowing those wrappers to be simplified. Tested for x86_64, and verified with build-many-glibcs.py that installed stripped shared libraries are unchanged by the patch. * sysdeps/ieee754/dbl-64/s_modf.c: Include <libm-alias-double.h>. (modf): Define using libm_alias_double, only if [!__modf]. * sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c: Include <libm-alias-double.h>. (modf): Define using libm_alias_double, only if [!__modf]. * sysdeps/ieee754/ldbl-opt/s_modf.c (modfl): Only define libc compat symbol here. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c (weak_alias): Do not undefine and redefine. (strong_alias): Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c (weak_alias): Likewise. (strong_alias): Likewise.
-rw-r--r--ChangeLog14
-rw-r--r--sysdeps/ieee754/dbl-64/s_modf.c7
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c7
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_modf.c6
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c5
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c5
6 files changed, 21 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index dceeb542c7..a36e2f6a0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2017-10-03 Joseph Myers <joseph@codesourcery.com>
+ * sysdeps/ieee754/dbl-64/s_modf.c: Include <libm-alias-double.h>.
+ (modf): Define using libm_alias_double, only if [!__modf].
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c: Include
+ <libm-alias-double.h>.
+ (modf): Define using libm_alias_double, only if [!__modf].
+ * sysdeps/ieee754/ldbl-opt/s_modf.c (modfl): Only define libc
+ compat symbol here.
+ * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c
+ (weak_alias): Do not undefine and redefine.
+ (strong_alias): Likewise.
+ * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c
+ (weak_alias): Likewise.
+ (strong_alias): Likewise.
+
* sysdeps/ieee754/dbl-64/s_logb.c: Include <libm-alias-double.h>.
(logb): Define using libm_alias_double, only if [!__logb].
* sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c: Include
diff --git a/sysdeps/ieee754/dbl-64/s_modf.c b/sysdeps/ieee754/dbl-64/s_modf.c
index 0cad7b16a7..722511c64a 100644
--- a/sysdeps/ieee754/dbl-64/s_modf.c
+++ b/sysdeps/ieee754/dbl-64/s_modf.c
@@ -21,6 +21,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double one = 1.0;
@@ -79,8 +80,6 @@ __modf (double x, double *iptr)
}
}
}
-weak_alias (__modf, modf)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__modf, __modfl)
-weak_alias (__modf, modfl)
+#ifndef __modf
+libm_alias_double (__modf, modf)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c
index c309e56272..8d14e78ef0 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <stdint.h>
static const double one = 1.0;
@@ -59,8 +60,6 @@ __modf(double x, double *iptr)
return x;
}
}
-weak_alias (__modf, modf)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__modf, __modfl)
-weak_alias (__modf, modfl)
+#ifndef __modf
+libm_alias_double (__modf, modf)
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_modf.c b/sysdeps/ieee754/ldbl-opt/s_modf.c
index 93acb43ae6..268a728e9b 100644
--- a/sysdeps/ieee754/ldbl-opt/s_modf.c
+++ b/sysdeps/ieee754/ldbl-opt/s_modf.c
@@ -1,9 +1,5 @@
#include <math_ldbl_opt.h>
#include <sysdeps/ieee754/dbl-64/s_modf.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __modf, modfl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __modf, modfl, GLIBC_2_0);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c
index 6561fdf8e1..554dc99545 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-ppc32.c
@@ -19,11 +19,6 @@
#include <math.h>
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-
#define __modf __modf_ppc32
#include <sysdeps/ieee754/dbl-64/s_modf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c
index 43318ee4dd..7b5656d807 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-ppc64.c
@@ -19,11 +19,6 @@
#include <math.h>
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-
#define __modf __modf_ppc64
#include <sysdeps/ieee754/dbl-64/s_modf.c>