3 #include <gnu/lib-names.h>
5 #define TEST_SO "$ORIGIN/tst-dlmopen1mod.so"
10 void *h
= dlopen (LIBC_SO
, RTLD_LAZY
|RTLD_NOLOAD
);
13 printf ("cannot get handle for %s: %s\n", LIBC_SO
, dlerror ());
18 if (dlinfo (h
, RTLD_DI_LMID
, &ns
) != 0)
20 printf ("dlinfo for %s in %s failed: %s\n",
21 LIBC_SO
, __func__
, dlerror ());
27 printf ("namespace for %s not LM_ID_BASE\n", LIBC_SO
);
33 printf ("dlclose for %s in %s failed: %s\n",
34 LIBC_SO
, __func__
, dlerror ());
38 h
= dlmopen (LM_ID_NEWLM
, TEST_SO
, RTLD_LAZY
);
41 printf ("cannot get handle for %s: %s\n",
42 "tst-dlmopen1mod.so", dlerror ());
47 if (dlinfo (h
, RTLD_DI_LMID
, &ns
) != 0)
49 printf ("dlinfo for %s in %s failed: %s\n",
50 "tst-dlmopen1mod.so", __func__
, dlerror ());
56 printf ("namespace for %s is LM_ID_BASE\n", TEST_SO
);
60 int (*fct
) (Lmid_t
) = dlsym (h
, "foo");
63 printf ("could not find %s: %s\n", "foo", dlerror ());
72 printf ("dlclose for %s in %s failed: %s\n",
73 TEST_SO
, __func__
, dlerror ());
80 #include <support/test-driver.c>