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.10-141-ga38862a


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  a38862a58910a5209c9ac3baae5797fbbedbeb1c (commit)
      from  2123d5815eaaa53a772be4b6069bdc6332f2f491 (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://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a38862a58910a5209c9ac3baae5797fbbedbeb1c

commit a38862a58910a5209c9ac3baae5797fbbedbeb1c
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Mon Jul 6 06:55:57 2009 -0700

    Optimize test for valid ELF symbol types in lookup function.

diff --git a/ChangeLog b/ChangeLog
index 9d9828c..c364e5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-06  Ulrich Drepper  <drepper@redhat.com>
+
+	* elf/do-lookup.h (ALLOWED_STT): Optimize test for valid symbol types.
+
 2009-07-03  Andreas Schwab  <aschwab@redhat.com>
 
 	* sysdeps/powerpc/sysdep.h (PPC_FEATURE_ARCH_2_06): Fix value.
diff --git a/elf/do-lookup.h b/elf/do-lookup.h
index ae74da4..acbc53d 100644
--- a/elf/do-lookup.h
+++ b/elf/do-lookup.h
@@ -87,13 +87,13 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
 			      0))
 	  return NULL;
 
-	if (__builtin_expect (stt > STT_FUNC
-			      && stt != STT_COMMON
-			      && stt != STT_TLS
-			      && stt != STT_GNU_IFUNC, 0))
-	  /* Ignore all but STT_NOTYPE, STT_OBJECT, STT_FUNC, STT_COMMON,
-	     STT_TLS, and STT_GNU_IFUNC since these are no code/data
-	     definitions.  */
+	/* Ignore all but STT_NOTYPE, STT_OBJECT, STT_FUNC,
+	   STT_COMMON, STT_TLS, and STT_GNU_IFUNC since these are no
+	   code/data definitions.  */
+#define ALLOWED_STT \
+	((1 << STT_NOTYPE) | (1 << STT_OBJECT) | (1 << STT_FUNC) \
+	 | (1 << STT_COMMON) | (1 << STT_TLS) | (1 << STT_GNU_IFUNC))
+	if (__builtin_expect (((1 << stt) & ALLOWED_STT) == 0, 0))
 	  return NULL;
 
 	if (sym != ref && strcmp (strtab + sym->st_name, undef_name))

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

Summary of changes:
 ChangeLog       |    4 ++++
 elf/do-lookup.h |   14 +++++++-------
 2 files changed, 11 insertions(+), 7 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]