about summary refs log tree commit diff
path: root/elf/dl-open.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-02-10 22:40:17 +0000
committerUlrich Drepper <drepper@redhat.com>2002-02-10 22:40:17 +0000
commit87837aace92ced7be739fb7f3c764bb405fb5b2e (patch)
treeedba34cb14159fc0660ac020de1a7989bbf0a87d /elf/dl-open.c
parent2cef4257d02ec72a6ca3bef6ce189fe002253bf6 (diff)
downloadglibc-87837aace92ced7be739fb7f3c764bb405fb5b2e.tar.gz
glibc-87837aace92ced7be739fb7f3c764bb405fb5b2e.tar.xz
glibc-87837aace92ced7be739fb7f3c764bb405fb5b2e.zip
Update.
	* elf/dl-deps.c (struct openaux_args): Add open_mode element.
	(openaux): Pass open_mode as new last argument to _dl_map_object.
	(_dl_map_object_deps): Add new argument open_mode.  Initialize
	open_mode element of args variable with it.
	* elf/dl-open.c (dl_open_worker): Pass __RTLD_DLOPEN flag is set to
	_dl_map_object_deps.
	* elf/rtld.c (dl_main): Add zero as last parameter to
	_dl_map_object_deps call.
	* sysdeps/generic/ldsodefs.h: Adjust prototype of _dl_map_object_deps.
	* elf/nodlopen2.c: New file.
	* elf/nodlopenmod2.c: New file.
	* elf/Makefile: Add rules to build and run nodlopen2.

	* elf/tls-macros.hgg: ...here.  New file.
2002-02-08  Richard Henderson  <rth@redhat.com>
Diffstat (limited to 'elf/dl-open.c')
-rw-r--r--elf/dl-open.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 253f7b93dc..8f30bc009d 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -158,7 +158,7 @@ dl_open_worker (void *a)
 
   /* Maybe we have to expand a DST.  */
   dst = strchr (file, '$');
-  if (dst != NULL)
+  if (__builtin_expect (dst != NULL, 0))
     {
       const void *caller = args->caller;
       size_t len = strlen (file);
@@ -208,8 +208,7 @@ dl_open_worker (void *a)
     }
 
   /* Load the named object.  */
-  args->map = new = _dl_map_object (NULL, file, 0, lt_loaded, 0,
-				    mode);
+  args->map = new = _dl_map_object (NULL, file, 0, lt_loaded, 0, mode);
 
   /* If the pointer returned is NULL this means the RTLD_NOLOAD flag is
      set and the object is not already loaded.  */
@@ -243,7 +242,7 @@ dl_open_worker (void *a)
     }
 
   /* Load that object's dependencies.  */
-  _dl_map_object_deps (new, NULL, 0, 0);
+  _dl_map_object_deps (new, NULL, 0, 0, mode & __RTLD_DLOPEN);
 
   /* So far, so good.  Now check the versions.  */
   for (i = 0; i < new->l_searchlist.r_nlist; ++i)
@@ -413,7 +412,7 @@ _dl_open (const char *file, int mode, const void *caller)
   /* Release the lock.  */
   __libc_lock_unlock_recursive (GL(dl_load_lock));
 
-  if (errstring)
+  if (__builtin_expect (errstring != NULL, 0))
     {
       /* Some error occurred during loading.  */
       char *local_errstring;