4 extern int found_in_mod1 (void);
12 extern int test_in_mod1 (int (*mainp)(int, char **));
14 test_in_mod1 (int (*mainp)(int, char **))
20 /* Find function `main'. */
21 p = dlsym (RTLD_DEFAULT, "main");
24 printf ("%s: main not found\n", __FILE__);
27 else if ((int (*)(int, char **))p != mainp)
29 printf ("%s: wrong address returned for main\n", __FILE__);
33 printf ("%s: main correctly found\n", __FILE__);
35 ifp = dlsym (RTLD_DEFAULT, "found_in_mod1");
36 if ((void *) ifp == NULL)
38 printf ("%s: found_in_mod1 not found\n", __FILE__);
43 printf ("%s: wrong address returned for found_in_mod1\n", __FILE__);
47 printf ("%s: found_in_mod1 correctly found\n", __FILE__);
49 ifp = dlsym (RTLD_DEFAULT, "found_in_mod2");
50 if ((void *) ifp == NULL)
52 printf ("%s: found_in_mod2 not found\n", __FILE__);
57 printf ("%s: wrong address returned for found_in_mod2\n", __FILE__);
61 printf ("%s: found_in_mod2 correctly found\n", __FILE__);