4 extern int found_in_mod1 (void);
11 extern int found_in_mod2 (void);
19 extern int test_in_mod2 (int (*mainp
)(int, char **));
21 test_in_mod2 (int (*mainp
)(int, char **))
27 /* Find function `main'. */
28 p
= dlsym (RTLD_DEFAULT
, "main");
31 printf ("%s: main not found\n", __FILE__
);
34 else if ((int (*)(int, char **))p
!= mainp
)
36 printf ("%s: wrong address returned for main\n", __FILE__
);
40 printf ("%s: main correctly found\n", __FILE__
);
42 ifp
= dlsym (RTLD_DEFAULT
, "found_in_mod1");
43 if ((void *) ifp
== NULL
)
45 printf ("%s: found_in_mod1 not found\n", __FILE__
);
50 printf ("%s: wrong address returned for found_in_mod1\n", __FILE__
);
54 printf ("%s: found_in_mod1 correctly found\n", __FILE__
);
56 ifp
= dlsym (RTLD_DEFAULT
, "found_in_mod2");
57 if ((void *) ifp
== NULL
)
59 printf ("%s: found_in_mod2 not found\n", __FILE__
);
64 printf ("%s: wrong address returned for found_in_mod2\n", __FILE__
);
68 printf ("%s: found_in_mod2 correctly found\n", __FILE__
);