From fcf70d4114db9ff7923f5dfeb3fea6e2d623e5c2 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 24 Jul 1999 19:45:13 +0000 Subject: Update. 1999-07-24 Ulrich Drepper * elf/dl-fini.c: Handle DT_FINI_ARRAY. * elf/link.h (struct link_map): Remove l_init_running. Add l_runcount and l_initcount. * elf/dl-init.c: Handle DT_INIT_ARRAY. * elf/dynamic-link.h: Change parameters. Now only get link_map pointer. Calculate l_initcount. * elf/link.h (struct link_map): Add l_runpath_dirs. * elf/dynamic-link.h: If RUNPATH is given, set RPATH to NULL. * elf/dl-load.c: Pretty print. (decompose_rpath): Take new parameter with info from where the path comes. Pass it the fillin_rpath. (_dl_init_paths): Initialize l_runpath_dirs. (_dl_map_object): Don't search using RPATHs if object has RUNPATH. Search using RUNPATH after LD_LIBRARY_PATH. * elf/dl-support.c: Adjust comment. * elf/rtld.c: Adjust help message. --- elf/dynamic-link.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'elf/dynamic-link.h') diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h index 59a6001..bdd297e 100644 --- a/elf/dynamic-link.h +++ b/elf/dynamic-link.h @@ -34,13 +34,18 @@ extern int _dl_verbose __attribute__ ((unused)); /* Read the dynamic section at DYN and fill in INFO with indices DT_*. */ static inline void __attribute__ ((unused)) -elf_get_dynamic_info (ElfW(Dyn) *dyn, ElfW(Addr) l_addr, - ElfW(Dyn) *info[DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM - + DT_EXTRANUM]) +elf_get_dynamic_info (struct link_map *l) { + ElfW(Dyn) *dyn = l->l_ld; + ElfW(Addr) l_addr; + ElfW(Dyn) **info; + if (! dyn) return; + l_addr = l->l_addr; + info = l->l_info; + while (dyn->d_tag != DT_NULL) { if (dyn->d_tag < DT_NUM) @@ -106,6 +111,16 @@ elf_get_dynamic_info (ElfW(Dyn) *dyn, ElfW(Addr) l_addr, if (flags & DF_BIND_NOW) info[DT_BIND_NOW] = info[DT_FLAGS]; } + /* Determine how many constructors there are. */ + if (info[DT_INIT_ARRAY] != NULL) + info[DT_INIT_ARRAY]->d_un.d_ptr += l_addr; + l->l_initcount = 1 + (info[DT_INIT_ARRAY] + ? (info[DT_INIT_ARRAYSZ]->d_un.d_val + / sizeof (ElfW(Addr))) + : 0); + if (info[DT_RUNPATH] != NULL) + /* If both RUNPATH and RPATH are given, the latter is ignored. */ + info[DT_RPATH] = NULL; } #ifdef RESOLVE -- cgit v1.1