diff options
author | Andreas Jaeger <aj@suse.de> | 2003-06-07 20:50:54 +0200 |
---|---|---|
committer | Andreas Jaeger <aj@gcc.gnu.org> | 2003-06-07 20:50:54 +0200 |
commit | 5145a02e5ddfd75dfb212e5ab165b21cec63fe18 (patch) | |
tree | 0f2ad2f41ab1a152a64b7af64f2a550377c14d58 /gcc/libgcc2.c | |
parent | 39072dc8df583a5c53fa77203f560b4b359fab56 (diff) | |
download | gcc-5145a02e5ddfd75dfb212e5ab165b21cec63fe18.tar.gz |
mklibgcc.in (lib2funcs): Remove _exit.
* mklibgcc.in (lib2funcs): Remove _exit.
* libgcc2.c: Remove L_exit.
* gbl-ctors.h: Remove declarations dependend on NEED_ATEXIT.
* system.h: Poison NEED_ATEXIT, ON_EXIT, EXIT_BODY.
* doc/tm.texi (Misc): Remove NEED_ATEXIT, ON_EXIT, EXIT_BODY.
From-SVN: r67599
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r-- | gcc/libgcc2.c | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index a9d8e682a8f..e026e4b9649 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -1668,79 +1668,4 @@ func_ptr __DTOR_LIST__[2]; #endif #endif /* no INIT_SECTION_ASM_OP and not CTOR_LISTS_DEFINED_EXTERNALLY */ #endif /* L_ctors */ - -#ifdef L_exit - -#include "gbl-ctors.h" - -#ifdef NEED_ATEXIT - -#ifndef ON_EXIT - -# include <errno.h> - -static func_ptr *atexit_chain = 0; -static long atexit_chain_length = 0; -static volatile long last_atexit_chain_slot = -1; - -int -atexit (func_ptr func) -{ - if (++last_atexit_chain_slot == atexit_chain_length) - { - atexit_chain_length += 32; - if (atexit_chain) - atexit_chain = (func_ptr *) realloc (atexit_chain, atexit_chain_length - * sizeof (func_ptr)); - else - atexit_chain = (func_ptr *) malloc (atexit_chain_length - * sizeof (func_ptr)); - if (! atexit_chain) - { - atexit_chain_length = 0; - last_atexit_chain_slot = -1; - errno = ENOMEM; - return (-1); - } - } - atexit_chain[last_atexit_chain_slot] = func; - return (0); -} - -extern void _cleanup (void); -extern void _exit (int) __attribute__ ((__noreturn__)); - -void -exit (int status) -{ - if (atexit_chain) - { - for ( ; last_atexit_chain_slot-- >= 0; ) - { - (*atexit_chain[last_atexit_chain_slot + 1]) (); - atexit_chain[last_atexit_chain_slot + 1] = 0; - } - free (atexit_chain); - atexit_chain = 0; - } -#ifdef EXIT_BODY - EXIT_BODY; -#else - _cleanup (); -#endif - _exit (status); -} - -#else /* ON_EXIT */ - -/* Simple; we just need a wrapper for ON_EXIT. */ -int -atexit (func_ptr func) -{ - return ON_EXIT (func); -} - -#endif /* ON_EXIT */ -#endif /* NEED_ATEXIT */ -#endif /* L_exit */ |