diff options
author | Jeffrey A Law <law@cygnus.com> | 1999-06-11 03:12:22 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-06-10 21:12:22 -0600 |
commit | 657be7aff1202e2422538818aa6c20ad88a64766 (patch) | |
tree | f0e3f6432b8d16aa10539efd68881ddfbc6b6876 /gcc/libgcc2.c | |
parent | 2fdf4c3e97a23e8fb59542568f5536bcf05ac188 (diff) | |
download | gcc-657be7aff1202e2422538818aa6c20ad88a64766.zip gcc-657be7aff1202e2422538818aa6c20ad88a64766.tar.gz gcc-657be7aff1202e2422538818aa6c20ad88a64766.tar.bz2 |
Makefile.in (libgcc2): Pass MAYBE_USE_COLLECT2 as an argument.
* Makefile.in (libgcc2): Pass MAYBE_USE_COLLECT2 as an argument.
* libgcc2.c (__CTOR_LIST, __DTOR_LIST); Do not provide
initializers is some circumstances.
From-SVN: r27489
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r-- | gcc/libgcc2.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index a902dd3b..6d8fb0b 100644 --- a/gcc/libgcc2.c +++ b/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 */ |