aboutsummaryrefslogtreecommitdiff
path: root/elf/rtld.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-08-19 07:17:09 +0000
committerUlrich Drepper <drepper@redhat.com>2000-08-19 07:17:09 +0000
commit752a2a50d4574791b2861653d4352c6b6e4b97ff (patch)
tree2cbe7eac254ad4e35b9dec0000d85bb6ea915a7e /elf/rtld.c
parent003715fa0da9048b8e1a30b5284013bcf2990257 (diff)
downloadglibc-752a2a50d4574791b2861653d4352c6b6e4b97ff.tar
glibc-752a2a50d4574791b2861653d4352c6b6e4b97ff.tar.gz
glibc-752a2a50d4574791b2861653d4352c6b6e4b97ff.tar.bz2
glibc-752a2a50d4574791b2861653d4352c6b6e4b97ff.zip
Update.
2000-08-19 Ulrich Drepper <drepper@redhat.com> * 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.
Diffstat (limited to 'elf/rtld.c')
-rw-r--r--elf/rtld.c17
1 files changed, 14 insertions, 3 deletions
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);