blob: 33f14cc980ae86c79fba086c10cbd5dd000013e2 [file] [log] [blame]
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
extern int bar (void);
extern int foo (void);
foo (void)
void *h;
int res;
/* Load ltglobalmod1 in the global namespace. */
h = dlopen ("", RTLD_GLOBAL | RTLD_LAZY);
if (h == NULL)
printf ("%s: cannot open %s: %s",
__FUNCTION__, "", dlerror ());
/* Call bar. This is undefined in the DSO. */
puts ("about to call `bar'");
fflush (stdout);
res = bar ();
printf ("bar returned %d\n", res);
dlclose (h);
return res != 42;