about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-error.c8
-rw-r--r--elf/dl-load.c36
-rw-r--r--elf/dl-open.c6
3 files changed, 25 insertions, 25 deletions
diff --git a/elf/dl-error.c b/elf/dl-error.c
index cfb6b9ead5..228c1a80a1 100644
--- a/elf/dl-error.c
+++ b/elf/dl-error.c
@@ -33,15 +33,15 @@ struct catch
   };
 
 /* Multiple threads at once can use the `_dl_catch_error' function.  The
-   calls can come from the `_dl_map_object_deps', `_dlerror_run', or from
+   calls can come from `_dl_map_object_deps', `_dlerror_run', or from
    any of the libc functionality which loads dynamic objects (NSS, iconv).
-   Therefore we have to be prepared to safe the state in thread-local
+   Therefore we have to be prepared to save the state in thread-local
    memory.  `catch' will only be used for the non-threaded case.
 
    Please note the horrible kludge we have to use to check for the
    thread functions to be defined.  The problem is that while running
-   ld.so standalone (i.e., before the relocation with the libc symbols
-   available) we do not have a real handling of undefined weak symbols.
+   ld.so standalone (i.e., before the relocation with the available
+   libc symbols) we do not have a real handling of undefined weak symbols.
    All symbols are relocated, regardless of the availability.  They are
    relocated relative to the load address of the dynamic linker.  Adding
    this start address to zero (the value in the GOT for undefined symbols)
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 35c34e0305..1082205a23 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1100,23 +1100,25 @@ open_path (const char *name, size_t namelen, int preloaded,
 
 	  fd = __open (buf, O_RDONLY);
 	  if (this_dir->status[cnt] == unknown)
-	    if (fd != -1)
-	      this_dir->status[cnt] = existing;
-	    else
-	      {
-		/* We failed to open machine dependent library.  Let's
-		   test whether there is any directory at all.  */
-		struct stat st;
-
-		buf[buflen - namelen - 1] = '\0';
-
-		if (__xstat (_STAT_VER, buf, &st) != 0
-		    || ! S_ISDIR (st.st_mode))
-		  /* The directory does not exist or it is no directory.  */
-		  this_dir->status[cnt] = nonexisting;
-		else
-		  this_dir->status[cnt] = existing;
-	      }
+	    {
+	      if (fd != -1)
+		this_dir->status[cnt] = existing;
+	      else
+		{
+		  /* We failed to open machine dependent library.  Let's
+		     test whether there is any directory at all.  */
+		  struct stat st;
+
+		  buf[buflen - namelen - 1] = '\0';
+
+		  if (__xstat (_STAT_VER, buf, &st) != 0
+		      || ! S_ISDIR (st.st_mode))
+		    /* The directory does not exist or it is no directory.  */
+		    this_dir->status[cnt] = nonexisting;
+		  else
+		    this_dir->status[cnt] = existing;
+		}
+	    }
 
 	  if (fd != -1 && preloaded && __libc_enable_secure)
 	    {
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 694b0ebfaa..e5509dffd4 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -127,6 +127,8 @@ dl_open_worker (void *a)
   new->l_global = (mode & RTLD_GLOBAL) ? 1 : 0;
   if (new->l_global)
     {
+      struct link_map **new_global;
+
       /* The symbols of the new object and its dependencies are to be
 	 introduced into the global scope that will be used to resolve
 	 references from other dynamically-loaded objects.
@@ -143,8 +145,6 @@ dl_open_worker (void *a)
       if (_dl_global_scope_alloc == 0)
 	{
 	  /* This is the first dynamic object given global scope.  */
-	  struct link_map **new_global;
-
 	  _dl_global_scope_alloc = _dl_main_searchlist->r_nlist + 8;
 	  new_global = (struct link_map **)
 	    malloc (_dl_global_scope_alloc * sizeof (struct link_map *));
@@ -166,8 +166,6 @@ dl_open_worker (void *a)
 	{
 	  /* We have to extend the existing array of link maps in the
 	     main map.  */
-	  struct link_map **new_global;
-
 	  new_global = (struct link_map **)
 	    malloc ((_dl_global_scope_alloc + 8) * sizeof (struct link_map *));
 	  if (new_global == NULL)