]> git.ipfire.org Git - thirdparty/glibc.git/blame - elf/unload6.c
install.texi: Build was tested with binutils 2.41 (just released)
[thirdparty/glibc.git] / elf / unload6.c
CommitLineData
bfc832cc
UD
1#include <dlfcn.h>
2#include <stdio.h>
3
4int
5main (void)
6{
7 void *h = dlopen ("unload6mod1.so", RTLD_LAZY);
8 if (h == NULL)
9 {
10 puts ("dlopen unload6mod1.so failed");
11 return 1;
12 }
13
14 int (*fn) (int);
15 fn = dlsym (h, "foo");
16 if (fn == NULL)
17 {
18 puts ("dlsym failed");
19 return 1;
20 }
21
22 int val = fn (16);
23 if (val != 24)
24 {
25 printf ("foo returned %d != 24\n", val);
26 return 1;
27 }
28
29 return 0;
30}