From: Jeffrey A Law Date: Tue, 25 Nov 1997 16:58:18 +0000 (+0000) Subject: * crtstuff.c (do_global_dtors_aux): Handle multiple calls better. X-Git-Tag: releases/egcs-1.0.0~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52907c98979784752de9f1756591b92f8345b5e8;p=thirdparty%2Fgcc.git * crtstuff.c (do_global_dtors_aux): Handle multiple calls better. From-SVN: r16697 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 94c94d09e561..8b5694b5a0bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Tue Nov 25 10:00:42 1997 Jeffrey A Law (law@cygnus.com) + + * crtstuff.c (do_global_dtors_aux): Handle multiple calls better. + Sun Nov 23 13:01:48 1997 Jeffrey A Law (law@cygnus.com) * version.c: Bump for snapshot. diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c index bcb5cc50bf0b..c120862139a2 100644 --- a/gcc/crtstuff.c +++ b/gcc/crtstuff.c @@ -128,6 +128,11 @@ static void __do_global_dtors_aux () { static func_ptr *p = __DTOR_LIST__ + 1; + static int completed = 0; + + if (completed) + return; + while (*p) { p++; @@ -137,8 +142,10 @@ __do_global_dtors_aux () #ifdef EH_FRAME_SECTION_ASM_OP __deregister_frame (__EH_FRAME_BEGIN__); #endif + completed = 1; } + /* Stick a call to __do_global_dtors_aux into the .fini section. */ static void