2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-04-15 15:11:15 +08:00

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
This commit is contained in:
Andreas Jaeger 2003-06-07 20:50:54 +02:00 committed by Andreas Jaeger
parent 39072dc8df
commit 5145a02e5d
6 changed files with 12 additions and 106 deletions

@ -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.

@ -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

@ -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);

@ -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 */

@ -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'

@ -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 \