13 /* First try to load an object which is a dependency. This should
15 p = dlopen ("testobj1.so", RTLD_LAZY | RTLD_NOLOAD);
18 printf ("cannot open \"testobj1.so\": %s\n", dlerror ());
23 puts ("loading \"testobj1.so\" succeeded, OK");
27 /* Now try loading an object which is not already loaded. */
28 if (dlopen ("testobj5.so", RTLD_LAZY | RTLD_NOLOAD) != NULL)
30 puts ("succeeded in loading \"testobj5.so\"");
35 /* Load the object and run the same test again. */
36 puts ("\"testobj5.so\" wasn't loaded and RTLD_NOLOAD prevented it, OK");
38 p = dlopen ("testobj5.so", RTLD_LAZY);
42 printf ("cannot open \"testobj5.so\" without RTLD_NOLOAD: %s\n",
48 puts ("loading \"testobj5.so\" succeeded, OK");
50 void *q = dlopen ("testobj5.so", RTLD_LAZY | RTLD_NOLOAD);
53 printf ("cannot open \"testobj5.so\": %s\n", dlerror ());
58 puts ("loading \"testobj5.so\" with RTLD_NOLOAD succeeded, OK");
64 printf ("cannot close \"testobj5.so\": %s\n", dlerror ());
68 puts ("closing \"testobj5.so\" succeeded, OK");
76 extern int foo (int a);