The test to call the indirect function now includes a subtest to
checked whether the symbol is defined. When coming to that point
this is almost always the case. The test for STT_GNU_IFUNC on the
other hand rarely is true. Move it to the front means we don't have
to perform the second test unless really necessary.
2009-06-01 Ulrich Drepper <drepper@redhat.com>
+ * sysdeps/i386/dl-machine.h (elf_machine_rel): Reorder conditions
+ for STT_GNU_IFUNC handling for efficiency.
+ * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.
+
* sysdeps/i386/dl-irel.h (elf_irel): Use __libc_fatal instead of just
_exit.
* sysdeps/x86_64/dl-irel.h (elf_irela): Likewise.
Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
if (sym != NULL
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
- 0))
+ 0)
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
value = ((Elf32_Addr (*) (void)) value) ();
switch (r_type)
: (Elf64_Addr) sym_map->l_addr + sym->st_value);
if (sym != NULL
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
- 0))
+ 0)
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
value = ((Elf64_Addr (*) (void)) value) ();
# if defined RTLD_BOOTSTRAP && !USE___THREAD