diff options
author | 2013-03-28 18:09:38 +0000 | |
---|---|---|
committer | 2013-03-28 18:09:38 +0000 | |
commit | 2fbf033e009bb5c4db92160700ec03c25f292728 (patch) | |
tree | 9aef21f59264f48d8d9ffa3618aef7e19a65c105 /lib/libc/gen | |
parent | Add STRONG_ALIAS macros to be used from assembly code in libc and (diff) | |
download | wireguard-openbsd-2fbf033e009bb5c4db92160700ec03c25f292728.tar.xz wireguard-openbsd-2fbf033e009bb5c4db92160700ec03c25f292728.zip |
Switch libc and libm to use strong aliases rather than weak aliases
where appropriate. Among other things makes the symbols consistent
across all architectures (notably where ldbl mantissa is 53 bits).
While at it, kill unused LINTLIBRARY/PROTOLIB1 cruft which was there
to trick lint into recording the right prototypes for aliased
functions. Most of the work done at the awesome n2k13 hackathon.
Agreed by kettenis@, guenther@, matthew@.
Diffstat (limited to 'lib/libc/gen')
-rw-r--r-- | lib/libc/gen/fpclassify.c | 11 | ||||
-rw-r--r-- | lib/libc/gen/frexp.c | 11 | ||||
-rw-r--r-- | lib/libc/gen/isfinite.c | 15 | ||||
-rw-r--r-- | lib/libc/gen/isinf.c | 15 | ||||
-rw-r--r-- | lib/libc/gen/isnan.c | 15 | ||||
-rw-r--r-- | lib/libc/gen/isnormal.c | 11 | ||||
-rw-r--r-- | lib/libc/gen/ldexp.c | 11 | ||||
-rw-r--r-- | lib/libc/gen/modf.c | 11 | ||||
-rw-r--r-- | lib/libc/gen/signbit.c | 11 |
9 files changed, 24 insertions, 87 deletions
diff --git a/lib/libc/gen/fpclassify.c b/lib/libc/gen/fpclassify.c index d597531c1ea..c844366199d 100644 --- a/lib/libc/gen/fpclassify.c +++ b/lib/libc/gen/fpclassify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpclassify.c,v 1.6 2012/12/05 23:19:59 deraadt Exp $ */ +/* $OpenBSD: fpclassify.c,v 1.7 2013/03/28 18:09:38 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -15,8 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* LINTLIBRARY */ - #include <sys/types.h> #include <machine/ieee.h> #include <float.h> @@ -67,10 +65,5 @@ __fpclassifyf(float f) } #if LDBL_MANT_DIG == 53 -#ifdef lint -/* PROTOLIB1 */ -int __fpclassifyl(long double); -#else /* lint */ -__weak_alias(__fpclassifyl, __fpclassify); -#endif /* lint */ +__strong_alias(__fpclassifyl, __fpclassify); #endif /* LDBL_MANT_DIG == 53 */ diff --git a/lib/libc/gen/frexp.c b/lib/libc/gen/frexp.c index 9fce77b6362..22c4935abc7 100644 --- a/lib/libc/gen/frexp.c +++ b/lib/libc/gen/frexp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frexp.c,v 1.8 2012/12/05 23:19:59 deraadt Exp $ */ +/* $OpenBSD: frexp.c,v 1.9 2013/03/28 18:09:38 martynas Exp $ */ /*- * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG> @@ -28,8 +28,6 @@ * $FreeBSD: frexp.c,v 1.1 2004/07/18 21:23:39 das Exp $ */ -/* LINTLIBRARY */ - #include <sys/types.h> #include <machine/ieee.h> #include <float.h> @@ -69,10 +67,5 @@ frexp(double v, int *ex) } #if LDBL_MANT_DIG == 53 -#ifdef lint -/* PROTOLIB1 */ -long double frexpl(long double, int *); -#else /* lint */ -__weak_alias(frexpl, frexp); -#endif /* lint */ +__strong_alias(frexpl, frexp); #endif /* LDBL_MANT_DIG == 53 */ diff --git a/lib/libc/gen/isfinite.c b/lib/libc/gen/isfinite.c index 9adda1cc981..7a5a08abc2e 100644 --- a/lib/libc/gen/isfinite.c +++ b/lib/libc/gen/isfinite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isfinite.c,v 1.6 2012/12/05 23:19:59 deraadt Exp $ */ +/* $OpenBSD: isfinite.c,v 1.7 2013/03/28 18:09:38 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -15,8 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* LINTLIBRARY */ - #include <sys/types.h> #include <machine/ieee.h> #include <float.h> @@ -39,16 +37,11 @@ __isfinitef(float f) } #if LDBL_MANT_DIG == 53 -#ifdef lint -/* PROTOLIB1 */ -int __isfinitel(long double); -#else /* lint */ -__weak_alias(__isfinitel, __isfinite); -#endif /* lint */ +__strong_alias(__isfinitel, __isfinite); #endif /* LDBL_MANT_DIG == 53 */ /* * 3BSD compatibility aliases. */ -__weak_alias(finite, __isfinite); -__weak_alias(finitef, __isfinitef); +__strong_alias(finite, __isfinite); +__strong_alias(finitef, __isfinitef); diff --git a/lib/libc/gen/isinf.c b/lib/libc/gen/isinf.c index 264864cbad3..0bff56d337b 100644 --- a/lib/libc/gen/isinf.c +++ b/lib/libc/gen/isinf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinf.c,v 1.7 2012/12/05 23:19:59 deraadt Exp $ */ +/* $OpenBSD: isinf.c,v 1.8 2013/03/28 18:09:38 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -15,8 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* LINTLIBRARY */ - #include <sys/types.h> #include <machine/ieee.h> #include <float.h> @@ -39,16 +37,11 @@ __isinff(float f) } #if LDBL_MANT_DIG == 53 -#ifdef lint -/* PROTOLIB1 */ -int __isinfl(long double); -#else /* lint */ -__weak_alias(__isinfl, __isinf); -#endif /* lint */ +__strong_alias(__isinfl, __isinf); #endif /* LDBL_MANT_DIG == 53 */ /* * 3BSD compatibility aliases. */ -__weak_alias(isinf, __isinf); -__weak_alias(isinff, __isinff); +__strong_alias(isinf, __isinf); +__strong_alias(isinff, __isinff); diff --git a/lib/libc/gen/isnan.c b/lib/libc/gen/isnan.c index e34849ac480..ee9b850181f 100644 --- a/lib/libc/gen/isnan.c +++ b/lib/libc/gen/isnan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnan.c,v 1.6 2012/12/05 23:19:59 deraadt Exp $ */ +/* $OpenBSD: isnan.c,v 1.7 2013/03/28 18:09:38 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -15,8 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* LINTLIBRARY */ - #include <sys/types.h> #include <machine/ieee.h> #include <float.h> @@ -39,16 +37,11 @@ __isnanf(float f) } #if LDBL_MANT_DIG == 53 -#ifdef lint -/* PROTOLIB1 */ -int __isnanl(long double); -#else /* lint */ -__weak_alias(__isnanl, __isnan); -#endif /* lint */ +__strong_alias(__isnanl, __isnan); #endif /* LDBL_MANT_DIG == 53 */ /* * 3BSD compatibility aliases. */ -__weak_alias(isnan, __isnan); -__weak_alias(isnanf, __isnanf); +__strong_alias(isnan, __isnan); +__strong_alias(isnanf, __isnanf); diff --git a/lib/libc/gen/isnormal.c b/lib/libc/gen/isnormal.c index 19a43263c79..13d04f2a1be 100644 --- a/lib/libc/gen/isnormal.c +++ b/lib/libc/gen/isnormal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnormal.c,v 1.6 2012/12/05 23:19:59 deraadt Exp $ */ +/* $OpenBSD: isnormal.c,v 1.7 2013/03/28 18:09:38 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -15,8 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* LINTLIBRARY */ - #include <sys/types.h> #include <machine/ieee.h> #include <float.h> @@ -39,10 +37,5 @@ __isnormalf(float f) } #if LDBL_MANT_DIG == 53 -#ifdef lint -/* PROTOLIB1 */ -int __isnormall(long double); -#else /* lint */ -__weak_alias(__isnormall, __isnormal); -#endif /* lint */ +__strong_alias(__isnormall, __isnormal); #endif /* LDBL_MANT_DIG == 53 */ diff --git a/lib/libc/gen/ldexp.c b/lib/libc/gen/ldexp.c index 8fd78555a52..38ed29268ba 100644 --- a/lib/libc/gen/ldexp.c +++ b/lib/libc/gen/ldexp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldexp.c,v 1.6 2012/12/05 23:20:00 deraadt Exp $ */ +/* $OpenBSD: ldexp.c,v 1.7 2013/03/28 18:09:38 martynas Exp $ */ /* @(#)s_scalbn.c 5.1 93/09/24 */ /* @(#)fdlibm.h 5.1 93/09/24 */ /* @@ -12,8 +12,6 @@ * ==================================================== */ -/* LINTLIBRARY */ - #include <sys/types.h> #include <machine/endian.h> #include <float.h> @@ -124,10 +122,5 @@ ldexp(double x, int n) } #if LDBL_MANT_DIG == 53 -#ifdef lint -/* PROTOLIB1 */ -long double ldexpl(long double, int); -#else /* lint */ -__weak_alias(ldexpl, ldexp); -#endif /* lint */ +__strong_alias(ldexpl, ldexp); #endif /* LDBL_MANT_DIG == 53 */ diff --git a/lib/libc/gen/modf.c b/lib/libc/gen/modf.c index fde7cd82bab..586ed28a49a 100644 --- a/lib/libc/gen/modf.c +++ b/lib/libc/gen/modf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: modf.c,v 1.4 2011/07/08 22:48:19 martynas Exp $ */ +/* $OpenBSD: modf.c,v 1.5 2013/03/28 18:09:38 martynas Exp $ */ /* $NetBSD: modf.c,v 1.1 1995/02/10 17:50:25 cgd Exp $ */ /* @@ -28,8 +28,6 @@ * rights to redistribute these changes. */ -/* LINTLIBRARY */ - #include <sys/types.h> #include <machine/ieee.h> #include <errno.h> @@ -107,10 +105,5 @@ modf(double val, double *iptr) } #if LDBL_MANT_DIG == 53 -#ifdef lint -/* PROTOLIB1 */ -long double frexpl(long double, int *); -#else /* lint */ -__weak_alias(modfl, modf); -#endif /* lint */ +__strong_alias(modfl, modf); #endif /* LDBL_MANT_DIG == 53 */ diff --git a/lib/libc/gen/signbit.c b/lib/libc/gen/signbit.c index 2dbcd84a2a5..acb3de33dbc 100644 --- a/lib/libc/gen/signbit.c +++ b/lib/libc/gen/signbit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signbit.c,v 1.5 2012/12/05 23:20:00 deraadt Exp $ */ +/* $OpenBSD: signbit.c,v 1.6 2013/03/28 18:09:38 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -15,8 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* LINTLIBRARY */ - #include <sys/types.h> #include <machine/ieee.h> #include <float.h> @@ -39,10 +37,5 @@ __signbitf(float f) } #if LDBL_MANT_DIG == 53 -#ifdef lint -/* PROTOLIB1 */ -int __signbitl(long double); -#else /* lint */ -__weak_alias(__signbitl, __signbit); -#endif /* lint */ +__strong_alias(__signbitl, __signbit); #endif /* LDBL_MANT_DIG == 53 */ |