1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00
2001-09-08  Ulrich Drepper  <drepper@redhat.com>

	* elf/dl-close.c (_dl_close): If object has no r_list (i.e., wasn't
	loaded directly) determine length if l_initfini list by iterating
	over its elements.  Minor optimizations.
	* elf/dl-deps.c (_dl_map_object_deps): Always add own map to l_initfini
	for dependency objects.
	If object was already loaded check whether any of the dependencies
	is already on the relocation dependency list.  If yes, remove the
	latter.  Minor optimizations.
	* elf/dl-lookup.c (add_dependency): Add check for self reference of
	maps here.  Search l_initfini list only if the object was loaded
	directly and not only as a dependency.
	(_dl_lookup_symbol): Add relocation dependency also if object
	is not in global scope.  Remove test for self-reference here.
	(_dl_lookup_versioned_symbol): Likewise.
	* elf/dl-object (_dl_new_object): Cleanup.  Initialize dont_free
	element of first name record.
	* elf/loadtest.c: Add some more test to recognize early if an object
	wasn't unloaded.
	* elf/Makefile: Add rules to build and run reldep5.
	* elf/reldep5.c: New file.
	* elf/reldepmod5.c: New file.
	* elf/reldepmod6.c: New file.

	* elf/reldep2.c: Fix typo.

	* elf/dl-object.c (_dl_new_object): Initialize l_scope and l_scope_max.
This commit is contained in:
Ulrich Drepper
2001-09-08 16:27:08 +00:00
parent 5a21d307c5
commit c4bb124a75
10 changed files with 264 additions and 100 deletions

View File

@ -5,6 +5,7 @@
#include <mcheck.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* How many load/unload operations do we do. */
@ -139,6 +140,23 @@ main (int argc, char *argv[])
testobjs[index].name, testobjs[index].handle);
testobjs[index].handle = NULL;
if (testobjs[0].handle == NULL
&& testobjs[1].handle == NULL
&& testobjs[5].handle == NULL)
{
/* In this case none of the objects above should be
present. */
for (map = _r_debug.r_map; map != NULL; map = map->l_next)
if (map->l_type == lt_loaded
&& (strstr (map->l_name, testobjs[0].name) != NULL
|| strstr (map->l_name, testobjs[1].name) != NULL
|| strstr (map->l_name, testobjs[5].name) != NULL))
{
printf ("`%s' is still loaded\n", map->l_name);
result = 1;
}
}
}
if (debug)
@ -151,8 +169,8 @@ main (int argc, char *argv[])
{
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);
((struct link_map *) testobjs[count].handle)->l_initfini,
((struct link_map *) testobjs[count].handle)->l_versions);
if (dlclose (testobjs[count].handle) != 0)
{