From 0507f293c9b67d8eec92e8178308d72f1ed88449 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 5 Oct 2011 11:51:41 +0200 Subject: [PATCH] arm: don't call ifunc functions in trace mode --- ChangeLog.arm | 22 ++++++++++++++-------- sysdeps/arm/dl-machine.h | 29 +++++++++++++++-------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/ChangeLog.arm b/ChangeLog.arm index 51e477c..ba319b8 100644 --- a/ChangeLog.arm +++ b/ChangeLog.arm @@ -1,3 +1,9 @@ +2011-10-05 Andreas Schwab + + * sysdeps/arm/dl-machine.h (elf_machine_rel, elf_machine_rela) + (elf_machine_lazy_rel): Add parameter skip_ifunc, don't call ifunc + function if non-zero. + 2011-09-13 Joseph Myers * sysdeps/arm/elf/configure.in: Always test for TLS support and @@ -370,7 +376,7 @@ file. 2009-10-22 Andrew Stubbs - Julian Brown + Julian Brown * sysdeps/arm/eabi/setjmp.S (__sigsetjmp): Replace deprecated instruction fstmiax with vstmia. @@ -415,9 +421,9 @@ (setup_aeabi_stdio): New function. Add it to .preinit_array. 2009-06-24 Maxim Kuvyrkov - Mark Mitchell - Joseph Myers - Kazu Hirata + Mark Mitchell + Joseph Myers + Kazu Hirata * sysdeps/arm/eabi/backtrace.c: New. * sysdeps/arm/eabi/Makefile (CFLAGS-backtrace.c): Add @@ -478,17 +484,17 @@ 2009-02-13 Khem Raj - * sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c + * sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c (libgcc_s_handle): New variable. (pthread_cancel_init): Depend in libgcc_s_handle for decision to load DSO. Assign last. (__unwind_freeres): New function. - * sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c: + * sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c: Likewise. 2009-02-05 Paul Brook - Joseph Myers + Joseph Myers * sysdeps/arm/dl-machine.h (elf_machine_dynamic): Ditto. (elf_machine_load_address): Clear T bit of PLT entry contents. @@ -894,7 +900,7 @@ 2006-06-08 Mark Shinwell - * sysdeps/arm/nptl/pthreaddef.h (CURRENT_STACK_FRAME): Add -12. + * sysdeps/arm/nptl/pthreaddef.h (CURRENT_STACK_FRAME): Add -12. 2006-06-08 Daniel Jacobowitz diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h index 1ba7700..5a58965 100644 --- a/sysdeps/arm/dl-machine.h +++ b/sysdeps/arm/dl-machine.h @@ -335,7 +335,7 @@ auto inline void __attribute__ ((always_inline)) elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, const Elf32_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) + void *const reloc_addr_arg, int skip_ifunc) { Elf32_Addr *const reloc_addr = reloc_addr_arg; const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); @@ -369,9 +369,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 (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, - 0) - && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)) + && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0) + && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1) + && __builtin_expect (!skip_ifunc, 1)) value = ((Elf32_Addr (*) (void)) value) (); switch (r_type) @@ -430,7 +430,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, } case R_ARM_TLS_DESC: { - struct tlsdesc volatile *td = + struct tlsdesc volatile *td = (struct tlsdesc volatile *)reloc_addr; # ifndef RTLD_BOOTSTRAP @@ -454,10 +454,10 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, else # endif # endif - { + { td->argument.value = value + sym_map->l_tls_offset; td->entry = _dl_tlsdesc_return; - } + } } } break; @@ -525,7 +525,7 @@ auto inline void __attribute__ ((always_inline)) elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, const Elf32_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) + void *const reloc_addr_arg, int skip_ifunc) { Elf32_Addr *const reloc_addr = reloc_addr_arg; const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); @@ -543,9 +543,9 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value; 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 (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0) + && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1) + && __builtin_expect (!skip_ifunc, 1)) value = ((Elf32_Addr (*) (void)) value) (); switch (r_type) @@ -656,7 +656,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, auto inline void __attribute__ ((always_inline)) elf_machine_lazy_rel (struct link_map *map, - Elf32_Addr l_addr, const Elf32_Rel *reloc) + Elf32_Addr l_addr, const Elf32_Rel *reloc, + int skip_ifunc) { Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset); const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); @@ -674,8 +675,8 @@ elf_machine_lazy_rel (struct link_map *map, (struct tlsdesc volatile *)reloc_addr; /* The linker must have given us the parameter we need in the - first GOT entry, and left the second one empty. We fill the - last with the resolver address */ + first GOT entry, and left the second one empty. We fill the + last with the resolver address */ assert (td->entry == 0); td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)]) + map->l_addr); -- 2.7.4