Module Name:    src
Committed By:   joerg
Date:           Tue Feb 22 05:45:09 UTC 2011

Modified Files:
        src/crypto/external/bsd/libsaslc/dist/src: mech.c
        src/lib/csu/alpha: crt0.c
        src/lib/csu/arm_elf: crt0.c
        src/lib/csu/common: crt0-common.c
        src/lib/csu/common_elf: common.h
        src/lib/csu/hppa: crt0.c
        src/lib/csu/ia64: crt0.c
        src/lib/csu/m68k_elf: crt0.c
        src/lib/csu/mips: crt0.c
        src/lib/csu/powerpc: crt0.c
        src/lib/csu/powerpc64: crt0.c
        src/lib/csu/sh3_elf: crt0.c
        src/lib/csu/sparc64: crt0.c
        src/lib/csu/sparc_elf: crt0.c
        src/lib/csu/vax_elf: crt0.c
        src/lib/libc/net: nsdispatch.c
        src/lib/libedit: vi.c
        src/sys/sys: cdefs_elf.h

Log Message:
Introduce __weakref_visible to handle the different required visibility
for weak references. GCC 4.2+ and Clang require static, older GCC wants
extern. Change __weak_reference to include sym. This requires changes
the existing users to not reuse the name of the symbol, but avoids
further differences between GCC 4.1 and GCC 4.2+/clang.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/libsaslc/dist/src/mech.c
cvs rdiff -u -r1.24 -r1.25 src/lib/csu/alpha/crt0.c
cvs rdiff -u -r1.7 -r1.8 src/lib/csu/arm_elf/crt0.c
cvs rdiff -u -r1.3 -r1.4 src/lib/csu/common/crt0-common.c
cvs rdiff -u -r1.13 -r1.14 src/lib/csu/common_elf/common.h
cvs rdiff -u -r1.7 -r1.8 src/lib/csu/hppa/crt0.c
cvs rdiff -u -r1.2 -r1.3 src/lib/csu/ia64/crt0.c
cvs rdiff -u -r1.11 -r1.12 src/lib/csu/m68k_elf/crt0.c
cvs rdiff -u -r1.21 -r1.22 src/lib/csu/mips/crt0.c
cvs rdiff -u -r1.26 -r1.27 src/lib/csu/powerpc/crt0.c
cvs rdiff -u -r1.2 -r1.3 src/lib/csu/powerpc64/crt0.c
cvs rdiff -u -r1.10 -r1.11 src/lib/csu/sh3_elf/crt0.c
cvs rdiff -u -r1.24 -r1.25 src/lib/csu/sparc64/crt0.c
cvs rdiff -u -r1.12 -r1.13 src/lib/csu/sparc_elf/crt0.c
cvs rdiff -u -r1.10 -r1.11 src/lib/csu/vax_elf/crt0.c
cvs rdiff -u -r1.35 -r1.36 src/lib/libc/net/nsdispatch.c
cvs rdiff -u -r1.33 -r1.34 src/lib/libedit/vi.c
cvs rdiff -u -r1.35 -r1.36 src/sys/sys/cdefs_elf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/libsaslc/dist/src/mech.c
diff -u src/crypto/external/bsd/libsaslc/dist/src/mech.c:1.6 src/crypto/external/bsd/libsaslc/dist/src/mech.c:1.7
--- src/crypto/external/bsd/libsaslc/dist/src/mech.c:1.6	Mon Feb 14 12:45:31 2011
+++ src/crypto/external/bsd/libsaslc/dist/src/mech.c	Tue Feb 22 05:45:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: mech.c,v 1.6 2011/02/14 12:45:31 christos Exp $ */
+/* $NetBSD: mech.c,v 1.7 2011/02/22 05:45:05 joerg Exp $ */
 
 /* Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: mech.c,v 1.6 2011/02/14 12:45:31 christos Exp $");
+__RCSID("$NetBSD: mech.c,v 1.7 2011/02/22 05:45:05 joerg Exp $");
 
 #include <sys/queue.h>
 
@@ -51,29 +51,29 @@
 #include "saslc_private.h"
 
 /* mechanisms */
