about summary refs log tree commit diff
path: root/elf/dl-deps.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-06-16 02:18:58 +0000
committerRoland McGrath <roland@gnu.org>1996-06-16 02:18:58 +0000
commitf9496a7b54c27580d4b30cc2b2b40e86738b2b81 (patch)
tree67da370e3ecc6c9280f20cac507b5fc75700fc3a /elf/dl-deps.c
parenta23db8e4af794430fe69c17bd884f03669d307d7 (diff)
downloadglibc-f9496a7b54c27580d4b30cc2b2b40e86738b2b81.tar.gz
glibc-f9496a7b54c27580d4b30cc2b2b40e86738b2b81.tar.xz
glibc-f9496a7b54c27580d4b30cc2b2b40e86738b2b81.zip
* 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!
Diffstat (limited to 'elf/dl-deps.c')
-rw-r--r--elf/dl-deps.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index 3e49fcfe01..9fe974d982 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;
 		  }
 	      }
 	}