From f9496a7b54c27580d4b30cc2b2b40e86738b2b81 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 16 Jun 1996 02:18:58 +0000 Subject: * elf/dl-deps.c (_dl_map_object_deps): Set MAP's mark bit before loop. Set mark bits of deps as opened, instead of as scanned. * elf/rtld.c (dl_main): Remove _dl_rtld_map from chain unconditionally. Then if it has a nonzero l_opencount, add it back in search order. * elf/dl-load.c (_dl_map_object): Don't use _dl_loaded's DT_RPATH if it ain't got one! --- elf/dl-deps.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'elf/dl-deps.c') diff --git a/elf/dl-deps.c b/elf/dl-deps.c index 3e49fcf..9fe974d 100644 --- a/elf/dl-deps.c +++ b/elf/dl-deps.c @@ -38,6 +38,10 @@ _dl_map_object_deps (struct link_map *map) head.next = NULL; nlist = 1; + /* We use `l_reserved' as a mark bit to detect objects we have already + put in the search list and avoid adding duplicate elements later in + the list. */ + map->l_reserved = 1; /* Process each element of the search list, loading each of its immediate dependencies and appending them to the list as we step through it. @@ -47,11 +51,6 @@ _dl_map_object_deps (struct link_map *map) { struct link_map *l = scanp->map; - /* We use `l_reserved' as a mark bit to detect objects we have - already put in the search list and avoid adding duplicate elements - later in the list. */ - l->l_reserved = 1; - if (l->l_info[DT_NEEDED]) { const char *strtab @@ -79,6 +78,8 @@ _dl_map_object_deps (struct link_map *map) tailp->map = dep; tailp->next = NULL; ++nlist; + /* Set the mark bit that says it's already in the list. */ + dep->l_reserved = 1; } } } -- cgit v1.1