summaryrefslogtreecommitdiff
path: root/gnu/egcs/gcc/libgcc2.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-07-18 16:38:59 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-07-18 16:38:59 +0000
commit6cd1705862866b49116ca4c1e1c724064c1a0dbe (patch)
tree0d30a4844b89bff3fb6d4af2931b6b91793144b1 /gnu/egcs/gcc/libgcc2.c
parent3ea7d6f69d05ad249133b00a14f4e681262ce71c (diff)
Update to 990629 snapshot
closer to gcc 2.95 release.
Diffstat (limited to 'gnu/egcs/gcc/libgcc2.c')
-rw-r--r--gnu/egcs/gcc/libgcc2.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/gnu/egcs/gcc/libgcc2.c b/gnu/egcs/gcc/libgcc2.c
index a902dd3be75..6d8fb0b77db 100644
--- a/gnu/egcs/gcc/libgcc2.c
+++ b/gnu/egcs/gcc/libgcc2.c
@@ -2903,17 +2903,26 @@ SYMBOL__MAIN ()
#include "gbl-ctors.h"
/* Provide default definitions for the lists of constructors and
- destructors, so that we don't get linker errors.
-
- The old code sometimes put these into the data segment and sometimes
- into the bss segment. Putting these into the data segment should always
- work and avoids a little bit of complexity. */
+ destructors, so that we don't get linker errors. These symbols are
+ intentionally bss symbols, so that gld and/or collect will provide
+ the right values. */
/* We declare the lists here with two elements each,
- so that they are valid empty lists if no other definition is loaded. */
+ so that they are valid empty lists if no other definition is loaded.
+
+ If we are using the old "set" extensions to have the gnu linker
+ collect ctors and dtors, then we __CTOR_LIST__ and __DTOR_LIST__
+ must be in the bss/common section.
+
+ Long term no port should use those extensions. But many still do. */
#if !defined(INIT_SECTION_ASM_OP) && !defined(CTOR_LISTS_DEFINED_EXTERNALLY)
+#if defined (ASM_OUTPUT_CONSTRUCTOR) || defined (USE_COLLECT2)
func_ptr __CTOR_LIST__[2] = {0, 0};
func_ptr __DTOR_LIST__[2] = {0, 0};
+#else
+func_ptr __CTOR_LIST__[2];
+func_ptr __DTOR_LIST__[2];
+#endif
#endif /* no INIT_SECTION_ASM_OP and not CTOR_LISTS_DEFINED_EXTERNALLY */
#endif /* L_ctors */