crtstuff.c (__dso_handle): Declare.

* crtstuff.c (__dso_handle): Declare.
	(__cxa_finalize): Likewise.
	(do_global_dtors_aux): Call __cxa_finalize if __dso_handle is
	non-NULL.

	* invoke.texi: Document -fuse-cxa-atexit.

	* tree.h (ptr_type_node): Document.
	(const_ptr_type_node): Likewise.

From-SVN: r30989
This commit is contained in:
Mark Mitchell 1999-12-17 07:39:13 +00:00 committed by Mark Mitchell
parent 5ac99d9adc
commit fc69382254
4 changed files with 38 additions and 1 deletions

View File

@ -1,3 +1,15 @@
1999-12-16 Mark Mitchell <mark@codesourcery.com>
* crtstuff.c (__dso_handle): Declare.
(__cxa_finalize): Likewise.
(do_global_dtors_aux): Call __cxa_finalize if __dso_handle is
non-NULL.
* invoke.texi: Document -fuse-cxa-atexit.
* tree.h (ptr_type_node): Document.
(const_ptr_type_node): Likewise.
Fri Dec 17 01:32:38 MET 1999 Jan Hubicka <hubicka@freesoft.cz>
* regmove.c (optimize_reg_copy_1): Ignore LOOP notes.

View File

@ -129,6 +129,19 @@ typedef void (*func_ptr) (void);
#ifdef OBJECT_FORMAT_ELF
/* Declare the __dso_handle variable. It should have a unique value
in every shared-object; in a main program its value is zero. */
#ifdef CRTSTUFFS_O
void *__dso_handle = &__dso_handle;
#else
void *__dso_handle = 0;
#endif
/* The __cxa_finalize function may not be available so we use only a
weak declaration. */
extern void __cxa_finalize (void *) TARGET_ATTRIBUTE_WEAK;
/* Run all the global destructors on exit from the program. */
/* Some systems place the number of pointers in the first word of the
@ -159,6 +172,9 @@ __do_global_dtors_aux (void)
if (completed)
return;
if (__dso_handle && __cxa_finalize)
__cxa_finalize (__dso_handle);
while (*p)
{
p++;

View File

@ -109,7 +109,7 @@ in the following sections.
-fhonor-std -fhuge-objects -fno-implicit-templates -finit-priority
-fno-implement-inlines -fname-mangling-version-@var{n} -fno-default-inline
-foperator-names -fno-optional-diags -fpermissive -frepo -fstrict-prototype
-fsquangle -ftemplate-depth-@var{n} -fvtable-thunks
-fsquangle -ftemplate-depth-@var{n} -fuse-cxa-atexit -fvtable-thunks
-nostdinc++ -Wctor-dtor-privacy -Wno-deprecated -Weffc++
-Wno-non-template-friend
-Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual
@ -1217,6 +1217,13 @@ A limit on the template instantiation depth is needed to detect
endless recursions during template class instantiation. ANSI/ISO C++
conforming programs must not rely on a maximum depth greater than 17.
@item -fuse-cxa-atexit
Register destructors for objects with static storage duration with the
@code{__cxa_atexit} function rather than the @code{atexit} function.
This option is required for fully standards-compliant handling of static
destructors, but will only work if your C library supports
@code{__cxa_atexit}.
@item -fvtable-thunks
Use @samp{thunks} to implement the virtual function dispatch table
(@samp{vtable}). The traditional (cfront-style) approach to

View File

@ -1542,7 +1542,9 @@ extern tree global_trees[TI_MAX];
#define complex_long_double_type_node global_trees[TI_COMPLEX_LONG_DOUBLE_TYPE]
#define void_type_node global_trees[TI_VOID_TYPE]
/* The C type `void *'. */
#define ptr_type_node global_trees[TI_PTR_TYPE]
/* The C type `const void *'. */
#define const_ptr_type_node global_trees[TI_CONST_PTR_TYPE]
#define ptrdiff_type_node global_trees[TI_PTRDIFF_TYPE]
#define va_list_type_node global_trees[TI_VA_LIST_TYPE]