summaryrefslogtreecommitdiff
path: root/gcc/libgcc2.c
diff options
context:
space:
mode:
authoraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-07 18:50:54 +0000
committeraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-07 18:50:54 +0000
commit98f49db325c55114341c32bdf83cfada771bd9d0 (patch)
tree0f2ad2f41ab1a152a64b7af64f2a550377c14d58 /gcc/libgcc2.c
parentb6929d5321816a2f2d29676e6dffe3e54c1feee3 (diff)
downloadgcc-98f49db325c55114341c32bdf83cfada771bd9d0.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67599 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r--gcc/libgcc2.c75
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 */