diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-10-30 00:13:29 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-10-30 00:13:29 +0000 |
commit | 5a384a9143afd73965e152cbbd13356b57d58c06 (patch) | |
tree | 9d8c5686a5509571361582d29afdf1fd97c32538 /elf/tst-pathopt.c | |
parent | 775106de7d28eed0139f76d76e7b1aab15d352df (diff) | |
download | glibc-5a384a9143afd73965e152cbbd13356b57d58c06.tar.gz glibc-5a384a9143afd73965e152cbbd13356b57d58c06.tar.xz glibc-5a384a9143afd73965e152cbbd13356b57d58c06.zip |
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.
Diffstat (limited to 'elf/tst-pathopt.c')
-rw-r--r-- | elf/tst-pathopt.c | 39 |
1 files changed, 39 insertions, 0 deletions
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 <dlfcn.h> +#include <mcheck.h> +#include <stdio.h> +#include <stdlib.h> + + +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; +} |