From 5a384a9143afd73965e152cbbd13356b57d58c06 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 30 Oct 2000 00:13:29 +0000 Subject: Update. * elf/Makefile: Add rules to build and run tst-pathopt. * elf/tst-pathopt.c: New file. * elf/tst-pathopt.sh: New file. * elf/pathoptobj.c: New file. --- elf/tst-pathopt.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 elf/tst-pathopt.c (limited to 'elf/tst-pathopt.c') diff --git a/elf/tst-pathopt.c b/elf/tst-pathopt.c new file mode 100644 index 0000000000..1f7aac2a41 --- /dev/null +++ b/elf/tst-pathopt.c @@ -0,0 +1,39 @@ +#include +#include +#include +#include + + +int +main (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; +} -- cgit v1.2.3