* elf/dl-lookup.c (add_dependency): Fix test to check whether
	dependency already exists.
	* elf/Makefile: Add testobj1 and testobj2 as dependencies of testobj6.
	* elf/loadtest.c (main): Add test at the end that everything is
	unloaded.

	* elf/dl-open.c (dl_open_worker): Fix typo in comment.
This commit is contained in:
Ulrich Drepper 2000-10-25 04:00:08 +00:00
parent 7d1231f116
commit e30f2b9828
5 changed files with 34 additions and 15 deletions

View File

@ -1,5 +1,13 @@
2000-10-24 Ulrich Drepper <drepper@redhat.com>
* elf/dl-lookup.c (add_dependency): Fix test to check whether
dependency already exists.
* elf/Makefile: Add testobj1 and testobj2 as dependencies of testobj6.
* elf/loadtest.c (main): Add test at the end that everything is
unloaded.
* elf/dl-open.c (dl_open_worker): Fix typo in comment.
* elf/elf.h: Add even more IA-64 relocations.
2000-10-24 Geoffrey Keating <geoffk@cygnus.com>

View File

@ -246,7 +246,7 @@ $(objpfx)testobj2.so: $(objpfx)testobj1.so $(libdl)
$(objpfx)testobj3.so: $(libdl)
$(objpfx)testobj4.so: $(libdl)
$(objpfx)testobj5.so: $(libdl)
$(objpfx)testobj6.so: $(libdl)
$(objpfx)testobj6.so: $(objpfx)testobj1.so $(objpfx)testobj2.so $(libdl)
$(objpfx)failobj.so: $(objpfx)testobj6.so
$(objpfx)dep1.so: $(objpfx)dep2.so $(objpfx)dep4.so
$(objpfx)dep2.so: $(objpfx)dep3.so $(objpfx)dep4.so

View File

@ -97,14 +97,13 @@ add_dependency (struct link_map *undef_map, struct link_map *map)
/* Determine whether UNDEF_MAP already has a reference to MAP. First
look in the normal dependencies. */
list = undef_map->l_searchlist.r_list;
act = undef_map->l_searchlist.r_nlist;
list = undef_map->l_initfini;
for (i = 0; i < act; ++i)
for (i = 0; list[i] != NULL; ++i)
if (list[i] == map)
break;
if (__builtin_expect (i == act, 1))
if (__builtin_expect (list[i] == NULL, 1))
{
/* No normal dependency. See whether we already had to add it
to the special list of dynamic dependencies. */

View File

@ -255,7 +255,7 @@ dl_open_worker (void *a)
"\n\n", NULL);
}
/* If the user requested the object t be in the global namespace
/* If the user requested the object to be in the global namespace
but it is not so far, add it now. */
if ((mode & RTLD_GLOBAL) && new->l_global == 0)
(void) add_to_global (new);

View File

@ -148,15 +148,27 @@ main (int argc, char *argv[])
/* Unload all loaded modules. */
for (count = 0; count < NOBJS; ++count)
if (testobjs[count].handle != NULL)
{ printf ("\nclose: %s: l_initfini = %p, l_versions = %p\n",
testobjs[count].name,
((struct link_map*)testobjs[count].handle)->l_initfini,
((struct link_map*)testobjs[count].handle)->l_versions);
if (dlclose (testobjs[count].handle) != 0)
{
printf ("failed to close %s\n", testobjs[count].name);
result = 1;
} }
{
printf ("\nclose: %s: l_initfini = %p, l_versions = %p\n",
testobjs[count].name,
((struct link_map*)testobjs[count].handle)->l_initfini,
((struct link_map*)testobjs[count].handle)->l_versions);
if (dlclose (testobjs[count].handle) != 0)
{
printf ("failed to close %s\n", testobjs[count].name);
result = 1;
}
}
/* Check whether all files are unloaded. */
for (map = _r_debug.r_map; map != NULL; map = map->l_next)
if (map->l_type == lt_loaded)
{
printf ("name = \"%s\", opencount = %d\n",
map->l_name, (int) map->l_opencount);
result = 1;
}
return result;
}