about summary refs log tree commit diff
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/at_quick_exit.c8
-rw-r--r--stdlib/atexit.c9
-rw-r--r--stdlib/tst-tls-atexit-lib.c3
3 files changed, 5 insertions, 15 deletions
diff --git a/stdlib/at_quick_exit.c b/stdlib/at_quick_exit.c
index 3b74d0a688..0f1c1fde9e 100644
--- a/stdlib/at_quick_exit.c
+++ b/stdlib/at_quick_exit.c
@@ -33,18 +33,14 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <stdlib.h>
+#include <dso_handle.h>
 #include "exit.h"
 
 
-/* This is defined by newer gcc version unique for each module.  */
-extern void *__dso_handle __attribute__ ((__weak__));
-
-
 /* Register FUNC to be executed by `quick_exit'.  */
 int
 attribute_hidden
 at_quick_exit (void (*func) (void))
 {
-  return __cxa_at_quick_exit ((void (*) (void *)) func,
-			      &__dso_handle == NULL ? NULL : __dso_handle);
+  return __cxa_at_quick_exit ((void (*) (void *)) func, __dso_handle);
 }
diff --git a/stdlib/atexit.c b/stdlib/atexit.c
index f28b6ba1b7..aaecb4a503 100644
--- a/stdlib/atexit.c
+++ b/stdlib/atexit.c
@@ -33,13 +33,9 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <stdlib.h>
+#include <dso_handle.h>
 #include "exit.h"
 
-
-/* This is defined by newer gcc version unique for each module.  */
-extern void *__dso_handle __attribute__ ((__weak__));
-
-
 /* Register FUNC to be executed by `exit'.  */
 int
 #ifndef atexit
@@ -47,6 +43,5 @@ attribute_hidden
 #endif
 atexit (void (*func) (void))
 {
-  return __cxa_atexit ((void (*) (void *)) func, NULL,
-		       &__dso_handle == NULL ? NULL : __dso_handle);
+  return __cxa_atexit ((void (*) (void *)) func, NULL, __dso_handle);
 }
diff --git a/stdlib/tst-tls-atexit-lib.c b/stdlib/tst-tls-atexit-lib.c
index a227e4653c..06ec02f4ee 100644
--- a/stdlib/tst-tls-atexit-lib.c
+++ b/stdlib/tst-tls-atexit-lib.c
@@ -17,8 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <stdlib.h>
-
-extern void *__dso_handle;
+#include <dso_handle.h>
 
 typedef struct
 {