Update.
[platform/upstream/glibc.git] / elf / resolvfail.c
1 #include <dlfcn.h>
2
3 static const char obj[] = "testobj1.so";
4
5 int
6 main (void)
7 {
8   void *d = dlopen (obj, RTLD_LAZY);
9   int n;
10
11   if (d == NULL)
12     {
13       printf ("cannot load %s: %s\n", obj, dlerror ());
14       return 1;
15     }
16
17   for (n = 0; n < 10000; ++n)
18     if (dlsym (d, "does not exist") != NULL)
19       {
20         puts ("dlsym() did not fail");
21         return 1;
22       }
23
24   return 0;
25 }