aboutsummaryrefslogtreecommitdiff
path: root/elf/dynamic-link.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-07-24 19:45:13 +0000
committerUlrich Drepper <drepper@redhat.com>1999-07-24 19:45:13 +0000
commitfcf70d4114db9ff7923f5dfeb3fea6e2d623e5c2 (patch)
tree772e5473a5404c04bf293d2b90db1e83f9075a1a /elf/dynamic-link.h
parent3f3822198993be18d4d9ccb1593eea274dbd2ba0 (diff)
downloadglibc-fcf70d4114db9ff7923f5dfeb3fea6e2d623e5c2.tar
glibc-fcf70d4114db9ff7923f5dfeb3fea6e2d623e5c2.tar.gz
glibc-fcf70d4114db9ff7923f5dfeb3fea6e2d623e5c2.tar.bz2
glibc-fcf70d4114db9ff7923f5dfeb3fea6e2d623e5c2.zip
Update.
1999-07-24 Ulrich Drepper <drepper@cygnus.com> * 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.
Diffstat (limited to 'elf/dynamic-link.h')
-rw-r--r--elf/dynamic-link.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h
index 59a6001069..bdd297e24b 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