about summary refs log tree commit diff
path: root/elf/constload2.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/constload2.c')
-rw-r--r--elf/constload2.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/elf/constload2.c b/elf/constload2.c
new file mode 100644
index 0000000000..f109838cb8
--- /dev/null
+++ b/elf/constload2.c
@@ -0,0 +1,24 @@
+#include <dlfcn.h>
+
+extern int bar (void);
+
+void *h;
+
+int
+foo (void)
+{
+  return 42 + bar ();
+}
+
+int
+baz (void)
+{
+  return -21;
+}
+
+void
+__attribute__ ((__constructor__))
+init (void)
+{
+  h = dlopen ("constload3.so", RTLD_GLOBAL | RTLD_LAZY);
+}