Small optimization of STT_GNU_IFUNC handling.
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.
This commit is contained in:
parent
21e66bc528
commit
fd96f06208
|
@ -1,5 +1,9 @@
|
|||
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.
|
||||
|
|
|
@ -345,9 +345,9 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
|
|||
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)
|
||||
|
|
|
@ -297,9 +297,9 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
|
|||
: (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
|
||||
|
|
Loading…
Reference in New Issue