1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
* elf/Makefile: Add no modules for nodelete test.
	* elf/nodelmod3.c: New file.
	* elf/nodelmod4.c: New file.
	* elf/nodelete.c: Also test case where dependency of dlopen() object
	is marked nodelete.

	* elf/nodlopen.c: New file.
	* elf/nodlopenmod.c: New file.
This commit is contained in:
Ulrich Drepper
2000-07-21 04:42:21 +00:00
parent 2f54c82dac
commit 2cb8cefbd4
7 changed files with 89 additions and 4 deletions

View File

@ -41,7 +41,7 @@ do_test (void)
p = dlopen ("nodelmod1.so", RTLD_LAZY);
if (p == NULL)
{
puts ("failed to load \"nodelmod1.so\"");
printf ("failed to load \"nodelmod1.so\": %s\n", dlerror ());
result = 1;
}
else
@ -89,7 +89,7 @@ do_test (void)
p = dlopen ("nodelmod2.so", RTLD_LAZY | RTLD_NODELETE);
if (p == NULL)
{
puts ("failed to load \"nodelmod2.so\"");
printf ("failed to load \"nodelmod2.so\": %s\n", dlerror ());
result = 1;
}
else
@ -134,6 +134,56 @@ do_test (void)
}
}
p = dlopen ("nodelmod3.so", RTLD_LAZY);
if (p == NULL)
{
printf ("failed to load \"nodelmod3.so\": %s\n", dlerror ());
result = 1;
}
else
{
int *(*fctp) (void);
puts ("succeeded loading \"nodelmod3.so\"");
fctp = dlsym (p, "addr");
if (fctp == NULL)
{
puts ("failed to get address of \"addr\" in \"nodelmod3.so\"");
result = 1;
}
else
{
int *varp = fctp ();
*varp = -1;
/* Now close the object. */
if (dlclose (p) != 0)
{
puts ("failed to close \"nodelmod3.so\"");
result = 1;
}
else if (! sigsetjmp (jmpbuf, 1))
{
/* Access the variable again. */
if (*varp != -1)
{
puts ("\"var_in_mod4\" value not correct");
result = 1;
}
else
puts ("-z nodelete in dependency succeeded");
}
else
{
/* We caught an segmentation fault. */
puts ("\"nodelmod4.so\" got deleted");
result = 1;
}
}
}
return result;
}