]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
mklibgcc.in (lib2funcs): Remove _exit.
authorAndreas Jaeger <aj@suse.de>
Sat, 7 Jun 2003 18:50:54 +0000 (20:50 +0200)
committerAndreas Jaeger <aj@gcc.gnu.org>
Sat, 7 Jun 2003 18:50:54 +0000 (20:50 +0200)
        * 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

gcc/ChangeLog
gcc/doc/tm.texi
gcc/gbl-ctors.h
gcc/libgcc2.c
gcc/mklibgcc.in
gcc/system.h

index b7925e5fcad29f8d57a71f9c01e8e0101182b5d1..10efafa97303f1e04cc26932eb467cb044d467ac 100644 (file)
@@ -1,5 +1,13 @@
 2003-06-07  Andreas Jaeger  <aj@suse.de>
 
+       * 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.
+
        * ggc.h: Convert to ISO C90 prototypes.
        * ggc-none.c: Likewise.
        * ggc-common.c: Likewise.
index de07785d61b36b81242ed6bd2ca4b6d7899ea195..c3fba75545a7bf294e8e0f0b9a9451696753273d 100644 (file)
@@ -9006,30 +9006,6 @@ The definition should be a C statement (sans semicolon) to generate the
 appropriate rtl instructions.  It is used only when compiling the end of
 @code{main}.
 
-@item NEED_ATEXIT
-@findex NEED_ATEXIT
-Define this if the target system lacks the function @code{atexit}
-from the ISO C standard.  If this macro is defined, a default definition
-will be provided to support C++.  If @code{ON_EXIT} is not defined,
-a default @code{exit} function will also be provided.
-
-@item ON_EXIT
-@findex ON_EXIT
-Define this macro if the target has another way to implement atexit
-functionality without replacing @code{exit}.  For instance, SunOS 4 has
-a similar @code{on_exit} library function.
-
-The definition should be a functional macro which can be used just like
-the @code{atexit} function.
-
-@item EXIT_BODY
-@findex EXIT_BODY
-Define this if your @code{exit} function needs to do something
-besides calling an external function @code{_cleanup} before
-terminating with @code{_exit}.  The @code{EXIT_BODY} macro is
-only needed if @code{NEED_ATEXIT} is defined and @code{ON_EXIT} is not
-defined.
-
 @findex INSN_SETS_ARE_DELAYED
 @item INSN_SETS_ARE_DELAYED (@var{insn})
 Define this macro as a C expression that is nonzero if it is safe for the
index 9ba79f02ddc6f839cddcdb48b6584ac154750595..2a56a9fb9fb2b462da915b5ca67c7f40aee3e46d 100644 (file)
@@ -2,7 +2,7 @@
    for getting g++ file-scope static objects constructed.  This file
    will get included either by libgcc2.c (for systems that don't support
    a .init section) or by crtstuff.c (for those that do).
-   Copyright (C) 1991, 1995, 1996, 1998, 1999, 2000
+   Copyright (C) 1991, 1995, 1996, 1998, 1999, 2000, 2003
    Free Software Foundation, Inc.
    Contributed by Ron Guilmette (rfg@segfault.us.com)
 
@@ -38,10 +38,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
        Note that this file should only be compiled with GCC.
 */
 
-#ifdef NEED_ATEXIT
-extern int atexit (void (*) (void));
-#endif
-
 /*  Declare a pointer to void function type.  */
 
 typedef void (*func_ptr) (void);
index a9d8e682a8fc88340460dcfcf2af8d114fd7354c..e026e4b9649b7893fd17eea43bf2b4fae5efd8cd 100644 (file)
@@ -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 */
-\f
-#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 */
index 6fcabfca9216b44e66c29852ac25245c5c17b618..c2eea1a13916843ad345f1c99e83926a3b7d5301 100644 (file)
@@ -48,7 +48,7 @@ lib2funcs='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3
        _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi
        _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi
        _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf _clear_cache
-       _trampoline __main _exit _absvsi2 _absvdi2 _addvsi3 _addvdi3
+       _trampoline __main _absvsi2 _absvdi2 _addvsi3 _addvdi3
        _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
        _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab
        _popcountsi2 _popcountdi2 _paritysi2 _paritydi2'
index c852553290d4e65efa579297d744b86982815ea7..febe4453e385d81dcd211c4c0fff6633b0fb01ed 100644 (file)
@@ -645,7 +645,8 @@ typedef char _Bool;
        ROUND_TYPE_SIZE_UNIT CONST_SECTION_ASM_OP CRT_GET_RFIB_TEXT        \
        DBX_LBRAC_FIRST DBX_OUTPUT_ENUM DBX_OUTPUT_SOURCE_FILENAME         \
        DBX_WORKING_DIRECTORY INSN_CACHE_DEPTH INSN_CACHE_SIZE             \
-       INSN_CACHE_LINE_WIDTH INIT_SECTION_PREAMBLE
+       INSN_CACHE_LINE_WIDTH INIT_SECTION_PREAMBLE NEED_ATEXIT ON_EXIT    \
+       EXIT_BODY
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE  \