From 752a2a50d4574791b2861653d4352c6b6e4b97ff Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 19 Aug 2000 07:17:09 +0000 Subject: Update. 2000-08-19 Ulrich Drepper * elf/Versions [ld] (GLIBC_2.2): Export _dl_check_map_versions. * elf/dl-deps.c (_dl_map_object_deps): If object was dependency of a dynamically loaded object remove old l_initfini list. * elf/dl-libc.c (free_mem): Used as __libc_subfreeres callback to remove some dynamically allocated memory blocks in the dynamic loading data structures. * elf/dl-load.c (add_name_to_object): Initialize dont_free to 0. * elf/dl-open.c (dl_open_workder): Don't call _dl_check_all_versions. Instead call _dl_check_map_versions only for the dependencies. * elf/rtld.c: Avoid unneccessary initializations. Mark l_libname information of initial objects as not free-able. * sysdeps/generic/ldsodefs.h (struct libname_list): Add dont_free element. * elf/filter.c: Call mtrace. * elf/restest1.c: Likewise. Close the objects. * elf/loadtest.c: Call mtrace. Check result of dlclose. Print more debug information. * elf/constload1.c: Add comment explaining not freed memory. --- elf/rtld.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'elf/rtld.c') diff --git a/elf/rtld.c b/elf/rtld.c index 9a444fcfd9..41cf5c36d5 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -590,7 +590,7 @@ of this helper program; chances are you did not intend to run this program.\n\ the shared object is already loaded. */ _dl_rtld_libname.name = ((const char *) _dl_loaded->l_addr + ph->p_vaddr); - _dl_rtld_libname.next = NULL; + /* _dl_rtld_libname.next = NULL; Already zero. */ _dl_rtld_map.l_libname = &_dl_rtld_libname; /* Ordinarilly, we would get additional names for the loader from @@ -604,7 +604,7 @@ of this helper program; chances are you did not intend to run this program.\n\ if (p) { _dl_rtld_libname2.name = p+1; - _dl_rtld_libname2.next = NULL; + /* _dl_rtld_libname2.next = NULL; Already zero. */ _dl_rtld_libname.next = &_dl_rtld_libname2; } } @@ -626,7 +626,7 @@ of this helper program; chances are you did not intend to run this program.\n\ /* We were invoked directly, so the program might not have a PT_INTERP. */ _dl_rtld_libname.name = _dl_rtld_map.l_name; - _dl_rtld_libname.next = NULL; + /* _dl_rtld_libname.next = NULL; Alread zero. */ _dl_rtld_map.l_libname = &_dl_rtld_libname; } else @@ -1059,6 +1059,17 @@ of this helper program; chances are you did not intend to run this program.\n\ HP_TIMING_NOW (start); do { + /* While we are at it, help the memory handling a bit. We have to + mark some data structures as allocated with the fake malloc() + implementation in ld.so. */ + struct libname_list *lnp = l->l_libname->next; + + while (__builtin_expect (lnp != NULL, 0)) + { + lnp->dont_free = 1; + lnp = lnp->next; + } + if (l != &_dl_rtld_map) _dl_relocate_object (l, l->l_scope, _dl_lazy, consider_profiling); -- cgit v1.2.3