From c4c8a3fd46c209edebbc0dc55ae08c5e9ecadf93 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Thu, 16 Apr 2009 19:16:41 +0000 Subject: [PATCH] 2009-04-16 Jeff johnston * libc/misc/init.c (__libc_fini_array): Process fini_array in reverse order as compliant with the ELF specification. --- newlib/ChangeLog | 5 +++++ newlib/libc/misc/init.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 26723d491..6ca41c09d 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2009-04-16 Jeff johnston + + * libc/misc/init.c (__libc_fini_array): Process fini_array in + reverse order as compliant with the ELF specification. + 2009-04-16 Ken Werner * libc/machine/spu/Makefile.am: Add new File. diff --git a/newlib/libc/misc/init.c b/newlib/libc/misc/init.c index 539fbefed..50bac50c7 100644 --- a/newlib/libc/misc/init.c +++ b/newlib/libc/misc/init.c @@ -52,8 +52,8 @@ __libc_fini_array (void) size_t i; count = __fini_array_end - __fini_array_start; - for (i = 0; i < count; i++) - __fini_array_start[i] (); + for (i = count; i > 0; i--) + __fini_array_start[i-1] (); _fini (); }