-extern const saslc__mech_t saslc__mech_anonymous
+__weakref_visible const saslc__mech_t weak_saslc__mech_anonymous
     __weak_reference(saslc__mech_anonymous);
-extern const saslc__mech_t saslc__mech_crammd5
+__weakref_visible const saslc__mech_t weak_saslc__mech_crammd5
     __weak_reference(saslc__mech_crammd5);
-extern const saslc__mech_t saslc__mech_digestmd5
+__weakref_visible const saslc__mech_t weak_saslc__mech_digestmd5
     __weak_reference(saslc__mech_digestmd5);
-extern const saslc__mech_t saslc__mech_external
+__weakref_visible const saslc__mech_t weak_saslc__mech_external
     __weak_reference(saslc__mech_external);
-extern const saslc__mech_t saslc__mech_gssapi
+__weakref_visible const saslc__mech_t weak_saslc__mech_gssapi
     __weak_reference(saslc__mech_gssapi);
-extern const saslc__mech_t saslc__mech_login
+__weakref_visible const saslc__mech_t weak_saslc__mech_login
     __weak_reference(saslc__mech_login);
-extern const saslc__mech_t saslc__mech_plain
+__weakref_visible const saslc__mech_t weak_saslc__mech_plain
     __weak_reference(saslc__mech_plain);
 
 static const saslc__mech_t *saslc__mechanisms[] = {
-	&saslc__mech_anonymous,
-	&saslc__mech_crammd5,
-	&saslc__mech_digestmd5,
-	&saslc__mech_external,
-	&saslc__mech_gssapi,
-	&saslc__mech_login,
-	&saslc__mech_plain,
+	&weak_saslc__mech_anonymous,
+	&weak_saslc__mech_crammd5,
+	&weak_saslc__mech_digestmd5,
+	&weak_saslc__mech_external,
+	&weak_saslc__mech_gssapi,
+	&weak_saslc__mech_login,
+	&weak_saslc__mech_plain,
 };
 
 /*

Index: src/lib/csu/alpha/crt0.c
diff -u src/lib/csu/alpha/crt0.c:1.24 src/lib/csu/alpha/crt0.c:1.25
--- src/lib/csu/alpha/crt0.c:1.24	Sat Jul 26 19:24:25 2003
+++ src/lib/csu/alpha/crt0.c	Tue Feb 22 05:45:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.24 2003/07/26 19:24:25 salo Exp $ */
+/* $NetBSD: crt0.c,v 1.25 2011/02/22 05:45:05 joerg Exp $ */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou
@@ -65,7 +65,7 @@
 		__ps_strings = ps_strings;
 
 #ifdef DYNAMIC
-	if (&_DYNAMIC != NULL)
+	if (&rtld_DYNAMIC != NULL)
 		_rtld_setup(cleanup, obj);
 #endif
 
@@ -84,7 +84,7 @@
  * NOTE: Leave the RCS ID _after_ __start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.24 2003/07/26 19:24:25 salo Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.25 2011/02/22 05:45:05 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"

Index: src/lib/csu/arm_elf/crt0.c
diff -u src/lib/csu/arm_elf/crt0.c:1.7 src/lib/csu/arm_elf/crt0.c:1.8
--- src/lib/csu/arm_elf/crt0.c:1.7	Sat Jun 21 00:52:52 2008
+++ src/lib/csu/arm_elf/crt0.c	Tue Feb 22 05:45:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: crt0.c,v 1.7 2008/06/21 00:52:52 gmcgarry Exp $	*/
+/*	$NetBSD: crt0.c,v 1.8 2011/02/22 05:45:05 joerg Exp $	*/
 
 /*
  * Copyright (C) 1997 Mark Brinicombe
@@ -68,7 +68,7 @@
 "	b	" ___STRING(_C_LABEL(___start)) " ");
 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.7 2008/06/21 00:52:52 gmcgarry Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.8 2011/02/22 05:45:05 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 void
@@ -89,7 +89,7 @@
 
 #ifdef	DYNAMIC
 	/* ld(1) convention: if DYNAMIC = 0 then statically linked */
-	if (&_DYNAMIC)
+	if (&rtld_DYNAMIC)
                 _rtld_setup(cleanup, obj);
 #endif	/* DYNAMIC */
 

