blob: 7381beea88037344214dba9b2e7a10b5b5c92a3f [file] [log] [blame]
#include <dlfcn.h>
#include <errno.h>
#include <error.h>
#include <mcheck.h>
#include <stdio.h>
#include <stdlib.h>
main (void)
int (*foo) (void);
void *h;
int ret;
mtrace ();
h = dlopen ("", RTLD_LAZY | RTLD_GLOBAL);
if (h == NULL)
error (EXIT_FAILURE, errno, "cannot load module \"\"");
foo = dlsym (h, "foo");
ret = foo ();
/* Note that the following dlclose() call cannot unload the objects.
Due to the introduced relocation dependency depends
on and the dependencies of on
is not visible to since it's done using dlopen(). */
if (dlclose (h) != 0)
puts ("failed to close");
return ret;