Skip to content

Commit 9ab9db3

Browse files
committed
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.
1 parent c253db6 commit 9ab9db3

29 files changed

Lines changed: 32 additions & 32 deletions

src/e_acos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,5 @@ __ieee754_acos(double x)
107107
}
108108

109109
#if LDBL_MANT_DIG == 53
110-
__weak_reference(acos, acosl);
110+
__strong_reference(acos, acosl);
111111
#endif

src/e_asin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,5 @@ __ieee754_asin(double x)
113113
}
114114

115115
#if LDBL_MANT_DIG == 53
116-
__weak_reference(asin, asinl);
116+
__strong_reference(asin, asinl);
117117
#endif

src/e_atan2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,5 @@ __ieee754_atan2(double y, double x)
125125
}
126126

127127
#if LDBL_MANT_DIG == 53
128-
__weak_reference(atan2, atan2l);
128+
__strong_reference(atan2, atan2l);
129129
#endif

src/e_hypot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,5 @@ __ieee754_hypot(double x, double y)
127127
}
128128

129129
#if LDBL_MANT_DIG == 53
130-
__weak_reference(hypot, hypotl);
130+
__strong_reference(hypot, hypotl);
131131
#endif

src/e_remainder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@ __ieee754_remainder(double x, double p)
7575
}
7676

7777
#if LDBL_MANT_DIG == 53
78-
__weak_reference(remainder, remainderl);
78+
__strong_reference(remainder, remainderl);
7979
#endif

src/e_sqrt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ __ieee754_sqrt(double x)
189189
}
190190

191191
#if (LDBL_MANT_DIG == 53)
192-
__weak_reference(sqrt, sqrtl);
192+
__strong_reference(sqrt, sqrtl);
193193
#endif
194194

195195
/*

src/s_atan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,5 @@ atan(double x)
120120
}
121121

122122
#if LDBL_MANT_DIG == 53
123-
__weak_reference(atan, atanl);
123+
__strong_reference(atan, atanl);
124124
#endif

src/s_cbrt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,5 @@ cbrt(double x)
114114
}
115115

116116
#if (LDBL_MANT_DIG == 53)
117-
__weak_reference(cbrt, cbrtl);
117+
__strong_reference(cbrt, cbrtl);
118118
#endif

src/s_ceil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ ceil(double x)
7373
}
7474

7575
#if LDBL_MANT_DIG == 53
76-
__weak_reference(ceil, ceill);
76+
__strong_reference(ceil, ceill);
7777
#endif

src/s_cos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@ cos(double x)
8585
}
8686

8787
#if (LDBL_MANT_DIG == 53)
88-
__weak_reference(cos, cosl);
88+
__strong_reference(cos, cosl);
8989
#endif

0 commit comments

Comments
 (0)