about summary refs log tree commit diff
path: root/REORG.TODO/elf/tst-pathopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'REORG.TODO/elf/tst-pathopt.c')
-rw-r--r--REORG.TODO/elf/tst-pathopt.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/REORG.TODO/elf/tst-pathopt.c b/REORG.TODO/elf/tst-pathopt.c
new file mode 100644
index 0000000000..e2c96fbc72
--- /dev/null
+++ b/REORG.TODO/elf/tst-pathopt.c
@@ -0,0 +1,41 @@
+#include <dlfcn.h>
+#include <mcheck.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+static int
+do_test (void)
+{
+  void *h;
+  int (*fp) (int);
+  int result;
+
+  mtrace ();
+
+  h = dlopen ("renamed.so", RTLD_LAZY);
+  if (h == NULL)
+    {
+      printf ("failed to load \"%s\": %s\n", "renamed.so", dlerror ());
+      exit (1);
+    }
+
+  fp = dlsym (h, "in_renamed");
+  if (fp == NULL)
+    {
+      printf ("lookup of \"%s\" failed: %s\n", "in_renamed", dlerror ());
+      exit (1);
+    }
+
+  result = fp (10);
+
+  if (dlclose (h) != 0)
+    {
+      printf ("failed to close \"%s\": %s\n", "renamed.so", dlerror ());
+      exit (1);
+    }
+
+  return result;
+}
+
+#include <support/test-driver.c>