diff options
author | merrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-07-29 19:03:37 +0000 |
---|---|---|
committer | merrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-07-29 19:03:37 +0000 |
commit | a0b2c9a2cb13df03137ff439458e3e02c02bba24 (patch) | |
tree | 220291a2658bea86e2b9626725704a2023ceddd6 /gcc/libgcc2.c | |
parent | 1616a2ffd05367cfebfcb3c3cc88a6ad8e4060a5 (diff) | |
download | gcc-a0b2c9a2cb13df03137ff439458e3e02c02bba24.tar.gz |
Reverse order of execution of
destructor lists.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@7817 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r-- | gcc/libgcc2.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index fc2e1ac64b4..98c75d89e26 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -1995,21 +1995,9 @@ __do_global_dtors () #ifdef DO_GLOBAL_DTORS_BODY DO_GLOBAL_DTORS_BODY; #else - unsigned nptrs = (unsigned HOST_WIDE_INT) __DTOR_LIST__[0]; - unsigned i; - - /* Some systems place the number of pointers - in the first word of the table. - On other systems, that word is -1. - In all cases, the table is null-terminated. */ - - /* If the length is not recorded, count up to the null. */ - if (nptrs == -1) - for (nptrs = 0; __DTOR_LIST__[nptrs + 1] != 0; nptrs++); - - /* GNU LD format. */ - for (i = nptrs; i >= 1; i--) - __DTOR_LIST__[i] (); + func_ptr *p; + for (p = __DTOR_LIST__ + 1; *p; ) + (*p++) (); #endif } |