From: Jim Wilson Date: Sat, 7 Jan 1995 02:17:39 +0000 (-0800) Subject: (DO_GLOBAL_CTORS_BODY): Run constructors from right to X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1fe41cbd37fca7d9079cc7fce669c68ac294c99;p=gcc.git (DO_GLOBAL_CTORS_BODY): Run constructors from right to left not left to right. From-SVN: r8722 --- diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 674b0f2a749..494dd4577c6 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -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)(); \ } \ } diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index 21351b21f3d..de39ef849dc 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -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)(); \ } \ }