From 9ab9db387d84f7ae489fd87a04f0e13c0c63c0e3 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Sat, 10 Jan 2015 10:04:11 +0100 Subject: [PATCH] Don't use __weak_reference() when a __strong_reference() is needed. OpenLibm uses the __weak_reference() macro for platforms where double and long double use the same layout. That way functions only need to be provided by the library once. The point is, in this specific case we want to use strong references; not weak references. Strong references can be used to give a symbol a second name. If you look at the resulting object file, you will have two symbols with the same offset and size. Weak references are different, in the sense that they are marked in such a way that they act as fallbacks. They are only used if an explicitly matching symbol is missing. --- src/e_acos.c | 2 +- src/e_asin.c | 2 +- src/e_atan2.c | 2 +- src/e_hypot.c | 2 +- src/e_remainder.c | 2 +- src/e_sqrt.c | 2 +- src/s_atan.c | 2 +- src/s_cbrt.c | 2 +- src/s_ceil.c | 2 +- src/s_cos.c | 2 +- src/s_cproj.c | 2 +- src/s_csqrt.c | 2 +- src/s_exp2.c | 2 +- src/s_floor.c | 2 +- src/s_fma.c | 2 +- src/s_frexp.c | 2 +- src/s_isinf.c | 2 +- src/s_isnan.c | 2 +- src/s_logb.c | 2 +- src/s_nan.c | 2 +- src/s_nextafter.c | 6 +++--- src/s_remquo.c | 2 +- src/s_rint.c | 2 +- src/s_scalbn.c | 4 ++-- src/s_sin.c | 2 +- src/s_sincos.c | 2 +- src/s_tan.c | 2 +- src/s_trunc.c | 2 +- src/w_cabs.c | 2 +- 29 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/e_acos.c b/src/e_acos.c index bf07b54..0d2d4df 100644 --- a/src/e_acos.c +++ b/src/e_acos.c @@ -107,5 +107,5 @@ __ieee754_acos(double x) } #if LDBL_MANT_DIG == 53 -__weak_reference(acos, acosl); +__strong_reference(acos, acosl); #endif diff --git a/src/e_asin.c b/src/e_asin.c index 67d1d0f..8da0628 100644 --- a/src/e_asin.c +++ b/src/e_asin.c @@ -113,5 +113,5 @@ __ieee754_asin(double x) } #if LDBL_MANT_DIG == 53 -__weak_reference(asin, asinl); +__strong_reference(asin, asinl); #endif diff --git a/src/e_atan2.c b/src/e_atan2.c index bf5b15c..df95b05 100644 --- a/src/e_atan2.c +++ b/src/e_atan2.c @@ -125,5 +125,5 @@ __ieee754_atan2(double y, double x) } #if LDBL_MANT_DIG == 53 -__weak_reference(atan2, atan2l); +__strong_reference(atan2, atan2l); #endif diff --git a/src/e_hypot.c b/src/e_hypot.c index 058a9fd..c33cf72 100644 --- a/src/e_hypot.c +++ b/src/e_hypot.c @@ -127,5 +127,5 @@ __ieee754_hypot(double x, double y) } #if LDBL_MANT_DIG == 53 -__weak_reference(hypot, hypotl); +__strong_reference(hypot, hypotl); #endif diff --git a/src/e_remainder.c b/src/e_remainder.c index cc1e4c5..6ac459c 100644 --- a/src/e_remainder.c +++ b/src/e_remainder.c @@ -75,5 +75,5 @@ __ieee754_remainder(double x, double p) } #if LDBL_MANT_DIG == 53 -__weak_reference(remainder, remainderl); +__strong_reference(remainder, remainderl); #endif diff --git a/src/e_sqrt.c b/src/e_sqrt.c index f89b852..9edbb58 100644 --- a/src/e_sqrt.c +++ b/src/e_sqrt.c @@ -189,7 +189,7 @@ __ieee754_sqrt(double x) } #if (LDBL_MANT_DIG == 53) -__weak_reference(sqrt, sqrtl); +__strong_reference(sqrt, sqrtl); #endif /* diff --git a/src/s_atan.c b/src/s_atan.c index 9a08b9f..075c730 100644 --- a/src/s_atan.c +++ b/src/s_atan.c @@ -120,5 +120,5 @@ atan(double x) } #if LDBL_MANT_DIG == 53 -__weak_reference(atan, atanl); +__strong_reference(atan, atanl); #endif diff --git a/src/s_cbrt.c b/src/s_cbrt.c index 17a64a4..8099e99 100644 --- a/src/s_cbrt.c +++ b/src/s_cbrt.c @@ -114,5 +114,5 @@ cbrt(double x) } #if (LDBL_MANT_DIG == 53) -__weak_reference(cbrt, cbrtl); +__strong_reference(cbrt, cbrtl); #endif diff --git a/src/s_ceil.c b/src/s_ceil.c index 93ce46b..e12204a 100644 --- a/src/s_ceil.c +++ b/src/s_ceil.c @@ -73,5 +73,5 @@ ceil(double x) } #if LDBL_MANT_DIG == 53 -__weak_reference(ceil, ceill); +__strong_reference(ceil, ceill); #endif diff --git a/src/s_cos.c b/src/s_cos.c index 63e52a3..7af2aa6 100644 --- a/src/s_cos.c +++ b/src/s_cos.c @@ -85,5 +85,5 @@ cos(double x) } #if (LDBL_MANT_DIG == 53) -__weak_reference(cos, cosl); +__strong_reference(cos, cosl); #endif diff --git a/src/s_cproj.c b/src/s_cproj.c index 7b9e131..4549961 100644 --- a/src/s_cproj.c +++ b/src/s_cproj.c @@ -43,5 +43,5 @@ cproj(double complex z) } #if LDBL_MANT_DIG == 53 -__weak_reference(cproj, cprojl); +__strong_reference(cproj, cprojl); #endif diff --git a/src/s_csqrt.c b/src/s_csqrt.c index e0633bd..09c01f3 100644 --- a/src/s_csqrt.c +++ b/src/s_csqrt.c @@ -110,5 +110,5 @@ csqrt(double complex z) } #if LDBL_MANT_DIG == 53 -__weak_reference(csqrt, csqrtl); +__strong_reference(csqrt, csqrtl); #endif diff --git a/src/s_exp2.c b/src/s_exp2.c index e1863f5..293117c 100644 --- a/src/s_exp2.c +++ b/src/s_exp2.c @@ -392,5 +392,5 @@ exp2(double x) } #if (LDBL_MANT_DIG == 53) -__weak_reference(exp2, exp2l); +__strong_reference(exp2, exp2l); #endif diff --git a/src/s_floor.c b/src/s_floor.c index 6825492..22d98ca 100644 --- a/src/s_floor.c +++ b/src/s_floor.c @@ -74,5 +74,5 @@ floor(double x) } #if LDBL_MANT_DIG == 53 -__weak_reference(floor, floorl); +__strong_reference(floor, floorl); #endif diff --git a/src/s_fma.c b/src/s_fma.c index 7fa8ba3..b24cb7d 100644 --- a/src/s_fma.c +++ b/src/s_fma.c @@ -280,5 +280,5 @@ fma(double x, double y, double z) } #if (LDBL_MANT_DIG == 53) -__weak_reference(fma, fmal); +__strong_reference(fma, fmal); #endif diff --git a/src/s_frexp.c b/src/s_frexp.c index c836375..2406c13 100644 --- a/src/s_frexp.c +++ b/src/s_frexp.c @@ -52,5 +52,5 @@ frexp(double x, int *eptr) } #if (LDBL_MANT_DIG == 53) -__weak_reference(frexp, frexpl); +__strong_reference(frexp, frexpl); #endif diff --git a/src/s_isinf.c b/src/s_isinf.c index 041c4ec..3a1c685 100644 --- a/src/s_isinf.c +++ b/src/s_isinf.c @@ -62,4 +62,4 @@ __isinfl(long double e) } #endif -__weak_reference(__isinff, isinff); +__strong_reference(__isinff, isinff); diff --git a/src/s_isnan.c b/src/s_isnan.c index 21f4f64..7482357 100644 --- a/src/s_isnan.c +++ b/src/s_isnan.c @@ -63,4 +63,4 @@ __isnanl(long double e) } #endif -__weak_reference(__isnanf, isnanf); +__strong_reference(__isnanf, isnanf); diff --git a/src/s_logb.c b/src/s_logb.c index 9549301..8fb4ea8 100644 --- a/src/s_logb.c +++ b/src/s_logb.c @@ -45,5 +45,5 @@ logb(double x) } #if (LDBL_MANT_DIG == 53) -__weak_reference(logb, logbl); +__strong_reference(logb, logbl); #endif diff --git a/src/s_nan.c b/src/s_nan.c index ef8aad7..5a5d8e6 100644 --- a/src/s_nan.c +++ b/src/s_nan.c @@ -120,5 +120,5 @@ nanf(const char *s) } #if (LDBL_MANT_DIG == 53) -__weak_reference(nan, nanl); +__strong_reference(nan, nanl); #endif diff --git a/src/s_nextafter.c b/src/s_nextafter.c index 2e02a32..c0c2f39 100644 --- a/src/s_nextafter.c +++ b/src/s_nextafter.c @@ -77,7 +77,7 @@ nextafter(double x, double y) } #if (LDBL_MANT_DIG == 53) -__weak_reference(nextafter, nexttoward); -__weak_reference(nextafter, nexttowardl); -__weak_reference(nextafter, nextafterl); +__strong_reference(nextafter, nexttoward); +__strong_reference(nextafter, nexttowardl); +__strong_reference(nextafter, nextafterl); #endif diff --git a/src/s_remquo.c b/src/s_remquo.c index ca62639..3e759aa 100644 --- a/src/s_remquo.c +++ b/src/s_remquo.c @@ -154,5 +154,5 @@ fixup: } #if LDBL_MANT_DIG == 53 -__weak_reference(remquo, remquol); +__strong_reference(remquo, remquol); #endif diff --git a/src/s_rint.c b/src/s_rint.c index ba0e104..749bde7 100644 --- a/src/s_rint.c +++ b/src/s_rint.c @@ -88,5 +88,5 @@ rint(double x) } #if (LDBL_MANT_DIG == 53) -__weak_reference(rint, rintl); +__strong_reference(rint, rintl); #endif diff --git a/src/s_scalbn.c b/src/s_scalbn.c index 1071ac3..6e41cba 100644 --- a/src/s_scalbn.c +++ b/src/s_scalbn.c @@ -59,8 +59,8 @@ scalbn (double x, int n) } #if (LDBL_MANT_DIG == 53) -__weak_reference(scalbn, ldexpl); -__weak_reference(scalbn, scalbnl); +__strong_reference(scalbn, ldexpl); +__strong_reference(scalbn, scalbnl); #endif __strong_reference(scalbn, ldexp); diff --git a/src/s_sin.c b/src/s_sin.c index 9f50764..602188d 100644 --- a/src/s_sin.c +++ b/src/s_sin.c @@ -85,5 +85,5 @@ sin(double x) } #if (LDBL_MANT_DIG == 53) -__weak_reference(sin, sinl); +__strong_reference(sin, sinl); #endif diff --git a/src/s_sincos.c b/src/s_sincos.c index 9960ee6..2b1509b 100644 --- a/src/s_sincos.c +++ b/src/s_sincos.c @@ -146,5 +146,5 @@ sincos(double x, double * s, double * c) } #if (LDBL_MANT_DIG == 53) -__weak_reference(sincos, sincosl); +__strong_reference(sincos, sincosl); #endif diff --git a/src/s_tan.c b/src/s_tan.c index e830a19..5063236 100644 --- a/src/s_tan.c +++ b/src/s_tan.c @@ -79,5 +79,5 @@ tan(double x) } #if (LDBL_MANT_DIG == 53) -__weak_reference(tan, tanl); +__strong_reference(tan, tanl); #endif diff --git a/src/s_trunc.c b/src/s_trunc.c index 7f59cf3..0830378 100644 --- a/src/s_trunc.c +++ b/src/s_trunc.c @@ -63,5 +63,5 @@ trunc(double x) } #if LDBL_MANT_DIG == 53 -__weak_reference(trunc, truncl); +__strong_reference(trunc, truncl); #endif diff --git a/src/w_cabs.c b/src/w_cabs.c index ff3fff7..4dd0703 100644 --- a/src/w_cabs.c +++ b/src/w_cabs.c @@ -21,5 +21,5 @@ cabs(double complex z) } #if LDBL_MANT_DIG == 53 -__weak_reference(cabs, cabsl); +__strong_reference(cabs, cabsl); #endif