mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
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:
@ -87,18 +87,41 @@ _dl_fini (void)
|
||||
memmove (&maps[j] + 1,
|
||||
&maps[j],
|
||||
(k - j) * sizeof (struct link_map *));
|
||||
maps[j] = here;
|
||||
maps[j++] = here;
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
++runp;
|
||||
}
|
||||
|
||||
if (__builtin_expect (maps[k]->l_reldeps != NULL, 0))
|
||||
{
|
||||
unsigned int m = maps[k]->l_reldepsact;
|
||||
struct link_map **relmaps = maps[k]->l_reldeps;
|
||||
|
||||
while (m-- > 0)
|
||||
{
|
||||
if (relmaps[m] == l)
|
||||
{
|
||||
struct link_map *here = maps[k];
|
||||
|
||||
/* Move it now. */
|
||||
memmove (&maps[j] + 1,
|
||||
&maps[j],
|
||||
(k - j) * sizeof (struct link_map *));
|
||||
maps[j] = here;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* `maps' now contains the objects in the right order. Now call the
|
||||
destructors. We have the process this array from the front. */
|
||||
destructors. We have to process this array from the front. */
|
||||
for (i = 0; i < nloaded; ++i)
|
||||
{
|
||||
l = maps[i];
|
||||
|
Reference in New Issue
Block a user