(DO_GLOBAL_CTORS_BODY): Run constructors from right to
authorJim Wilson <wilson@gcc.gnu.org>
Sat, 7 Jan 1995 02:17:39 +0000 (18:17 -0800)
committerJim Wilson <wilson@gcc.gnu.org>
Sat, 7 Jan 1995 02:17:39 +0000 (18:17 -0800)
left not left to right.

From-SVN: r8722

gcc/config/h8300/h8300.h
gcc/config/sh/sh.h

index 674b0f2a749da813f5ce8cf8323ac657f083e8f5..494dd4577c63dba211d574b3d97e66841241b122 100644 (file)
@@ -1037,9 +1037,9 @@ dtors_section()                                           \
   extern pfunc __ctors[];                      \
   extern pfunc __ctors_end[];                  \
   pfunc *p;                                    \
-  for (p = __ctors; p < __ctors_end; p++)      \
+  for (p = __ctors_end; p > __ctors; )         \
     {                                          \
-      (*p)();                                  \
+      (*--p)();                                        \
     }                                          \
 }                                              
 
index 21351b21f3dfe57c0ce298e55332aab7acc2f268..de39ef849dc03f8e53d946354f932396c2b37353 100644 (file)
@@ -1292,9 +1292,9 @@ dtors_section()                                        \
   extern pfunc __ctors[];                      \
   extern pfunc __ctors_end[];                  \
   pfunc *p;                                    \
-  for (p = __ctors; p < __ctors_end; p++)      \
+  for (p = __ctors_end; p > __ctors; )         \
     {                                          \
-      (*p)();                                  \
+      (*--p)();                                        \
     }                                          \
 }