From 6075607b9abba5ae10b87a9913f2a26548021272 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 26 Aug 1998 18:03:49 +0000 Subject: Update. 1998-08-26 17:48 Ulrich Drepper * elf/dl-close.c (_dl_close): Move map->l_nsearchlist value into local variable so that map can be freed. Reported by Philippe Troin . * elf/dl-open.c (dl_open_worker): Correct test for extending global scope array. Patch by Philippe Troin . 1998-08-26 Geoff Keating * sysdeps/powerpc/register-dump.h: Rewrite. Much nicer this way. Don't call writev() with a 100-element vector. * sysdeps/generic/segfault.c (catch_segfault): Skip top-level NULL return address. * sysdeps/powerpc/elf/libc-start.c: Sync up with generic version. In particular, set __libc_stack_end. * sysdeps/powerpc/elf/start.S: Allow _init and _fini to be undefined. Fix copyright notice. 1998-08-25 Andreas Schwab * math/Makefile (gmp-objs): New variable. ($(objpfx)atest-exp, $(objpfx)atest-sincos, $(objpfx)atest-exp2): Depend on it. (tests): Add atest-exp atest-sincos atest-exp2. (tests-static): Remove atest-exp atest-sincos atest-exp2. * elf/rtld.c (dl_main): Unload map file before jumping to user code. --- elf/dl-close.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'elf/dl-close.c') diff --git a/elf/dl-close.c b/elf/dl-close.c index e1ca142..8e613eb 100644 --- a/elf/dl-close.c +++ b/elf/dl-close.c @@ -38,6 +38,7 @@ internal_function _dl_close (struct link_map *map) { struct link_map **list; + unsigned nsearchlist; unsigned int i; if (map->l_opencount == 0) @@ -56,9 +57,10 @@ _dl_close (struct link_map *map) } list = map->l_searchlist; + nsearchlist = map->l_nsearchlist; /* Call all termination functions at once. */ - for (i = 0; i < map->l_nsearchlist; ++i) + for (i = 0; i < nsearchlist; ++i) { struct link_map *imap = list[i]; if (imap->l_opencount == 1 && imap->l_type == lt_loaded @@ -83,12 +85,12 @@ _dl_close (struct link_map *map) /* The search list contains a counted reference to each object it points to, the 0th elt being MAP itself. Decrement the reference counts on all the objects MAP depends on. */ - for (i = 0; i < map->l_nsearchlist; ++i) + for (i = 0; i < nsearchlist; ++i) --list[i]->l_opencount; /* Check each element of the search list to see if all references to it are gone. */ - for (i = 0; i < map->l_nsearchlist; ++i) + for (i = 0; i < nsearchlist; ++i) { struct link_map *imap = list[i]; if (imap->l_opencount == 0 && imap->l_type == lt_loaded) -- cgit v1.1