This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.20-69-g7b8fb2b


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  7b8fb2b8db0be0c9f3e3c6667198f34bf11a8024 (commit)
      from  f7b425175c3fa2f063a6c5657d84b799929db459 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7b8fb2b8db0be0c9f3e3c6667198f34bf11a8024

commit 7b8fb2b8db0be0c9f3e3c6667198f34bf11a8024
Author: Roland McGrath <roland@hack.frob.com>
Date:   Wed Oct 8 15:18:02 2014 -0700

    Remove unnecessarily nested function in do_lookup_unique.

diff --git a/ChangeLog b/ChangeLog
index 29c5883..c4c466a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-10-08  Kostya Serebryany  <konstantin.s.serebryany@gmail.com>
+	    Roland McGrath  <roland@hack.frob.com>
+
+	* elf/dl-lookup.c (enter_unique_sym): New function, broken out of ...
+	(do_lookup_unique): ... local function 'enter' here; update callers.
+
 2014-10-06  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/make-syscalls.sh (emit_weak_aliases): Condition
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 7c32830..bc6d788 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -182,6 +182,27 @@ check_match (const char *const undef_name,
   return sym;
 }
 
+/* Utility function for do_lookup_unique.  Add a symbol to TABLE.  */
+static void
+enter_unique_sym (struct unique_sym *table, size_t size,
+                  unsigned int hash, const char *name,
+                  const ElfW(Sym) *sym, const struct link_map *map)
+{
+  size_t idx = hash % size;
+  size_t hash2 = 1 + hash % (size - 2);
+  while (table[idx].name != NULL)
+    {
+      idx += hash2;
+      if (idx >= size)
+        idx -= size;
+    }
+
+  table[idx].hashval = hash;
+  table[idx].name = name;
+  table[idx].sym = sym;
+  table[idx].map = map;
+}
+
 /* Utility function for do_lookup_x. Lookup an STB_GNU_UNIQUE symbol
    in the unique symbol table, creating a new entry if necessary.
    Return the matching symbol in RESULT.  */
@@ -191,28 +212,9 @@ do_lookup_unique (const char *undef_name, uint_fast32_t new_hash,
 		  int type_class, const ElfW(Sym) *sym, const char *strtab,
 		  const ElfW(Sym) *ref, const struct link_map *undef_map)
 {
-  /* We have to determine whether we already found a
-     symbol with this name before.  If not then we have to
-     add it to the search table.  If we already found a
-     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, const struct link_map *map)
-  {
-    size_t idx = hash % size;
-    size_t hash2 = 1 + hash % (size - 2);
-    while (table[idx].name != NULL)
-      {
-	idx += hash2;
-	if (idx >= size)
-	  idx -= size;
-      }
-
-    table[idx].hashval = hash;
-    table[idx].name = name;
-    table[idx].sym = sym;
-    table[idx].map = map;
-  }
+  /* We have to determine whether we already found a symbol with this
+     name before.  If not then we have to add it to the search table.
+     If we already found a definition we have to use it.  */
 
   struct unique_sym_table *tab
     = &GL(dl_ns)[map->l_ns]._ns_unique_sym_table;
@@ -274,9 +276,9 @@ do_lookup_unique (const char *undef_name, uint_fast32_t new_hash,
 
 	  for (idx = 0; idx < size; ++idx)
 	    if (entries[idx].name != NULL)
-	      enter (newentries, newsize, entries[idx].hashval,
-		     entries[idx].name, entries[idx].sym,
-		     entries[idx].map);
+	      enter_unique_sym (newentries, newsize, entries[idx].hashval,
+                                entries[idx].name, entries[idx].sym,
+                                entries[idx].map);
 
 	  tab->free (entries);
 	  tab->size = newsize;
@@ -317,11 +319,12 @@ do_lookup_unique (const char *undef_name, uint_fast32_t new_hash,
     }
 
   if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
-    enter (entries, size, new_hash, strtab + sym->st_name, ref,
+    enter_unique_sym (entries, size, new_hash, strtab + sym->st_name, ref,
 	   undef_map);
   else
     {
-      enter (entries, size, new_hash, strtab + sym->st_name, sym, map);
+      enter_unique_sym (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

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog       |    6 +++++
 elf/dl-lookup.c |   57 ++++++++++++++++++++++++++++--------------------------
 2 files changed, 36 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]