about summary refs log tree commit diff
path: root/sysdeps/x86_64/dl-machine.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-06-01 11:49:05 -0700
committerUlrich Drepper <drepper@redhat.com>2009-06-01 11:49:05 -0700
commitfd96f062085be71f4e2c07c98a3002bd55793b6e (patch)
tree9dd63d31fbd1b922fa612a591b4124b27b417c83 /sysdeps/x86_64/dl-machine.h
parent21e66bc528edcbe18d434eb33a601e0f796904c9 (diff)
downloadglibc-fd96f062085be71f4e2c07c98a3002bd55793b6e.tar.gz
glibc-fd96f062085be71f4e2c07c98a3002bd55793b6e.tar.xz
glibc-fd96f062085be71f4e2c07c98a3002bd55793b6e.zip
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.
Diffstat (limited to 'sysdeps/x86_64/dl-machine.h')
-rw-r--r--sysdeps/x86_64/dl-machine.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 1b5ce8e981..61a0556d5e 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -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