about summary refs log tree commit diff
path: root/sysdeps/generic/bb_init_func.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/bb_init_func.c')
-rw-r--r--sysdeps/generic/bb_init_func.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/generic/bb_init_func.c b/sysdeps/generic/bb_init_func.c
index 0560493a37..b872fc12b1 100644
--- a/sysdeps/generic/bb_init_func.c
+++ b/sysdeps/generic/bb_init_func.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David Mosberger (davidm@cs.arizona.edu).
 
@@ -47,6 +47,8 @@ __bb_init_func (struct __bb *bb)
     {
       /* we didn't register _mcleanup yet and pc profiling doesn't seem
 	 to be active, so let's register it now: */
-      atexit (_mcleanup);
+      extern void *__dso_handle __attribute__ ((__weak__));
+      __cxa_atexit ((void (*) (void *)) _mcleanup, NULL,
+		    &__dso_handle ? __dso_handle : NULL);
     }
 }