Index: src/lib/csu/common/crt0-common.c
diff -u src/lib/csu/common/crt0-common.c:1.3 src/lib/csu/common/crt0-common.c:1.4
--- src/lib/csu/common/crt0-common.c:1.3	Fri Feb 18 23:37:36 2011
+++ src/lib/csu/common/crt0-common.c	Tue Feb 22 05:45:06 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0-common.c,v 1.3 2011/02/18 23:37:36 joerg Exp $ */
+/* $NetBSD: crt0-common.c,v 1.4 2011/02/22 05:45:06 joerg Exp $ */
 
 /*
  * Copyright (c) 1998 Christos Zoulas
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: crt0-common.c,v 1.3 2011/02/18 23:37:36 joerg Exp $");
+__RCSID("$NetBSD: crt0-common.c,v 1.4 2011/02/22 05:45:06 joerg Exp $");
 
 #include <sys/types.h>
 #include <sys/syscall.h>
@@ -58,13 +58,7 @@
  * shared libs present, things will still work.
  */
 
-#if __GNUC_PREREQ__(4,2)
-static int rtld_DYNAMIC __attribute__((__weakref__, __alias__("_DYNAMIC")));
-#define	DYNAMIC_SYM	rtld_DYNAMIC
-#else
-extern int _DYNAMIC __weak_reference(_DYNAMIC);
-#define	DYNAMIC_SYM	_DYNAMIC
-#endif
+__weakref_visible int rtld_DYNAMIC __weak_reference(_DYNAMIC);
 
 #ifdef MCRT0
 extern void	monstartup(u_long, u_long);
@@ -111,7 +105,7 @@
 	if (ps_strings != NULL)
 		__ps_strings = ps_strings;
 
