mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 13:00:06 +00:00
Optimize test for valid ELF symbol types in lookup function.
This commit is contained in:
parent
2123d5815e
commit
a38862a589
@ -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.
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user