Blame elf/reldep4.c

Packit 6c4009
#include <dlfcn.h>
Packit 6c4009
#include <mcheck.h>
Packit 6c4009
#include <stdio.h>
Packit 6c4009
#include <stdlib.h>
Packit 6c4009
Packit 6c4009
int
Packit 6c4009
main (void)
Packit 6c4009
{
Packit 6c4009
  int i;
Packit 6c4009
  void *h1, *h2;
Packit 6c4009
Packit 6c4009
  mtrace ();
Packit 6c4009
Packit 6c4009
  for (i = 0; i < 3; i++)
Packit 6c4009
    {
Packit 6c4009
      h1 = dlopen ("reldep4mod1.so", RTLD_NOW | RTLD_GLOBAL);
Packit 6c4009
      if (h1 == NULL)
Packit 6c4009
	{
Packit 6c4009
	  printf ("cannot open reldep4mod1.so: %s\n", dlerror ());
Packit 6c4009
	  exit (1);
Packit 6c4009
	}
Packit 6c4009
      h2 = dlopen ("reldep4mod2.so", RTLD_NOW | RTLD_GLOBAL);
Packit 6c4009
      if (h2 == NULL)
Packit 6c4009
	{
Packit 6c4009
	  printf ("cannot open reldep4mod2.so: %s\n", dlerror ());
Packit 6c4009
	  exit (1);
Packit 6c4009
	}
Packit 6c4009
      if (dlclose (h1) != 0)
Packit 6c4009
	{
Packit 6c4009
	  printf ("closing h1 failed: %s\n", dlerror ());
Packit 6c4009
	  exit (1);
Packit 6c4009
	}
Packit 6c4009
      if (dlclose (h2) != 0)
Packit 6c4009
	{
Packit 6c4009
	  printf ("closing h2 failed: %s\n", dlerror ());
Packit 6c4009
	  exit (1);
Packit 6c4009
	}
Packit 6c4009
    }
Packit 6c4009
  return 0;
Packit 6c4009
}