summaryrefslogtreecommitdiff
path: root/REORG.TODO/dlfcn/failtestmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'REORG.TODO/dlfcn/failtestmod.c')
-rw-r--r--REORG.TODO/dlfcn/failtestmod.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/REORG.TODO/dlfcn/failtestmod.c b/REORG.TODO/dlfcn/failtestmod.c
new file mode 100644
index 0000000000..64dadd53ff
--- /dev/null
+++ b/REORG.TODO/dlfcn/failtestmod.c
@@ -0,0 +1,25 @@
+#include <dlfcn.h>
+#include <stdio.h>
+
+
+extern void constr (void) __attribute__ ((__constructor__));
+void
+__attribute__ ((__constructor__))
+constr (void)
+{
+ void *handle;
+
+ /* Open the library. */
+ handle = dlopen (NULL, RTLD_NOW);
+ if (handle == NULL)
+ {
+ puts ("Cannot get handle to own object");
+ return;
+ }
+
+ /* Get a symbol. */
+ dlsym (handle, "main");
+ puts ("called dlsym() to get main");
+
+ dlclose (handle);
+}