arm: don't call ifunc functions in trace mode
authorAndreas Schwab <schwab@redhat.com>
Wed, 5 Oct 2011 09:51:41 +0000 (11:51 +0200)
committerAndreas Schwab <schwab@redhat.com>
Wed, 5 Oct 2011 09:52:11 +0000 (11:52 +0200)
ChangeLog.arm
sysdeps/arm/dl-machine.h

index 51e477c..ba319b8 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-05  Andreas Schwab  <schwab@redhat.com>
+
+       * 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  <joseph@codesourcery.com>
 
        * sysdeps/arm/elf/configure.in: Always test for TLS support and
        file.
 
 2009-10-22  Andrew Stubbs  <ams@codesourcery.com>
-            Julian Brown  <julian@codesourcery.com>
+           Julian Brown  <julian@codesourcery.com>
 
        * sysdeps/arm/eabi/setjmp.S (__sigsetjmp): Replace deprecated
        instruction fstmiax with vstmia.
        (setup_aeabi_stdio): New function.  Add it to .preinit_array.
 
 2009-06-24  Maxim Kuvyrkov  <maxim@codesourcery.com>
-            Mark Mitchell  <mark@codesourcery.com>
-            Joseph Myers  <joseph@codesourcery.com>
-            Kazu Hirata  <kazu@codesourcery.com>
+           Mark Mitchell  <mark@codesourcery.com>
+           Joseph Myers  <joseph@codesourcery.com>
+           Kazu Hirata  <kazu@codesourcery.com>
 
        * sysdeps/arm/eabi/backtrace.c: New.
        * sysdeps/arm/eabi/Makefile (CFLAGS-backtrace.c): Add
 
 2009-02-13  Khem Raj  <raj.khem@gmail.com>
 
-       * 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  <paul@codesourcery.com>
-            Joseph Myers  <joseph@codesourcery.com>
+           Joseph Myers  <joseph@codesourcery.com>
 
        * sysdeps/arm/dl-machine.h (elf_machine_dynamic): Ditto.
        (elf_machine_load_address): Clear T bit of PLT entry contents.
 
 2006-06-08  Mark Shinwell  <shinwell@codesourcery.com>
 
-        * 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  <dan@codesourcery.com>
 
index 1ba7700..5a58965 100644 (file)
@@ -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);