You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
378 B

#include <dlfcn.h>
#include <stdio.h>
int
main (void)
{
void *h = dlopen ("firstobj.so", RTLD_LAZY);
void *f;
if (! h)
{
printf ("cannot find firstobj.so: %s\n", dlerror ());
return 1;
}
f = dlsym (h, "foo");
if (! f)
{
printf ("cannot find symbol foo: %s\n", dlerror ());
return 2;
}
((void (*) (void)) f) ();
return 0;
}