1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-01-06 11:51:29 +03:00
2000-04-02  Ulrich Drepper  <drepper@redhat.com>

	* elf/dl-fini.c (_dl_fini): Increment j counter after swapping in
	element at this position.

	* elf/Versions [ld.so] (GLIBC_2.2): Export _dl_load_lock.
	* elf/link.h (struct link_map): Add l_reldepsmax, l_reldepsact, and
	l_reldeps elements.
	* elf/dl-lookup.c (add_dependency): New function.
	(_dl_lookup_symbol): Use it whenever symbol was found in a global,
	dynamically loaded object.
	(_dl_lookup_symbol_skip): Likewise.
	(_dl_lookup_versioned_symbol): Likewise.
	(_dl_lookup_versioned_symbol_skip): Likewise.
	* elf/dl-open.c: Don't define _dl_load_lock here...
	* elf/rtld.c: ...but here...
	* elf/dl-support.c: ...and here.
	* elf/dl-close.c (_dl_close): Close also dependent objects introduce
	through relocation.
	* elf/dl-fini.c (_dl_fini): Also take dependencies introduced through
	relocations.
	* dlfcn/Makefile (glrefmain.out): Test is not expected to fail
	anymore.
	* dlfcn/glrefmain.c: Add one more debug message.

	* Makeconfig (preprocess-versions): Don't add $(CPPFLAGS) to compiler
	command line.
	* Makerules (sysd-versions): Use ( ) instead of { }.

	* elf/dl-load.c: Use __builtin_expect to signal that compiler should
	optimize for the non-debugging case.
	* elf/dl-lookup.c: Likewise.
	* sysdeps/generic/libc-start.c: Likewise.
This commit is contained in:
Ulrich Drepper
2000-04-03 03:51:04 +00:00
parent ec79422d9e
commit cf197e41e7
14 changed files with 348 additions and 34 deletions

View File

@@ -43,8 +43,10 @@ internal_function
_dl_close (void *_map)
{
struct link_map **list;
struct link_map **rellist;
struct link_map *map = _map;
unsigned nsearchlist;
unsigned int nsearchlist;
unsigned int nrellist;
unsigned int i;
if (map->l_opencount == 0)
@@ -65,6 +67,9 @@ _dl_close (void *_map)
list = map->l_searchlist.r_list;
nsearchlist = map->l_searchlist.r_nlist;
rellist = map->l_reldeps;
nrellist = map->l_reldepsact;
/* Call all termination functions at once. */
for (i = 0; i < nsearchlist; ++i)
{
@@ -192,6 +197,16 @@ _dl_close (void *_map)
}
}
/* Now we can perhaps also remove the modules for which we had
dependencies because of symbol lookup. */
if (rellist != NULL)
{
while (nrellist-- > 0)
_dl_close (rellist[nrellist]);
free (rellist);
}
free (list);
if (_dl_global_scope_alloc != 0