This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libgcc2.c cleanup



This fixes a long standing cleanup item (from the gcc-2.2 era).

        * libgcc2.c (__CTOR_LIST__, __DTOR_LIST__): Initialize on all
        platforms.

Index: libgcc2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/libgcc2.c,v
retrieving revision 1.61
diff -c -3 -p -r1.61 libgcc2.c
*** libgcc2.c	1999/03/11 00:57:55	1.61
--- libgcc2.c	1999/03/24 08:49:49
*************** SYMBOL__MAIN ()
*** 2903,2923 ****
  #include "gbl-ctors.h"
  
  /* Provide default definitions for the lists of constructors and
!    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.  */
  #if !defined(INIT_SECTION_ASM_OP) && !defined(CTOR_LISTS_DEFINED_EXTERNALLY)
- #if defined(__NeXT__) || defined(_AIX)
- /* After 2.3, try this definition on all systems.  */
  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 */
  
--- 2903,2919 ----
  #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.  */
+ 
  /* We declare the lists here with two elements each,
     so that they are valid empty lists if no other definition is loaded.  */
  #if !defined(INIT_SECTION_ASM_OP) && !defined(CTOR_LISTS_DEFINED_EXTERNALLY)
  func_ptr __CTOR_LIST__[2] = {0, 0};
  func_ptr __DTOR_LIST__[2] = {0, 0};
  #endif /* no INIT_SECTION_ASM_OP and not CTOR_LISTS_DEFINED_EXTERNALLY */
  #endif /* L_ctors */
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]