[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r13792 - in /fsf/trunk/ports: ChangeLog.mips sysdeps/mips/dl-lookup.c



Author: eglibc
Date: Fri May 13 03:16:17 2011
New Revision: 13792

Log:
Import glibc-ports-mainline for 2011-05-13

Modified:
    fsf/trunk/ports/ChangeLog.mips
    fsf/trunk/ports/sysdeps/mips/dl-lookup.c

Modified: fsf/trunk/ports/ChangeLog.mips
==============================================================================
--- fsf/trunk/ports/ChangeLog.mips (original)
+++ fsf/trunk/ports/ChangeLog.mips Fri May 13 03:16:17 2011
@@ -1,3 +1,7 @@
+2011-05-13  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/mips/dl-lookup.c: Update from generic version.
+
 2011-05-10  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/mips/dl-lookup.c: Update from generic version.

Modified: fsf/trunk/ports/sysdeps/mips/dl-lookup.c
==============================================================================
--- fsf/trunk/ports/sysdeps/mips/dl-lookup.c (original)
+++ fsf/trunk/ports/sysdeps/mips/dl-lookup.c Fri May 13 03:16:17 2011
@@ -329,39 +329,21 @@
 		 definition we have to use it.  */
 	      void enter (struct unique_sym *table, size_t size,
 			  unsigned int hash, const char *name,
-			  const ElfW(Sym) *sym, struct link_map *map)
+			  const ElfW(Sym) *sym, const struct link_map *map)
 	      {
 		size_t idx = hash % size;
 		size_t hash2 = 1 + hash % (size - 2);
-		while (1)
+		while (table[idx].name != NULL)
 		  {
-		    if (table[idx].name == NULL)
-		      {
-			table[idx].hashval = hash;
-			table[idx].name = name;
-			if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
-			  {
-			    table[idx].sym = ref;
-			    table[idx].map = undef_map;
-			  }
-			else
-			  {
-			    table[idx].sym = sym;
-			    table[idx].map = map;
-
-			    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;
-		      }
-
 		    idx += hash2;
 		    if (idx >= size)
 		      idx -= size;
 		  }
+
+		table[idx].hashval = hash;
+		table[idx].name = name;
+		table[idx].sym = sym;
+		table[idx].map = map;
 	      }
 
 	      struct unique_sym_table *tab
@@ -467,8 +449,19 @@
 		  tab->free = free;
 		}
 
-	      enter (entries, size, new_hash, strtab + sym->st_name, sym,
-		     (struct link_map *) map);
+	      if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
+		enter (entries, size, new_hash, strtab + sym->st_name, ref,
+		       undef_map);
+	      else
+		{
+		  enter (entries, size, new_hash, strtab + sym->st_name, sym,
+			 map);
+
+		  if (map->l_type == lt_loaded)
+		    /* Make sure we don't unload this object by
+		       setting the appropriate flag.  */
+		    ((struct link_map *) map)->l_flags_1 |= DF_1_NODELETE;
+		}
 	      ++tab->n_elements;
 
 	      __rtld_lock_unlock_recursive (tab->lock);