summaryrefslogtreecommitdiff
path: root/elf/constload1.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-03-17 02:17:59 +0000
committerUlrich Drepper <drepper@redhat.com>2000-03-17 02:17:59 +0000
commit19cf43bed69d9952c39391f42f22114afb3a0d3f (patch)
tree15725e3712fc919ec7d670c42ba0e66d5d41e53d /elf/constload1.c
parent13a836048c08f552187f2172cb362fb98f42c965 (diff)
downloadglibc-19cf43bed69d9952c39391f42f22114afb3a0d3f.tar.gz
Update.
2000-03-16 Ulrich Drepper <drepper@redhat.com> * elf/Makefile: Add rules to compile and rune constload1 test. * elf/constload1.c: New file. * elf/constload2.c: New file. * elf/constload3.c: New file.
Diffstat (limited to 'elf/constload1.c')
-rw-r--r--elf/constload1.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/elf/constload1.c b/elf/constload1.c
new file mode 100644
index 0000000000..1435284c62
--- /dev/null
+++ b/elf/constload1.c
@@ -0,0 +1,20 @@
+#include <dlfcn.h>
+#include <errno.h>
+#include <error.h>
+#include <stdlib.h>
+
+int
+main (void)
+{
+ int (*foo) (void);
+ void *h;
+ int ret;
+
+ h = dlopen ("constload2.so", RTLD_LAZY | RTLD_GLOBAL);
+ if (h == NULL)
+ error (EXIT_FAILURE, errno, "cannot load module \"constload2.so\"");
+ foo = dlsym (h, "foo");
+ ret = foo ();
+ dlclose (h);
+ return ret;
+}