1 /* Test for unloading (really unmapping) of objects. By Franz Sirl.
2 This test does not have to passed in all dlopen() et.al. implementation
3 since it is not required the unloading actually happens. But we
4 require it for glibc. */
26 sohandle = dlopen ("unloadmod.so", RTLD_NOW | RTLD_GLOBAL);
29 printf ("first dlopen failed: %s\n", dlerror ());
33 testdat = dlsym (sohandle, "testdat");
34 testdat->next = (void *) -1;
36 ret = dlclose (sohandle);
39 puts ("first dlclose failed");
43 sohandle = dlopen ("unloadmod.so", RTLD_NOW | RTLD_GLOBAL);
46 printf ("second dlopen failed: %s\n", dlerror ());
50 testdat = dlsym (sohandle, "testdat");
51 if (testdat->next == (void *) -1)
53 puts ("testdat->next == (void *) -1");
57 ret = dlclose (sohandle);
60 puts ("second dlclose failed");