From ec1ec41f703fd79fe5c2cfc5a5b1aaa82d82095a Mon Sep 17 00:00:00 2001 From: "Federico G. Schwindt" Date: Wed, 12 Jun 2002 03:16:21 +0000 Subject: __indr_reference() and the definition in the same compilation unit are a bad idea. use __weak_alias(), but for now put the definition at the bottom, since AUX_FUNC is not properly propagated to the weak definition, and will cause grief to the linker. should fix vax. tested by hin@ via LDSTATIC=-static, millert@ ok. --- lib/libc/gen/err.c | 11 ++++------- lib/libc/gen/errx.c | 11 ++++------- lib/libc/gen/verr.c | 11 ++++------- lib/libc/gen/verrx.c | 11 ++++------- lib/libc/gen/vwarn.c | 11 ++++------- lib/libc/gen/vwarnx.c | 11 ++++------- lib/libc/gen/warn.c | 11 ++++------- lib/libc/gen/warnx.c | 11 ++++------- 8 files changed, 32 insertions(+), 56 deletions(-) (limited to 'lib') diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c index 2a25c0a08ca..6094f12a45d 100644 --- a/lib/libc/gen/err.c +++ b/lib/libc/gen/err.c @@ -32,19 +32,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: err.c,v 1.6 2002/06/08 04:52:55 fgsch Exp $"; +static char rcsid[] = "$OpenBSD: err.c,v 1.7 2002/06/12 03:16:20 fgsch Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include -#ifdef __indr_reference -__indr_reference(_err, err); -#else -__weak_alias(err, _err); -#endif - __dead void _err(int eval, const char *fmt, ...) { @@ -54,3 +48,6 @@ _err(int eval, const char *fmt, ...) _verr(eval, fmt, ap); va_end(ap); } + +__weak_alias(err, _err); + diff --git a/lib/libc/gen/errx.c b/lib/libc/gen/errx.c index f307e243b0e..e787895420d 100644 --- a/lib/libc/gen/errx.c +++ b/lib/libc/gen/errx.c @@ -32,19 +32,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: errx.c,v 1.5 2002/06/08 04:52:55 fgsch Exp $"; +static char rcsid[] = "$OpenBSD: errx.c,v 1.6 2002/06/12 03:16:20 fgsch Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include -#ifdef __indr_reference -__indr_reference(_errx, errx); -#else -__weak_alias(errx, _errx); -#endif - __dead void _errx(int eval, const char *fmt, ...) { @@ -54,3 +48,6 @@ _errx(int eval, const char *fmt, ...) _verrx(eval, fmt, ap); va_end(ap); } + +__weak_alias(errx, _errx); + diff --git a/lib/libc/gen/verr.c b/lib/libc/gen/verr.c index aecfc012bbd..c2a7c17dff6 100644 --- a/lib/libc/gen/verr.c +++ b/lib/libc/gen/verr.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: verr.c,v 1.4 2002/06/08 04:52:55 fgsch Exp $"; +static char rcsid[] = "$OpenBSD: verr.c,v 1.5 2002/06/12 03:16:20 fgsch Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -43,12 +43,6 @@ static char rcsid[] = "$OpenBSD: verr.c,v 1.4 2002/06/08 04:52:55 fgsch Exp $"; #include #include -#ifdef __indr_reference -__indr_reference(_verr, verr); -#else -__weak_alias(verr, _verr); -#endif - extern char *__progname; /* Program name, from crt0. */ __dead void @@ -68,3 +62,6 @@ _verr(eval, fmt, ap) (void)fprintf(stderr, "%s\n", strerror(sverrno)); exit(eval); } + +__weak_alias(verr, _verr); + diff --git a/lib/libc/gen/verrx.c b/lib/libc/gen/verrx.c index 8ce7ee48d7e..40f6ca9bf51 100644 --- a/lib/libc/gen/verrx.c +++ b/lib/libc/gen/verrx.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: verrx.c,v 1.4 2002/06/08 04:52:55 fgsch Exp $"; +static char rcsid[] = "$OpenBSD: verrx.c,v 1.5 2002/06/12 03:16:20 fgsch Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -41,12 +41,6 @@ static char rcsid[] = "$OpenBSD: verrx.c,v 1.4 2002/06/08 04:52:55 fgsch Exp $"; #include #include -#ifdef __indr_reference -__indr_reference(_verrx, verrx); -#else -__weak_alias(verrx, _verrx); -#endif - extern char *__progname; /* Program name, from crt0. */ __dead void @@ -61,3 +55,6 @@ _verrx(eval, fmt, ap) (void)fprintf(stderr, "\n"); exit(eval); } + +__weak_alias(verrx, _verrx); + diff --git a/lib/libc/gen/vwarn.c b/lib/libc/gen/vwarn.c index 09e38664750..ded7092cec4 100644 --- a/lib/libc/gen/vwarn.c +++ b/lib/libc/gen/vwarn.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vwarn.c,v 1.4 2002/06/08 04:52:55 fgsch Exp $"; +static char rcsid[] = "$OpenBSD: vwarn.c,v 1.5 2002/06/12 03:16:20 fgsch Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -42,12 +42,6 @@ static char rcsid[] = "$OpenBSD: vwarn.c,v 1.4 2002/06/08 04:52:55 fgsch Exp $"; #include #include -#ifdef __indr_reference -__indr_reference(_vwarn, vwarn); -#else -__weak_alias(vwarn, _vwarn); -#endif - extern char *__progname; /* Program name, from crt0. */ void @@ -65,3 +59,6 @@ _vwarn(fmt, ap) } (void)fprintf(stderr, "%s\n", strerror(sverrno)); } + +__weak_alias(vwarn, _vwarn); + diff --git a/lib/libc/gen/vwarnx.c b/lib/libc/gen/vwarnx.c index dbc56b1ca1e..1099072d7b2 100644 --- a/lib/libc/gen/vwarnx.c +++ b/lib/libc/gen/vwarnx.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vwarnx.c,v 1.4 2002/06/08 04:52:55 fgsch Exp $"; +static char rcsid[] = "$OpenBSD: vwarnx.c,v 1.5 2002/06/12 03:16:20 fgsch Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -40,12 +40,6 @@ static char rcsid[] = "$OpenBSD: vwarnx.c,v 1.4 2002/06/08 04:52:55 fgsch Exp $" #include #include -#ifdef __indr_reference -__indr_reference(_vwarnx, vwarnx); -#else -__weak_alias(vwarnx, _vwarnx); -#endif - extern char *__progname; /* Program name, from crt0. */ void @@ -58,3 +52,6 @@ _vwarnx(fmt, ap) (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, "\n"); } + +__weak_alias(vwarnx, _vwarnx); + diff --git a/lib/libc/gen/warn.c b/lib/libc/gen/warn.c index 296f2181120..c1fcf9a6835 100644 --- a/lib/libc/gen/warn.c +++ b/lib/libc/gen/warn.c @@ -32,19 +32,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: warn.c,v 1.5 2002/06/08 04:52:55 fgsch Exp $"; +static char rcsid[] = "$OpenBSD: warn.c,v 1.6 2002/06/12 03:16:20 fgsch Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include -#ifdef __indr_reference -__indr_reference(_warn, warn); -#else -__weak_alias(warn, _warn); -#endif - void _warn(const char *fmt, ...) { @@ -54,3 +48,6 @@ _warn(const char *fmt, ...) _vwarn(fmt, ap); va_end(ap); } + +__weak_alias(warn, _warn); + diff --git a/lib/libc/gen/warnx.c b/lib/libc/gen/warnx.c index 0d36214c3aa..abab25c2ded 100644 --- a/lib/libc/gen/warnx.c +++ b/lib/libc/gen/warnx.c @@ -32,19 +32,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: warnx.c,v 1.4 2002/06/08 04:52:55 fgsch Exp $"; +static char rcsid[] = "$OpenBSD: warnx.c,v 1.5 2002/06/12 03:16:20 fgsch Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include -#ifdef __indr_reference -__indr_reference(_warnx, warnx); -#else -__weak_alias(warnx, _warnx); -#endif - void _warnx(const char *fmt, ...) { @@ -54,3 +48,6 @@ _warnx(const char *fmt, ...) _vwarnx(fmt, ap); va_end(ap); } + +__weak_alias(warnx, _warnx); + -- cgit v1.2.3