Fix compilation of crtstuff.c when DEFAULT_USE_CXA_ATEXIT is false

PR libgcc/92988
	* crtstuff.c (__do_global_dtors_aux): Only call __cxa_finalize if
	DEFAULT_USE_CXA_ATEXIT is true.
This commit is contained in:
John David Anglin 2020-01-18 10:30:29 -05:00
parent 93bb79abfc
commit 84479e3a4c
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2020-01-18 John David Anglin <danglin@gcc.gnu.org>
PR libgcc/92988
* crtstuff.c (__do_global_dtors_aux): Only call __cxa_finalize if
DEFAULT_USE_CXA_ATEXIT is true.
2020-01-16 Mihail-Calin Ionescu <mihail.ionescu@arm.com> 2020-01-16 Mihail-Calin Ionescu <mihail.ionescu@arm.com>
Thomas Preud'homme <thomas.preudhomme@arm.com> Thomas Preud'homme <thomas.preudhomme@arm.com>

View File

@ -382,10 +382,12 @@ __do_global_dtors_aux (void)
if (__builtin_expect (completed, 0)) if (__builtin_expect (completed, 0))
return; return;
#if DEFAULT_USE_CXA_ATEXIT
#ifdef CRTSTUFFS_O #ifdef CRTSTUFFS_O
if (__cxa_finalize) if (__cxa_finalize)
__cxa_finalize (__dso_handle); __cxa_finalize (__dso_handle);
#endif #endif
#endif
#ifdef FINI_ARRAY_SECTION_ASM_OP #ifdef FINI_ARRAY_SECTION_ASM_OP
/* If we are using .fini_array then destructors will be run via that /* If we are using .fini_array then destructors will be run via that