diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-02-02 06:54:15 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-02-02 06:54:15 +0000 |
commit | b71e7ce8641f7331de82cabea384359cf6d8546d (patch) | |
tree | e1e43e03961e7daaad13afa0cff3a4da30e7f791 /elf/initfirst.c | |
parent | 5d9167133cd1b614e2841eceba5d6c3828059254 (diff) | |
download | glibc-b71e7ce8641f7331de82cabea384359cf6d8546d.tar.gz glibc-b71e7ce8641f7331de82cabea384359cf6d8546d.tar.xz glibc-b71e7ce8641f7331de82cabea384359cf6d8546d.zip |
Update.
* elf/Makefile: Add rules to build and run initfirst test. * elf/initfirst.c: New file. * elf/firstobj.c: New file.
Diffstat (limited to 'elf/initfirst.c')
-rw-r--r-- | elf/initfirst.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/elf/initfirst.c b/elf/initfirst.c new file mode 100644 index 0000000000..5ca83d21bc --- /dev/null +++ b/elf/initfirst.c @@ -0,0 +1,22 @@ +#include <dlfcn.h> +#include <stdio.h> + +int +main (void) +{ + void *h = dlopen ("firstobj.so", RTLD_LAZY); + void *f; + if (! h) + { + printf ("cannot find firstobj.so: %s\n", dlerror ()); + return 1; + } + f = dlsym (h, "foo"); + if (! f) + { + printf ("cannot find symbol foo: %s\n", dlerror ()); + return 2; + } + ((void (*) (void)) f) (); + return 0; +} |