about summary refs log tree commit diff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-09-23 07:45:38 +0000
committerUlrich Drepper <drepper@redhat.com>2004-09-23 07:45:38 +0000
commit1fc074913b0d1f0d57afb585daa41df47ea1ac31 (patch)
tree9d48f0a3ae6f191dfdf8aee498ace470b5c9a5d7 /elf/dl-load.c
parentbbb5e55c10a1b075089a9e54150010a6f202b567 (diff)
downloadglibc-1fc074913b0d1f0d57afb585daa41df47ea1ac31.tar.gz
glibc-1fc074913b0d1f0d57afb585daa41df47ea1ac31.tar.xz
glibc-1fc074913b0d1f0d57afb585daa41df47ea1ac31.zip
Update.
2004-09-23  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/generic/bits/dlfcn.h: Add RTLD_DEEPBIND.
	* elf/dl-object.c (_dl_new_object): Add new parameter mode.  If mode
	has RTLD_DEEPBIND set add local searchlist before global scope.
	* sysdeps/generic/ldsodefs.h (_dl_new_object): Adjust prototype.
	* elf/rtld.c: Adjust callers of _dl_new_object.
	* elf/dl-load.c: Likewise.
	(_dl_map_object_from_fd): If RTLD_DEEPBIND is used, don't do anything
	for DF_SYMBOLIC.
	* elf/dl-open.c (dl_open_writer): Pass RTLD_DEEPBIND flag on to
	_dl_map_object_deps.
	* elf/tst-deep1.c: New file.
	* elf/tst-deep1mod1.c: New file.
	* elf/tst-deep1mod2.c: New file.
	* elf/tst-deep1mod3.c: New file.
	* elf/Makefile: Add rules to build and run new tests.

	* elf/dl-deps.c: Pretty printing.
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 73112bce23..15fff3c5e1 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -881,7 +881,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
 #endif
 
   /* Enter the new object in the list of loaded objects.  */
-  l = _dl_new_object (realname, name, l_type, loader);
+  l = _dl_new_object (realname, name, l_type, loader, mode);
   if (__builtin_expect (! l, 0))
     {
       errstring = N_("cannot create shared object descriptor");
@@ -1355,15 +1355,12 @@ cannot enable executable stack as shared object requires");
 
   /* If this object has DT_SYMBOLIC set modify now its scope.  We don't
      have to do this for the main map.  */
-  if (__builtin_expect (l->l_info[DT_SYMBOLIC] != NULL, 0)
+  if ((mode & RTLD_DEEPBIND) == 0
+      && __builtin_expect (l->l_info[DT_SYMBOLIC] != NULL, 0)
       && &l->l_searchlist != l->l_scope[0])
     {
       /* Create an appropriate searchlist.  It contains only this map.
-
-	 XXX This is the definition of DT_SYMBOLIC in SysVr4.  The old
-	 GNU ld.so implementation had a different interpretation which
-	 is more reasonable.  We are prepared to add this possibility
-	 back as part of a GNU extension of the ELF format.  */
+	 This is the definition of DT_SYMBOLIC in SysVr4.  */
       l->l_symbolic_searchlist.r_list =
 	(struct link_map **) malloc (sizeof (struct link_map *));
 
@@ -1968,7 +1965,8 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
 
 	  /* Enter the new object in the list of loaded objects.  */
 	  if ((name_copy = local_strdup (name)) == NULL
-	      || (l = _dl_new_object (name_copy, name, type, loader)) == NULL)
+	      || (l = _dl_new_object (name_copy, name, type, loader,
+				      mode)) == NULL)
 	    _dl_signal_error (ENOMEM, name, NULL,
 			      N_("cannot create shared object descriptor"));
 	  /* Signal that this is a faked entry.  */