16 if ((su
[0] = dlopen ("testobj1.so", RTLD_GLOBAL
| RTLD_NOW
)) == NULL
17 || (su
[1] = dlopen ("testobj2.so", RTLD_GLOBAL
| RTLD_NOW
)) == NULL
18 || (su
[2] = dlopen ("testobj3.so", RTLD_GLOBAL
| RTLD_NOW
)) == NULL
19 || (su
[3] = dlopen ("testobj4.so", RTLD_GLOBAL
| RTLD_NOW
)) == NULL
20 || (su
[4] = dlopen ("testobj5.so", RTLD_GLOBAL
| RTLD_NOW
)) == NULL
)
21 error (EXIT_FAILURE
, 0, "failed to load shared object: %s", dlerror ());
23 h
= dlopen ("failobj.so", RTLD_GLOBAL
| RTLD_NOW
);
25 printf ("h = %p, %s\n", h
, h
== NULL
? "ok" : "fail");
27 for (n
= 0; n
< 5; ++n
)
28 if (dlclose (su
[n
]) != 0)
30 printf ("failed to unload su[%d]: %s\n", n
, dlerror ());
37 extern int foo (int a
);