+Tue Oct 12 09:45:19 1999 Jonathan Larmour <jlarmour@cygnus.co.uk>
+
+ * config/rs6000/eabi-ctors.c (__do_global_ctors): Run through
+ __CTOR_LIST__ in opposite order, which is the correct order for sorted
+ constructors.
+ (__do_global_dtors): similarly for __DTOR_LIST__.
+
Fri Oct 8 19:46:03 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
Diego Novillo <dnovillo@cygnus.com>
void
__do_global_ctors (void)
{
- func_ptr *ptr = &__CTOR_LIST__[0];
- func_ptr *end = &__CTOR_END__[0];
+ func_ptr *ptr = &__CTOR_END__[0] - 1;
+ func_ptr *start = &__CTOR_LIST__[0];
if (__atexit)
__atexit (__do_global_dtors);
/* Call the constructors collected in the .ctors section. */
- for ( ; ptr != end; ptr++)
+ for ( ; ptr >= start; ptr--)
if (*ptr)
(*ptr)();
void
__do_global_dtors (void)
{
- func_ptr *ptr = &__DTOR_END__[0] - 1;
- func_ptr *start = &__DTOR_LIST__[0];
+ func_ptr *ptr = &__DTOR_LIST__[0];
+ func_ptr *end = &__DTOR_END__[0];
/* Call the termination function in the .fini section. */
(*fini_ptr) ();
/* Call the destructors collected in the .dtors section. Run
the destructors in reverse order. */
- for ( ; ptr >= start; ptr--)
+ for ( ; ptr < end; ptr++)
if (*ptr)
(*ptr)();
}