Add some more ulps.
[glibc/pb-stable.git] / elf / constload2.c
blobd20e6dcbb81c06046a248e46dcf83bbc39eb6f49
1 #include <dlfcn.h>
2 #include <stdio.h>
3 #include <stdlib.h>
5 extern int bar (void);
7 void *h;
9 int
10 foo (void)
12 return 42 + bar ();
15 int
16 baz (void)
18 return -21;
21 void
22 __attribute__ ((__constructor__))
23 init (void)
25 h = dlopen ("constload3.so", RTLD_GLOBAL | RTLD_LAZY);
26 if (h == NULL)
28 puts ("failed to load constload3");
29 exit (1);
31 else
32 puts ("succeeded loading constload3");
35 static void
36 __attribute__ ((__destructor__))
37 fini (void)
39 if (dlclose (h) != 0)
41 puts ("failed to unload constload3");
42 exit (1);
44 else
45 puts ("succeeded unloading constload3");