mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Update.
* elf/Makefile (tests): Add resolvfail. Add rules to build the program. * elf/resolvfail.c: New file.
This commit is contained in:
25
elf/resolvfail.c
Normal file
25
elf/resolvfail.c
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <dlfcn.h>
|
||||
|
||||
static const char obj[] = "testobj1.so";
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
void *d = dlopen (obj, RTLD_LAZY);
|
||||
int n;
|
||||
|
||||
if (d == NULL)
|
||||
{
|
||||
printf ("cannot load %s: %s\n", obj, dlerror ());
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (n = 0; n < 10000; ++n)
|
||||
if (dlsym (d, "does not exist") != NULL)
|
||||
{
|
||||
puts ("dlsym() did not fail");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user