6 typedef int (*fn)(void);
19 void *allocs[REPEAT][CHUNKS];
23 /* Open the two objects. */
24 h1 = dlopen ("reldep6mod3.so", RTLD_LAZY);
27 printf ("cannot open reldep6mod3.so: %s\n", dlerror ());
31 foopp = dlsym (h1, "foopp");
34 printf ("cannot get address of \"foopp\": %s\n", dlerror ());
40 printf ("(**foopp)() return %d, not return 20\n", n);
44 h2 = dlopen ("reldep6mod4.so", RTLD_LAZY);
47 printf ("cannot open reldep6mod4.so: %s\n", dlerror ());
51 baz = dlsym (h2, "baz");
54 printf ("cannot get address of \"baz\": %s\n", dlerror ());
59 printf ("baz() did not return 31\n");
63 if (dlclose (h1) != 0)
65 printf ("closing h1 failed: %s\n", dlerror ());
70 for (i = 0; i < REPEAT; ++i)
71 for (j = 0; j < CHUNKS; ++j)
72 allocs[i][j] = calloc (1, j + 1);
74 bar = dlsym (h2, "bar");
77 printf ("cannot get address of \"bar\": %s\n", dlerror ());
82 printf ("bar() did not return 40\n");
86 baz = dlsym (h2, "baz");
89 printf ("cannot get address of \"baz\": %s\n", dlerror ());
94 printf ("baz() did not return 31\n");
98 for (i = 0; i < REPEAT; ++i)
99 for (j = 0; j < CHUNKS; ++j)
102 if (dlclose (h2) != 0)
104 printf ("closing h2 failed: %s\n", dlerror ());