aboutsummaryrefslogtreecommitdiff
path: root/elf/reldepmod3.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/reldepmod3.c')
-rw-r--r--elf/reldepmod3.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/elf/reldepmod3.c b/elf/reldepmod3.c
new file mode 100644
index 0000000..e56b19d
--- /dev/null
+++ b/elf/reldepmod3.c
@@ -0,0 +1,17 @@
+#include <dlfcn.h>
+#include <stdlib.h>
+
+int
+call_me (void)
+{
+ int (*fp) (void);
+
+ fp = dlsym (RTLD_DEFAULT, "foo");
+ if (fp == NULL)
+ {
+ printf ("cannot get address of foo in global scope: %s\n", dlerror ());
+ exit (1);
+ }
+
+ return fp () - 42;
+}