From 393a861dbd9cc9f243efae043b852bb2e736afd0 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 5 Jun 2008 14:33:22 +0000 Subject: [PATCH] 2008-06-05 Joel Sherrill * libcsupport/src/newlibc_exit.c: Only run the fini section on exit if the target toolset uses init/fini sections. --- cpukit/ChangeLog | 5 +++++ cpukit/libcsupport/src/newlibc_exit.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index ba31daf50b..0992288c24 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,8 @@ +2008-06-05 Joel Sherrill + + * libcsupport/src/newlibc_exit.c: Only run the fini section on exit if + the target toolset uses init/fini sections. + 2008-06-05 Joel Sherrill * itron/include/rtems/itron/task.h, itron/src/task.c: ITRON currently diff --git a/cpukit/libcsupport/src/newlibc_exit.c b/cpukit/libcsupport/src/newlibc_exit.c index 735f5752d1..06fdab5cfa 100644 --- a/cpukit/libcsupport/src/newlibc_exit.c +++ b/cpukit/libcsupport/src/newlibc_exit.c @@ -127,8 +127,14 @@ void libc_wrapup(void) void EXIT_SYMBOL(int status) { - extern void _fini( void ); - _fini(); + /* + * If the toolset uses init/fini sections, then we need to + * run the global destructors now. + */ + #if defined(__USE_INIT_FINI__) + extern void _fini( void ); + _fini(); + #endif /* * We need to do the exit processing on the global reentrancy structure.