diff options
Diffstat (limited to 'elf/constload1.c')
-rw-r--r-- | elf/constload1.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/elf/constload1.c b/elf/constload1.c new file mode 100644 index 0000000000..1435284c62 --- /dev/null +++ b/elf/constload1.c @@ -0,0 +1,20 @@ +#include <dlfcn.h> +#include <errno.h> +#include <error.h> +#include <stdlib.h> + +int +main (void) +{ + int (*foo) (void); + void *h; + int ret; + + h = dlopen ("constload2.so", RTLD_LAZY | RTLD_GLOBAL); + if (h == NULL) + error (EXIT_FAILURE, errno, "cannot load module \"constload2.so\""); + foo = dlsym (h, "foo"); + ret = foo (); + dlclose (h); + return ret; +} |