From 5041a61cfc4e1443b7d81e0a7ec63e1bc20417d9 Mon Sep 17 00:00:00 2001 From: Jeffrey A Law Date: Tue, 25 Nov 1997 18:55:32 +0000 Subject: * crtstuff.c (do_global_dtors_aux): Handle multiple calls better. From-SVN: r16698 --- gcc/crtstuff.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/crtstuff.c') diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c index bcb5cc5..c120862 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 -- cgit v1.1