aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-deps.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-24 19:18:25 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-24 19:18:25 +0000
commit2e93b4a4cd190fc8d21682f69a5455dc6dcd04dd (patch)
tree827aaf2c600f898f308661d5bbbcd66cc7f7cb63 /elf/dl-deps.c
parent8edd9172533488545e7e088e0c3bc02f9ef36bee (diff)
downloadglibc-2e93b4a4cd190fc8d21682f69a5455dc6dcd04dd.zip
glibc-2e93b4a4cd190fc8d21682f69a5455dc6dcd04dd.tar.gz
glibc-2e93b4a4cd190fc8d21682f69a5455dc6dcd04dd.tar.bz2
Update.
* elf/dl-deps.c (_dl_map_object_deps): Put l_initfini array before r_list array in allocated memory. * elf/dl-close.c (_dl_close): Optimize access to l_initfini list and remove use of r_list.
Diffstat (limited to 'elf/dl-deps.c')
-rw-r--r--elf/dl-deps.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index c3feb98..c999731 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -468,12 +468,16 @@ _dl_map_object_deps (struct link_map *map,
/* Store the search list we built in the object. It will be used for
searches in the scope of this object. */
- map->l_searchlist.r_list = malloc ((2 * nlist + 1
- + (nlist == nduplist ? 0 : nduplist))
- * sizeof (struct link_map *));
- if (map->l_searchlist.r_list == NULL)
+ map->l_initfini =
+ (struct link_map **) malloc ((2 * nlist + 1
+ + (nlist == nduplist ? 0 : nduplist))
+ * sizeof (struct link_map *));
+ if (map->l_initfini == NULL)
_dl_signal_error (ENOMEM, map->l_name,
N_("cannot allocate symbol search list"));
+
+
+ map->l_searchlist.r_list = &map->l_initfini[nlist + 1];
map->l_searchlist.r_nlist = nlist;
for (nlist = 0, runp = known; runp; runp = runp->unique)
@@ -507,10 +511,8 @@ _dl_map_object_deps (struct link_map *map,
}
/* Now determine the order in which the initialization has to happen. */
- map->l_initfini =
- (struct link_map **) memcpy (map->l_searchlist.r_duplist + nduplist,
- map->l_searchlist.r_list,
- nlist * sizeof (struct link_map *));
+ memcpy (map->l_initfini, map->l_searchlist.r_list,
+ nlist * sizeof (struct link_map *));
/* We can skip looking for the binary itself which is at the front
of the search list. Look through the list backward so that circular
dependencies are not changing the order. */