aboutsummaryrefslogtreecommitdiff
path: root/dlfcn/failtestmod.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-10 04:31:24 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-10 04:31:24 +0000
commitd743ba1e9bf45b532c18ea437476984c0e2f0c44 (patch)
tree9424ee47f86f76054b196634ca1bafc2745f1fa0 /dlfcn/failtestmod.c
parent04470dc03e2d56b1acc0c152d9ad50bdf1066bfa (diff)
downloadglibc-d743ba1e9bf45b532c18ea437476984c0e2f0c44.zip
glibc-d743ba1e9bf45b532c18ea437476984c0e2f0c44.tar.gz
glibc-d743ba1e9bf45b532c18ea437476984c0e2f0c44.tar.bz2
Update.
2000-06-09 H.J. Lu <hjl@gnu.org> * dlfcn/dlerror.c (_dlerror_run): Set result->errstring to NULL after freeing it. * dlfcn/Makefile (distribute): Add failtestmod.c. (tests): Add failtest. Add rules to build and run failtest. * dlfcn/failtest.c: New file. * dlfcn/failtestmod.c: New file.
Diffstat (limited to 'dlfcn/failtestmod.c')
-rw-r--r--dlfcn/failtestmod.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/dlfcn/failtestmod.c b/dlfcn/failtestmod.c
new file mode 100644
index 0000000..595da4d
--- /dev/null
+++ b/dlfcn/failtestmod.c
@@ -0,0 +1,25 @@
+#include <dlfcn.h>
+#include <stdio.h>
+
+
+void
+__attribute__ ((__constructor__))
+constr (void)
+{
+ void *handle;
+ void *m;
+
+ /* Open the library. */
+ handle = dlopen (NULL, RTLD_NOW);
+ if (handle == NULL)
+ {
+ puts ("Cannot get handle to own object");
+ return;
+ }
+
+ /* Get a symbol. */
+ m = dlsym (handle, "main");
+ puts ("called dlsym() to get main");
+
+ dlclose (handle);
+}