summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-07-23 07:40:56 -0700
committerUlrich Drepper <drepper@redhat.com>2009-07-23 07:40:56 -0700
commitc15b1d20cd31d9c1498a1863a0a65ecfec4f2513 (patch)
tree42e564201a023f8bcf2aa4c4531e3769de5f5ef4
parentfe4d2935e8d984d1d6c314eec557921f2c851224 (diff)
downloadglibc-c15b1d20cd31d9c1498a1863a0a65ecfec4f2513.tar.gz
glibc-c15b1d20cd31d9c1498a1863a0a65ecfec4f2513.tar.xz
glibc-c15b1d20cd31d9c1498a1863a0a65ecfec4f2513.zip
Minor optimization of unloading prevention patch.
References to unique symbols from copy relocations can only come
from executables which cannot be unloaded anyway.  Optimize the
code to set the unload flag a bit.
-rw-r--r--elf/dl-lookup.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 61e8d7f085..18f728812e 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -331,12 +331,12 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
 			  {
 			    table[idx].sym = sym;
 			    table[idx].map = map;
-			  }
 
-			if (table[idx].map->l_type == lt_loaded)
-			  /* Make sure we don't unload this object by
-			     setting the appropriate flag.  */
-			  table[idx].map->l_flags_1 |= DF_1_NODELETE;
+			    if (map->l_type == lt_loaded)
+			      /* Make sure we don't unload this object by
+				 setting the appropriate flag.  */
+			      map->l_flags_1 |= DF_1_NODELETE;
+			  }
 
 			return;
 		      }