diff options
author | rupp <rupp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-29 15:37:48 +0000 |
---|---|---|
committer | rupp <rupp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-29 15:37:48 +0000 |
commit | a9a8ff12be8acfcac0390f29409dc6255e50a70a (patch) | |
tree | a28a854740ffb36c3778eefd446c614d49810281 /gcc/crtstuff.c | |
parent | c841fc462a6c1cb67fa39dc552a97bd72b334f97 (diff) | |
download | gcc-a9a8ff12be8acfcac0390f29409dc6255e50a70a.tar.gz |
* crtstuff.c (__do_global_dtors_aux): Use atexit if no
fini or fini_array section.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151202 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/crtstuff.c')
-rw-r--r-- | gcc/crtstuff.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c index fb278bc4460..6f8a8dd2d62 100644 --- a/gcc/crtstuff.c +++ b/gcc/crtstuff.c @@ -325,11 +325,18 @@ __do_global_dtors_aux (void) /* Stick a call to __do_global_dtors_aux into the .fini section. */ #ifdef FINI_SECTION_ASM_OP CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux) -#else /* !defined(FINI_SECTION_ASM_OP) */ +#elif defined (FINI_ARRAY_SECTION_ASM_OP) static func_ptr __do_global_dtors_aux_fini_array_entry[] __attribute__ ((__unused__, section(".fini_array"))) = { __do_global_dtors_aux }; -#endif /* !defined(FINI_SECTION_ASM_OP) */ +#else /* !FINI_SECTION_ASM_OP && !FINI_ARRAY_SECTION_ASM_OP */ +static void __attribute__((used)) +__do_global_dtors_aux_1 (void) +{ + atexit (__do_global_dtors_aux); +} +CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, __do_global_dtors_aux_1) +#endif #if defined(USE_EH_FRAME_REGISTRY) || defined(JCR_SECTION_NAME) /* Stick a call to __register_frame_info into the .init section. For some |