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

[commits] r8646 - in /fsf/trunk/libc: ChangeLog elf/do-lookup.h



Author: eglibc
Date: Tue Jul  7 00:09:43 2009
New Revision: 8646

Log:
Import glibc-mainline for 2009-07-07

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/elf/do-lookup.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue Jul  7 00:09:43 2009
@@ -1,3 +1,7 @@
+2009-07-06  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* elf/do-lookup.h (ALLOWED_STT): Optimize test for valid symbol types.
+
 2009-07-03  Andreas Schwab  <aschwab@xxxxxxxxxx>
 
 	* sysdeps/powerpc/sysdep.h (PPC_FEATURE_ARCH_2_06): Fix value.

Modified: fsf/trunk/libc/elf/do-lookup.h
==============================================================================
--- fsf/trunk/libc/elf/do-lookup.h (original)
+++ fsf/trunk/libc/elf/do-lookup.h Tue Jul  7 00:09:43 2009
@@ -87,13 +87,13 @@
 			      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))