aboutsummaryrefslogtreecommitdiff
path: root/elf/unload8mod3.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2011-08-24 09:32:13 +0200
committerAndreas Schwab <schwab@redhat.com>2011-08-24 09:32:13 +0200
commit39dd69dfb9b8948720f05455df6775b70238803f (patch)
treeef705bd72d5de79844f371004cb96f372212bc6e /elf/unload8mod3.c
parent22044b48baa8a3c3fe67ab912e9f34a80c97880b (diff)
downloadglibc-39dd69dfb9b8948720f05455df6775b70238803f.zip
glibc-39dd69dfb9b8948720f05455df6775b70238803f.tar.gz
glibc-39dd69dfb9b8948720f05455df6775b70238803f.tar.bz2
Fix scope handling during dl_close
Diffstat (limited to 'elf/unload8mod3.c')
-rw-r--r--elf/unload8mod3.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/elf/unload8mod3.c b/elf/unload8mod3.c
new file mode 100644
index 0000000..d49e22b
--- /dev/null
+++ b/elf/unload8mod3.c
@@ -0,0 +1,27 @@
+#include <dlfcn.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void
+mod3_fini2 (void)
+{
+}
+
+void
+mod3_fini (void)
+{
+ mod3_fini2 ();
+}
+
+void
+mod3 (void)
+{
+ void *h = dlopen ("$ORIGIN/unload8mod2.so", RTLD_LAZY);
+ if (h == NULL)
+ {
+ puts ("dlopen unload8mod2.so failed");
+ exit (1);
+ }
+
+ atexit (mod3_fini);
+}