1 1.1 christos #include <dlfcn.h> 2 1.1 christos #include <stdio.h> 3 1.1 christos 4 1.1 christos int main (int argc, char *argv[]) 5 1.1 christos { 6 1.1 christos /* jit_libname is updated by jit-so.exp */ 7 1.1 christos const char *jit_libname = "jit-dlmain-so.so"; 8 1.1 christos void *h; 9 1.1 christos int (*p_main) (int, char **); 10 1.1 christos 11 1.1 christos h = NULL; /* break here before-dlopen */ 12 1.1 christos h = dlopen (jit_libname, RTLD_LAZY); 13 1.1 christos if (h == NULL) return 1; 14 1.1 christos 15 1.1 christos p_main = dlsym (h, "jit_dl_main"); 16 1.1 christos if (p_main == NULL) return 2; 17 1.1 christos 18 1.1 christos h = h; /* break here after-dlopen */ 19 1.1 christos return (*p_main) (argc, argv); 20 1.1 christos } 21