about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--dlfcn/tstatexit.c8
-rw-r--r--dlfcn/tstcxaatexit.c7
2 files changed, 15 insertions, 0 deletions
diff --git a/dlfcn/tstatexit.c b/dlfcn/tstatexit.c
index e3dfe4bd08..58bc8a02c0 100644
--- a/dlfcn/tstatexit.c
+++ b/dlfcn/tstatexit.c
@@ -21,6 +21,8 @@
 #include <stdlib.h>
 
 
+extern void *__dso_handle __attribute__ ((__weak__));
+
 int
 main (void)
 {
@@ -29,6 +31,12 @@ main (void)
   void (*fp) (void *);
   int v = 0;
 
+  if (&__dso_handle == NULL)
+    {
+      puts ("__dso_handle not available, cannot perform the test");
+      exit (0);
+    }
+
   h = dlopen (fname, RTLD_NOW);
   if (h == NULL)
     {
diff --git a/dlfcn/tstcxaatexit.c b/dlfcn/tstcxaatexit.c
index 9ae86d0275..b78ba64d36 100644
--- a/dlfcn/tstcxaatexit.c
+++ b/dlfcn/tstcxaatexit.c
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+extern void *__dso_handle __attribute__ ((__weak__));
 
 int
 main (void)
@@ -29,6 +30,12 @@ main (void)
   void (*fp) (void *);
   int v = 0;
 
+  if (&__dso_handle == NULL)
+    {
+      puts ("__dso_handle not available, cannot perform the test");
+      exit (0);
+    }
+
   h = dlopen (fname, RTLD_LAZY);
   if (h == NULL)
     {