3 #include <gnu/lib-names.h>
9 void *h = dlopen (LIBC_SO, RTLD_LAZY|RTLD_NOLOAD);
12 printf ("cannot get handle for %s: %s\n", LIBC_SO, dlerror ());
17 if (dlinfo (h, RTLD_DI_LMID, &ns) != 0)
19 printf ("dlinfo for %s in %s failed: %s\n",
20 LIBC_SO, __func__, dlerror ());
26 printf ("namespace for %s not LM_ID_BASE\n", LIBC_SO);
32 printf ("dlclose for %s in %s failed: %s\n",
33 LIBC_SO, __func__, dlerror ());
37 h = dlmopen (LM_ID_NEWLM, "$ORIGIN/tst-dlmopen1mod.so", RTLD_LAZY);
40 printf ("cannot get handle for %s: %s\n",
41 "tst-dlmopen1mod.so", dlerror ());
46 if (dlinfo (h, RTLD_DI_LMID, &ns) != 0)
48 printf ("dlinfo for %s in %s failed: %s\n",
49 "tst-dlmopen1mod.so", __func__, dlerror ());
55 printf ("namespace for %s is LM_ID_BASE\n", LIBC_SO);
59 int (*fct) (Lmid_t) = dlsym (h, "foo");
62 printf ("could not find %s: %s\n", "foo", dlerror ());
71 printf ("dlclose for %s in %s failed: %s\n",
72 LIBC_SO, __func__, dlerror ());
79 #define TEST_FUNCTION do_test ()
80 #include "../test-skeleton.c"