printf ("Closing neededobj2.so\n"); dlclose (obj2);
printf ("Closing neededobj2.so for the first time\n"); dlclose (obj2[0]);
main (void){  void *obj2;  void *obj3;  const char *loaded[] = { NULL, NULL, NULL, NULL };  int errors = 0;  printf ("\nThis is what is in memory now:\n");  errors += check_loaded_objects (loaded);  printf( "Loading shared object neededobj3.so\n");  obj3 = dlopen( "neededobj3.so", RTLD_LAZY);  if (obj3 == NULL)    {      printf ("%s\n", dlerror ());      exit (1);    }  printf ("And this is what is now in memory\n");  loaded[0] = "neededobj1.so";  loaded[1] = "neededobj2.so";  loaded[2] = "neededobj3.so";  errors += check_loaded_objects (loaded);  printf ("Now loading shared object neededobj2.so\n");  obj2 = dlopen ("neededobj2.so", RTLD_LAZY);  if (obj2 == NULL)    {      printf ("%s\n", dlerror ());      exit (1);    }  printf ("Again, this is what is in memory\n");  errors += check_loaded_objects (loaded);  printf ("Closing neededobj2.so\n");  dlclose (obj2);  errors += check_loaded_objects (loaded);  printf ("Closing neededobj3.so\n");  dlclose (obj3);  loaded[0] = NULL;  errors += check_loaded_objects (loaded);  if (errors != 0)    printf ("%d errors found\n", errors);  return errors;}