19 h1
= dlopen ("testobj1.so", RTLD_LAZY
);
21 error (EXIT_FAILURE
, 0, "while loading `%s': %s", "testobj1.so",
24 h2
= dlopen ("testobj1_1.so", RTLD_LAZY
);
26 error (EXIT_FAILURE
, 0, "while loading `%s': %s", "testobj1_1.so",
29 fp1
= dlsym (h1
, "obj1func1");
31 error (EXIT_FAILURE
, 0, "getting `obj1func1' in `%s': %s",
32 "testobj1.so", dlerror ());
34 fp2
= dlsym (h2
, "obj1func1");
36 error (EXIT_FAILURE
, 0, "getting `obj1func1' in `%s': %s",
37 "testobj1_1.so", dlerror ());
41 printf ("fp1(10) = %d\nfp2(10) = %d\n", res1
, res2
);
43 if (dlclose (h1
) != 0)
44 error (EXIT_FAILURE
, 0, "cannot close testobj1.so: %s\n", dlerror ());
45 if (dlclose (h2
) != 0)
46 error (EXIT_FAILURE
, 0, "cannot close testobj1_1.so: %s\n", dlerror ());
48 return res1
!= 42 || res2
!= 72;
52 extern int foo (int a
);