aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-03-30 21:14:32 +0000
committerUlrich Drepper <drepper@redhat.com>2009-03-30 21:14:32 +0000
commitcb14424eb93499ba6e6dc8dba45ef6a58ce0a174 (patch)
tree820e84323ce8b616aba7d8b797c84e3cce32bbd1
parentdb486995b6e86cb17cc689ca800139db3b9d4ce3 (diff)
downloadglibc-cb14424eb93499ba6e6dc8dba45ef6a58ce0a174.tar
glibc-cb14424eb93499ba6e6dc8dba45ef6a58ce0a174.tar.gz
glibc-cb14424eb93499ba6e6dc8dba45ef6a58ce0a174.tar.bz2
glibc-cb14424eb93499ba6e6dc8dba45ef6a58ce0a174.zip
* elf/do-lookup.h (do_lookup_x): Minor optimization and cleanup.
Avoid reuse of complex expression.
-rw-r--r--ChangeLog3
-rw-r--r--elf/do-lookup.h14
2 files changed, 10 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 275d64a1dc..4099fffe54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2009-03-30 Ulrich Drepper <drepper@redhat.com>
+ * elf/do-lookup.h (do_lookup_x): Minor optimization and cleanup.
+ Avoid reuse of complex expression.
+
* po/fr.po: Update from translation team.
2009-03-16 Ulrich Drepper <drepper@redhat.com>
diff --git a/elf/do-lookup.h b/elf/do-lookup.h
index 41e5fc137c..ae74da4846 100644
--- a/elf/do-lookup.h
+++ b/elf/do-lookup.h
@@ -1,5 +1,5 @@
/* Look up a symbol in the loaded objects.
- Copyright (C) 1995-2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1995-2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -79,18 +79,18 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
__attribute_noinline__
check_match (const ElfW(Sym) *sym)
{
+ unsigned int stt = ELFW(ST_TYPE) (sym->st_info);
assert (ELF_RTYPE_CLASS_PLT == 1);
if (__builtin_expect ((sym->st_value == 0 /* No value. */
- && ELFW(ST_TYPE) (sym->st_info) != STT_TLS)
+ && stt != STT_TLS)
|| (type_class & (sym->st_shndx == SHN_UNDEF)),
0))
return NULL;
- if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) > STT_FUNC
- && ELFW(ST_TYPE) (sym->st_info) != STT_COMMON
- && ELFW(ST_TYPE) (sym->st_info) != STT_TLS
- && ELFW(ST_TYPE) (sym->st_info) != STT_GNU_IFUNC,
- 0))
+ 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. */