6 int main(int argc, const char *argv[])
8 const char *modpath = "public/module.so";
10 const char *(*version2)(void);
11 const char *libversion(void);
12 const char *res1, *res2;
15 printf("Direct: libversion -> %s\n", res1);
17 handle = dlopen(modpath, RTLD_NOW);
19 printf("Failed to open '%s' - %s\n",
24 version2 = dlsym(handle, "libversion");
25 if (version2 == NULL) {
26 printf("Failed to find libversion in %s\n", modpath);
32 printf("Module: libversion -> %s\n", res2);
34 printf("ERROR: pointer mismatch\n");
39 version2 = dlsym(handle, "libversion2");
40 if (version2 == NULL) {
41 printf("Failed to find libversion2 in %s\n", modpath);
47 printf("Module: libversion -> %s\n", res2);
49 printf("ERROR: pointer mismatch\n");