From 719404ef2e29b2240da9c63c525a9493f9bf764a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 10 Mar 2001 06:32:33 +0000 Subject: [PATCH] (main): Don't perform the test if __dso_handle is not available. --- dlfcn/tstatexit.c | 8 ++++++++ dlfcn/tstcxaatexit.c | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/dlfcn/tstatexit.c b/dlfcn/tstatexit.c index e3dfe4b..58bc8a0 100644 --- a/dlfcn/tstatexit.c +++ b/dlfcn/tstatexit.c @@ -21,6 +21,8 @@ #include +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 9ae86d0..b78ba64 100644 --- a/dlfcn/tstcxaatexit.c +++ b/dlfcn/tstcxaatexit.c @@ -20,6 +20,7 @@ #include #include +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) { -- 2.7.4