aboutsummaryrefslogtreecommitdiff
path: root/gcc/crtstuff.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1997-11-25 18:55:32 +0000
committerJeff Law <law@gcc.gnu.org>1997-11-25 11:55:32 -0700
commit5041a61cfc4e1443b7d81e0a7ec63e1bc20417d9 (patch)
treea915de9cb92b482fd48a7e8ad8c61a1d3e0733bc /gcc/crtstuff.c
parentbb727b5ae32bf10d1e7597f064382b9214584271 (diff)
downloadgcc-5041a61cfc4e1443b7d81e0a7ec63e1bc20417d9.zip
gcc-5041a61cfc4e1443b7d81e0a7ec63e1bc20417d9.tar.gz
gcc-5041a61cfc4e1443b7d81e0a7ec63e1bc20417d9.tar.bz2
* crtstuff.c (do_global_dtors_aux): Handle multiple calls better.
From-SVN: r16698
Diffstat (limited to 'gcc/crtstuff.c')
-rw-r--r--gcc/crtstuff.c7
1 files changed, 7 insertions, 0 deletions
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