summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/newlibc_exit.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-06-05 14:33:22 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-06-05 14:33:22 +0000
commit393a861dbd9cc9f243efae043b852bb2e736afd0 (patch)
treee4eebe65528173685095574fea727d6e80b46b93 /cpukit/libcsupport/src/newlibc_exit.c
parent2008-06-05 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-393a861dbd9cc9f243efae043b852bb2e736afd0.tar.bz2
2008-06-05 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/src/newlibc_exit.c: Only run the fini section on exit if the target toolset uses init/fini sections.
Diffstat (limited to 'cpukit/libcsupport/src/newlibc_exit.c')
-rw-r--r--cpukit/libcsupport/src/newlibc_exit.c10
1 files changed, 8 insertions, 2 deletions
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.