9 /* First try to load an object which is a dependency. This should
11 if (dlopen ("testobj1.so", RTLD_LAZY
| RTLD_NOLOAD
) == NULL
)
13 printf ("cannot open \"testobj1.so\": %s\n", dlerror ());
17 puts ("loading \"testobj1.so\" succeeded, OK");
19 /* Now try loading an object which is not already loaded. */
20 if (dlopen ("testobj5.so", RTLD_LAZY
| RTLD_NOLOAD
) != NULL
)
22 puts ("succeeded in loading \"testobj5.so\"");
27 /* Load the object and run the same test again. */
30 puts ("\"testobj5.so\" wasn't loaded and RTLD_NOLOAD prevented it, OK");
32 p
= dlopen ("testobj5.so", RTLD_LAZY
);
36 printf ("cannot open \"testobj5.so\" without RTLD_NOLOAD: %s\n",
42 puts ("loading \"testobj5.so\" succeeded, OK");
44 if (dlopen ("testobj5.so", RTLD_LAZY
| RTLD_NOLOAD
) == NULL
)
46 printf ("cannot open \"testobj5.so\": %s\n", dlerror ());
50 puts ("loading \"testobj5.so\" with RTLD_NOLOAD succeeded, OK");
54 printf ("cannot close \"testobj5.so\": %s\n", dlerror ());
58 puts ("closing \"testobj5.so\" succeeded, OK");
66 extern int foo (int a
);