aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf/pr21964-2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-elf/pr21964-2c.c')
-rw-r--r--ld/testsuite/ld-elf/pr21964-2c.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr21964-2c.c b/ld/testsuite/ld-elf/pr21964-2c.c
new file mode 100644
index 0000000..f879dd5
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr21964-2c.c
@@ -0,0 +1,32 @@
+#include <dlfcn.h>
+#include <stdio.h>
+
+extern int foo1 (void);
+
+int main()
+{
+ void *dl;
+ void *sym;
+ int (*func) (void);
+
+ if (foo1 () != 0)
+ return 1;
+
+ dl = dlopen("pr21964-2b.so", RTLD_LAZY);
+ if (!dl)
+ return 2;
+
+ sym = dlsym(dl, "__start___verbose");
+ if (!sym)
+ return 3;
+
+ func = dlsym(dl, "foo2");
+ if (!func)
+ return 4;
+ if (func () == 0)
+ printf ("PASS\n");
+
+ dlclose(dl);
+
+ return 0;
+}