13 #define TEST_FUNCTION do_test ()
18 static const char modname[] = "tst-tlsmod3.so";
25 for (i = 0; i < 10; ++i)
27 h = dlopen (modname, RTLD_LAZY);
30 printf ("cannot open '%s': %s\n", modname, dlerror ());
34 /* Dirty test code here: we peek into a private data structure.
35 We make sure that the module gets assigned the same ID every
36 time. The value of the first round is used. */
39 modid = ((struct dyn_elf *) h)->dyn->l_tls_modid;
40 else if (((struct dyn_elf *)h)->dyn->l_tls_modid != (size_t) modid)
42 printf ("round %d: modid now %zu, initially %d\n",
44 ((struct dyn_elf *)h)->dyn->l_tls_modid,
50 modid = ((struct link_map *) h)->l_tls_modid;
51 else if (((struct link_map *) h)->l_tls_modid != (size_t) modid)
53 printf ("round %d: modid now %zu, initially %d\n",
54 i, ((struct link_map *) h)->l_tls_modid, modid);
59 fp = dlsym (h, "in_dso2");
62 printf ("cannot get symbol 'in_dso2': %s\n", dlerror ());
78 #include "../test-skeleton.c"