From 3a62d00d408e9ec19479b6c7d39e89021061f9cd Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 4 Oct 2011 16:10:16 +0200 Subject: Don't call ifunc functions in trace mode --- sysdeps/x86_64/dl-machine.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sysdeps/x86_64') diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h index 4c31ac5da8..6d66ff69c7 100644 --- a/sysdeps/x86_64/dl-machine.h +++ b/sysdeps/x86_64/dl-machine.h @@ -255,7 +255,7 @@ auto inline void __attribute__ ((always_inline)) elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, const Elf64_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) + void *const reloc_addr_arg, int skip_ifunc) { Elf64_Addr *const reloc_addr = reloc_addr_arg; const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info); @@ -293,7 +293,8 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, if (sym != NULL && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0) - && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)) + && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1) + && __builtin_expect (!skip_ifunc, 1)) value = ((Elf64_Addr (*) (void)) value) (); switch (r_type) @@ -459,7 +460,8 @@ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc, auto inline void __attribute ((always_inline)) elf_machine_lazy_rel (struct link_map *map, - Elf64_Addr l_addr, const Elf64_Rela *reloc) + Elf64_Addr l_addr, const Elf64_Rela *reloc, + int skip_ifunc) { Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset); const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info); @@ -486,7 +488,8 @@ elf_machine_lazy_rel (struct link_map *map, else if (__builtin_expect (r_type == R_X86_64_IRELATIVE, 0)) { Elf64_Addr value = map->l_addr + reloc->r_addend; - value = ((Elf64_Addr (*) (void)) value) (); + if (__builtin_expect (!skip_ifunc, 1)) + value = ((Elf64_Addr (*) (void)) value) (); *reloc_addr = value; } else -- cgit 1.4.1