about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-03-10 12:20:58 +0000
committerUlrich Drepper <drepper@redhat.com>1998-03-10 12:20:58 +0000
commit77aba05b030c9a9e8b8bccf4bdc400569f7da818 (patch)
tree3ed6ea1d2188d386b3e0c30784c2f56384984277
parentdb0b91a9060ff7a2b00c42fafbd00ca3c50360a6 (diff)
downloadglibc-77aba05b030c9a9e8b8bccf4bdc400569f7da818.tar.gz
glibc-77aba05b030c9a9e8b8bccf4bdc400569f7da818.tar.xz
glibc-77aba05b030c9a9e8b8bccf4bdc400569f7da818.zip
Update.
1998-03-10 07:54  H.J. Lu  <hjl@gnu.org>

	* elf/rtld.c (dl_main): Load the preloaded objects dependencies.

	* sysdeps/posix/mkstemp.c (mkstemp): Open temporary file mode 0600.
	Reported by Greg Alexander <galexand@sietch.bloomington.in.us>.
-rw-r--r--ChangeLog8
-rw-r--r--elf/rtld.c30
2 files changed, 27 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 24fa1cffad..ee5cb2f7d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+1998-03-10 07:54  H.J. Lu  <hjl@gnu.org>
+
+	* elf/rtld.c (dl_main): Load the preloaded objects dependencies.
+
 1998-03-10  Ulrich Drepper  <drepper@cygnus.com>
 
 	* elf/dl-lookup.c (_dl_lookup_versioned_symbol): Print version
@@ -16,8 +20,8 @@
 
 1998-03-10  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
 
-	* sysdeps/posix/mkstemp.c (mkstemp): Open temporary file mode
-	0600.  Reported by Greg Alexander <galexand@sietch.bloomington.in.us>.
+	* sysdeps/posix/mkstemp.c (mkstemp): Open temporary file mode 0600.
+	Reported by Greg Alexander <galexand@sietch.bloomington.in.us>.
 
 1998-03-10 00:10  Ulrich Drepper  <drepper@cygnus.com>
 
diff --git a/elf/rtld.c b/elf/rtld.c
index 565f9caaaa..c6a45fe2d4 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -283,6 +283,7 @@ dl_main (const ElfW(Phdr) *phdr,
   size_t file_size;
   char *file;
   int has_interp = 0;
+  unsigned int i;
 
   /* Process the environment variable which control the behaviour.  */
   process_envvars (&mode, &lazy);
@@ -595,7 +596,6 @@ of this helper program; chances are you did not intend to run this program.\n",
     {
       /* Set up PRELOADS with a vector of the preloaded libraries.  */
       struct link_map *l;
-      unsigned int i;
       preloads = __alloca (npreloads * sizeof preloads[0]);
       l = _dl_rtld_map.l_next; /* End of the chain before preloads.  */
       i = 0;
@@ -612,6 +612,11 @@ of this helper program; chances are you did not intend to run this program.\n",
      dependencies in the executable's searchlist for symbol resolution.  */
   _dl_map_object_deps (main_map, preloads, npreloads, mode == trace);
 
+  /* We should also load the preloaded objects dependencies. They
+     may call dlsym (RTLD_NEXT, ...).  */
+  for (i = 0; i < npreloads; i++)
+    _dl_map_object_deps (preloads[i], NULL, 0, 0);
+
 #ifndef MAP_ANON
   /* We are done mapping things, so close the zero-fill descriptor.  */
   __close (_dl_zerofd);
@@ -629,7 +634,7 @@ of this helper program; chances are you did not intend to run this program.\n",
 	 put it back in the list of visible objects.  We insert it into the
 	 chain in symbol search order because gdb uses the chain's order as
 	 its symbol search order.  */
-      unsigned int i = 1;
+      i = 1;
       while (main_map->l_searchlist[i] != &_dl_rtld_map)
 	++i;
       _dl_rtld_map.l_prev = main_map->l_searchlist[i - 1];
@@ -659,9 +664,6 @@ of this helper program; chances are you did not intend to run this program.\n",
 	 important that we do this before real relocation, because the
 	 functions we call below for output may no longer work properly
 	 after relocation.  */
-
-      int i;
-
       if (! _dl_loaded->l_info[DT_NEEDED])
 	_dl_sysdep_message ("\t", "statically linked\n", NULL);
       else
@@ -971,10 +973,20 @@ a filename can be specified using the LD_DEBUG_OUTPUT environment variable.\n",
 	      dl_debug += 7;
 	    }
 	  else
-	    /* Skip everything until next separator.  */
-	    do
-	      ++dl_debug;
-	    while (*dl_debug != '\0' && !issep (*dl_debug));
+	    {
+	      /* Display a warning and skip everything until next
+                 separator.  */
+	      char *startp = dl_debug;
+
+	      do
+		++dl_debug;
+	      while (*dl_debug != '\0' && !issep (*dl_debug));
+
+	      startp = strndupa (startp, dl_debug - startp);
+	      _dl_sysdep_error ("warning: debug option `", startp,
+				"' unknown; try LD_DEBUG=help\n", NULL);
+
+	    }
 	}
     }
   while (*dl_debug != '\0');