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 link_map *)((struct dyn_elf *)h)->dyn)->l_tls_modid;
40 else if (((struct link_map *)((struct dyn_elf *)h)->dyn)->l_tls_modid
43 printf ("round %d: modid now %zu, initially %d\n",
45 ((struct link_map *)((struct dyn_elf *)h)->dyn)->l_tls_modid,
51 modid = ((struct link_map *) h)->l_tls_modid;
52 else if (((struct link_map *) h)->l_tls_modid != (size_t) modid)
54 printf ("round %d: modid now %zu, initially %d\n",
55 i, ((struct link_map *) h)->l_tls_modid, modid);
60 fp = dlsym (h, "in_dso2");
63 printf ("cannot get symbol 'in_dso2': %s\n", dlerror ());
79 #include "../test-skeleton.c"