-	if (&DYNAMIC_SYM != NULL) {
+	if (&rtld_DYNAMIC != NULL) {
 		if (obj == NULL)
 			_FATAL("NULL Obj_Entry pointer in GOT\n");
 		if (obj->magic != RTLD_MAGIC)

Index: src/lib/csu/common_elf/common.h
diff -u src/lib/csu/common_elf/common.h:1.13 src/lib/csu/common_elf/common.h:1.14
--- src/lib/csu/common_elf/common.h:1.13	Mon Dec 14 01:04:02 2009
+++ src/lib/csu/common_elf/common.h	Tue Feb 22 05:45:06 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: common.h,v 1.13 2009/12/14 01:04:02 matt Exp $ */
+/* $NetBSD: common.h,v 1.14 2011/02/22 05:45:06 joerg Exp $ */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou
@@ -81,7 +81,7 @@
  * if we happen to be compiling without -static but with without any
  * shared libs present, things will still work.
  */
-extern int _DYNAMIC __weak_reference(_DYNAMIC);
+__weakref_visible int rtld_DYNAMIC __weak_reference(_DYNAMIC);
 #endif /* DYNAMIC */
 
 #ifdef MCRT0

Index: src/lib/csu/hppa/crt0.c
diff -u src/lib/csu/hppa/crt0.c:1.7 src/lib/csu/hppa/crt0.c:1.8
--- src/lib/csu/hppa/crt0.c:1.7	Thu Aug 26 21:07:14 2004
+++ src/lib/csu/hppa/crt0.c	Tue Feb 22 05:45:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: crt0.c,v 1.7 2004/08/26 21:07:14 thorpej Exp $	*/
+/*	$NetBSD: crt0.c,v 1.8 2011/02/22 05:45:06 joerg Exp $	*/
 
 /*
  * Copyright (c) 2002 Matt Fredette
@@ -110,7 +110,7 @@
 	 * For now, we take the easy way out and compare &_DYNAMIC 
 	 * to %dp, as well as to NULL.
 	 */
-	if (&_DYNAMIC != NULL && (int)&_DYNAMIC != dp)
+	if (&rtld_DYNAMIC != NULL && (int)&rtld_DYNAMIC != dp)
 		_rtld_setup(cleanup, obj);
 #endif
 
@@ -152,7 +152,7 @@
  * NOTE: Leave the RCS ID _after_ __start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.7 2004/08/26 21:07:14 thorpej Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.8 2011/02/22 05:45:06 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"

Index: src/lib/csu/ia64/crt0.c
diff -u src/lib/csu/ia64/crt0.c:1.2 src/lib/csu/ia64/crt0.c:1.3
--- src/lib/csu/ia64/crt0.c:1.2	Fri Sep 15 05:29:44 2006
+++ src/lib/csu/ia64/crt0.c	Tue Feb 22 05:45:06 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.2 2006/09/15 05:29:44 skrll Exp $ */
+/* $NetBSD: crt0.c,v 1.3 2011/02/22 05:45:06 joerg Exp $ */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou
@@ -72,7 +72,7 @@
 		__ps_strings = ps_strings;
 
 #ifdef DYNAMIC
-	if (&_DYNAMIC != NULL)
+	if (&rtld_DYNAMIC != NULL)
 		_rtld_setup(cleanup, obj);
 #endif
 
@@ -91,7 +91,7 @@
  * NOTE: Leave the RCS ID _after_ __start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.2 2006/09/15 05:29:44 skrll Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.3 2011/02/22 05:45:06 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"

Index: src/lib/csu/m68k_elf/crt0.c
diff -u src/lib/csu/m68k_elf/crt0.c:1.11 src/lib/csu/m68k_elf/crt0.c:1.12
--- src/lib/csu/m68k_elf/crt0.c:1.11	Thu Aug 26 21:09:52 2004
+++ src/lib/csu/m68k_elf/crt0.c	Tue Feb 22 05:45:06 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.11 2004/08/26 21:09:52 thorpej Exp $ */
+/* $NetBSD: crt0.c,v 1.12 2011/02/22 05:45:06 joerg Exp $ */
 
 /*
  * Copyright (c) 1999 Klaus Klein
@@ -75,7 +75,7 @@
 		__ps_strings = ps_strings;
 
 #ifdef DYNAMIC
-	if (&_DYNAMIC != NULL)
+	if (&rtld_DYNAMIC != NULL)
 		_rtld_setup(cleanup, obj);
 #endif
 
@@ -94,7 +94,7 @@
  * NOTE: Leave the RCS ID _after_ __start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.11 2004/08/26 21:09:52 thorpej Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.12 2011/02/22 05:45:06 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"

Index: src/lib/csu/mips/crt0.c
diff -u src/lib/csu/mips/crt0.c:1.21 src/lib/csu/mips/crt0.c:1.22
--- src/lib/csu/mips/crt0.c:1.21	Sun Jan 23 06:25:57 2011
+++ src/lib/csu/mips/crt0.c	Tue Feb 22 05:45:07 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.21 2011/01/23 06:25:57 matt Exp $ */
+/* $NetBSD: crt0.c,v 1.22 2011/02/22 05:45:07 joerg Exp $ */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou
@@ -142,7 +142,7 @@
 		 * XXX If we were loaded by that loader, just abort
 		 * XXX the rtld setup.
 		 */
-		if (&_DYNAMIC != NULL && cleanup != NULL && obj != NULL)
+		if (&rtld_DYNAMIC != NULL && cleanup != NULL && obj != NULL)
 			_rtld_setup(cleanup, obj);
 #endif
 	}
@@ -163,7 +163,7 @@
  *  is the entrypoint. (Only needed for old toolchains).
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.21 2011/01/23 06:25:57 matt Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.22 2011/02/22 05:45:07 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"

Index: src/lib/csu/powerpc/crt0.c
diff -u src/lib/csu/powerpc/crt0.c:1.26 src/lib/csu/powerpc/crt0.c:1.27
--- src/lib/csu/powerpc/crt0.c:1.26	Thu May 18 17:54:19 2006
+++ src/lib/csu/powerpc/crt0.c	Tue Feb 22 05:45:07 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.26 2006/05/18 17:54:19 christos Exp $ */
+/* $NetBSD: crt0.c,v 1.27 2011/02/22 05:45:07 joerg Exp $ */
 
 /*
  * Copyright (c) 1997 Jason R. Thorpe.
@@ -41,8 +41,8 @@
  * Small Data Area designators.  If not defined, will show up as being
  * at address zero.
  */
-extern int _SDA_BASE_[] __weak_reference(_SDA_BASE_);
-extern int _SDA2_BASE_[] __weak_reference(_SDA2_BASE_);
+__weakref_visible int rtld_SDA_BASE_[] __weak_reference(_SDA_BASE_);
+__weakref_visible int rtld_SDA2_BASE_[] __weak_reference(_SDA2_BASE_);
 
 /*
  * First 5 arguments are specified by the PowerPC SVR4 ABI.  The
@@ -64,10 +64,10 @@
 	 * _SDA_BASE is defined in the SVR4 ABI for PPC.
 	 * _SDA2_BASE is defined in the E[mbedded] ABI for PPC.
 	 */
-	__asm(  "lis %r13,_SDA_BASE_@ha;"
-		"addi %r13,%r13,_SDA_BASE_@l;"
-		"lis %r2,_SDA2_BASE_@ha;"
-		"addi %r2,%r2,_SDA2_BASE_@l" );
+	__asm(  "lis %r13,rtld_SDA_BASE_@ha;"
+		"addi %r13,%r13,rtld_SDA_BASE_@l;"
+		"lis %r2,rtld_SDA2_BASE_@ha;"
+		"addi %r2,%r2,rtld_SDA2_BASE_@l" );
 
 	if ((namep = argv[0]) != NULL) {	/* NULL ptr if argc = 0 */
 		if ((__progname = _strrchr(namep, '/')) == NULL)
@@ -82,7 +82,7 @@
 		__ps_strings = ps_strings;
 
 #ifdef DYNAMIC
-	if (&_DYNAMIC != NULL)
+	if (&rtld_DYNAMIC != NULL)
 		_rtld_setup(cleanup, obj);
 #endif
 
@@ -101,7 +101,7 @@
  * NOTE: Leave the RCS ID _after_ __start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.26 2006/05/18 17:54:19 christos Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.27 2011/02/22 05:45:07 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"

Index: src/lib/csu/powerpc64/crt0.c
diff -u src/lib/csu/powerpc64/crt0.c:1.2 src/lib/csu/powerpc64/crt0.c:1.3
--- src/lib/csu/powerpc64/crt0.c:1.2	Sat Jul  1 01:39:17 2006
+++ src/lib/csu/powerpc64/crt0.c	Tue Feb 22 05:45:07 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.2 2006/07/01 01:39:17 ross Exp $ */
+/* $NetBSD: crt0.c,v 1.3 2011/02/22 05:45:07 joerg Exp $ */
 
 /*
  * Copyright (c) 1997 Jason R. Thorpe.
@@ -74,7 +74,7 @@
 		__ps_strings = ps_strings;
 
 #ifdef DYNAMIC
-	if (&_DYNAMIC != NULL)
+	if (&rtld_DYNAMIC != NULL)
 		_rtld_setup(cleanup, obj);
 #endif
 
@@ -93,7 +93,7 @@
  * NOTE: Leave the RCS ID _after_ __start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.2 2006/07/01 01:39:17 ross Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.3 2011/02/22 05:45:07 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"

Index: src/lib/csu/sh3_elf/crt0.c
diff -u src/lib/csu/sh3_elf/crt0.c:1.10 src/lib/csu/sh3_elf/crt0.c:1.11
--- src/lib/csu/sh3_elf/crt0.c:1.10	Thu Aug 26 21:16:41 2004
+++ src/lib/csu/sh3_elf/crt0.c	Tue Feb 22 05:45:07 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.10 2004/08/26 21:16:41 thorpej Exp $ */
+/* $NetBSD: crt0.c,v 1.11 2011/02/22 05:45:07 joerg Exp $ */
 
 /*
  * Copyright (c) 1998 Christos Zoulas
@@ -69,7 +69,7 @@
 		__ps_strings = ps_strings;
 
 #ifdef DYNAMIC
-	if (&_DYNAMIC != NULL)
+	if (&rtld_DYNAMIC != NULL)
 		_rtld_setup(cleanup, obj);
 #endif
 
@@ -88,7 +88,7 @@
  * NOTE: Leave the RCS ID _after_ __start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.10 2004/08/26 21:16:41 thorpej Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.11 2011/02/22 05:45:07 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"

Index: src/lib/csu/sparc64/crt0.c
diff -u src/lib/csu/sparc64/crt0.c:1.24 src/lib/csu/sparc64/crt0.c:1.25
--- src/lib/csu/sparc64/crt0.c:1.24	Sat Dec 24 21:38:40 2005
+++ src/lib/csu/sparc64/crt0.c	Tue Feb 22 05:45:07 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.24 2005/12/24 21:38:40 perry Exp $ */
+/* $NetBSD: crt0.c,v 1.25 2011/02/22 05:45:07 joerg Exp $ */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou
@@ -94,7 +94,7 @@
 		__ps_strings = ps_strings;
 
 #ifdef DYNAMIC
-	if (&_DYNAMIC != NULL)
+	if (&rtld_DYNAMIC != NULL)
 		_rtld_setup(cleanup, obj);
 #endif
 
@@ -113,7 +113,7 @@
  * NOTE: Leave the RCS ID _after_ _start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.24 2005/12/24 21:38:40 perry Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.25 2011/02/22 05:45:07 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"

Index: src/lib/csu/sparc_elf/crt0.c
diff -u src/lib/csu/sparc_elf/crt0.c:1.12 src/lib/csu/sparc_elf/crt0.c:1.13
--- src/lib/csu/sparc_elf/crt0.c:1.12	Thu Aug 26 21:18:36 2004
+++ src/lib/csu/sparc_elf/crt0.c	Tue Feb 22 05:45:08 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.12 2004/08/26 21:18:36 thorpej Exp $ */
+/* $NetBSD: crt0.c,v 1.13 2011/02/22 05:45:08 joerg Exp $ */
 
 /*
  * Copyright (c) 1998 Christos Zoulas
@@ -79,7 +79,7 @@
 		__ps_strings = ps_strings;
 
 #ifdef DYNAMIC
-	if (&_DYNAMIC != NULL)
+	if (&rtld_DYNAMIC != NULL)
 		_rtld_setup(cleanup, obj);
 #endif
 
@@ -98,7 +98,7 @@
  * NOTE: Leave the RCS ID _after_ __start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.12 2004/08/26 21:18:36 thorpej Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.13 2011/02/22 05:45:08 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"

Index: src/lib/csu/vax_elf/crt0.c
diff -u src/lib/csu/vax_elf/crt0.c:1.10 src/lib/csu/vax_elf/crt0.c:1.11
--- src/lib/csu/vax_elf/crt0.c:1.10	Thu Aug 26 21:24:09 2004
+++ src/lib/csu/vax_elf/crt0.c	Tue Feb 22 05:45:08 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.10 2004/08/26 21:24:09 thorpej Exp $ */
+/* $NetBSD: crt0.c,v 1.11 2011/02/22 05:45:08 joerg Exp $ */
 
 /*
  * Copyright (c) 1999 Matt Thomas
@@ -76,7 +76,7 @@
 		__ps_strings = ps_strings;
 
 #ifdef DYNAMIC
-	if (&_DYNAMIC != NULL)
+	if (&rtld_DYNAMIC != NULL)
 		_rtld_setup(cleanup, obj);
 #endif
 
@@ -95,7 +95,7 @@
  * NOTE: Leave the RCS ID _after_ __start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.10 2004/08/26 21:24:09 thorpej Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.11 2011/02/22 05:45:08 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"

Index: src/lib/libc/net/nsdispatch.c
diff -u src/lib/libc/net/nsdispatch.c:1.35 src/lib/libc/net/nsdispatch.c:1.36
--- src/lib/libc/net/nsdispatch.c:1.35	Fri Feb 18 23:41:57 2011
+++ src/lib/libc/net/nsdispatch.c	Tue Feb 22 05:45:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nsdispatch.c,v 1.35 2011/02/18 23:41:57 joerg Exp $	*/
+/*	$NetBSD: nsdispatch.c,v 1.36 2011/02/22 05:45:08 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: nsdispatch.c,v 1.35 2011/02/18 23:41:57 joerg Exp $");
+__RCSID("$NetBSD: nsdispatch.c,v 1.36 2011/02/22 05:45:08 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -174,12 +174,9 @@
  */
 #ifndef __ELF__
 #define	is_dynamic()		(0)	/* don't bother - switch to ELF! */
-#elif __GNUC_PREREQ__(4,2)
-static int rtld_DYNAMIC __attribute__((__weakref__, __alias__("_DYNAMIC")));
-#define	is_dynamic()		(&rtld_DYNAMIC != NULL)
 #else
-extern int _DYNAMIC __weak_reference(_DYNAMIC);
-#define	is_dynamic()		(&_DYNAMIC != NULL)
+__weakref_visible int rtld_DYNAMIC __weak_reference(_DYNAMIC);
+#define	is_dynamic()		(&rtld_DYNAMIC != NULL)
 #endif
 
 

Index: src/lib/libedit/vi.c
diff -u src/lib/libedit/vi.c:1.33 src/lib/libedit/vi.c:1.34
--- src/lib/libedit/vi.c:1.33	Thu Feb 17 16:44:48 2011
+++ src/lib/libedit/vi.c	Tue Feb 22 05:45:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vi.c,v 1.33 2011/02/17 16:44:48 joerg Exp $	*/
+/*	$NetBSD: vi.c,v 1.34 2011/02/22 05:45:08 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)vi.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: vi.c,v 1.33 2011/02/17 16:44:48 joerg Exp $");
+__RCSID("$NetBSD: vi.c,v 1.34 2011/02/22 05:45:08 joerg Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -919,12 +919,8 @@
  * this is against historical precedent...
  */
 #ifdef __weak_reference
-#if __GNUC_PREREQ__(4,2)
-extern char *get_alias_text(const char *) __attribute__((__weak__));
-static char *my_get_alias_text(const char *) __attribute__((__weakref__, __alias__("get_alias_text")));
-#else
-extern char *get_alias_text(const char *) __weak_reference(get_alias_text);
-#endif
+__weakref_visible char *my_get_alias_text(const char *)
+    __weak_reference(get_alias_text);
 #endif
 protected el_action_t
 /*ARGSUSED*/
@@ -934,22 +930,16 @@
 	char alias_name[3];
 	char *alias_text;
 
-#if __GNUC_PREREQ__(4,2)
 	if (my_get_alias_text == 0) {
 		return CC_ERROR;
 	}
-#else
-	if (get_alias_text == 0) {
-		return CC_ERROR;
-	}
-#endif
 
 	alias_name[0] = '_';
 	alias_name[2] = 0;
 	if (el_getc(el, &alias_name[1]) != 1)
 		return CC_ERROR;
 
-	alias_text = get_alias_text(alias_name);
+	alias_text = my_get_alias_text(alias_name);
 	if (alias_text != NULL)
 		FUN(el,push)(el, ct_decode_string(alias_text, &el->el_scratch));
 	return CC_NORM;

Index: src/sys/sys/cdefs_elf.h
diff -u src/sys/sys/cdefs_elf.h:1.35 src/sys/sys/cdefs_elf.h:1.36
--- src/sys/sys/cdefs_elf.h:1.35	Thu Feb 17 21:06:26 2011
+++ src/sys/sys/cdefs_elf.h	Tue Feb 22 05:45:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs_elf.h,v 1.35 2011/02/17 21:06:26 joerg Exp $	*/
+/*	$NetBSD: cdefs_elf.h,v 1.36 2011/02/22 05:45:08 joerg Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -65,11 +65,17 @@
     __asm(".weak " _C_LABEL_STRING(#sym));
 
 #if __GNUC_PREREQ__(4, 0)
-#define	__weak_reference(sym)	__attribute__((__weakref__))
+#define	__weak_reference(sym)	__attribute__((__weakref__(#sym)))
 #else
 #define	__weak_reference(sym)	; __asm(".weak " _C_LABEL_STRING(#sym))
 #endif
 
+#if __GNUC_PREREQ__(4, 2)
+#define	__weakref_visible	static
+#else
+#define	__weakref_visible	extern
+#endif
+
 #define	__warn_references(sym,msg)					\
     __asm(".pushsection .gnu.warning." #sym "\n"			\
 	  ".ascii \"" msg "\"\n"					\

Reply via email to