diff options
author | Andreas Schwab <schwab@redhat.com> | 2011-10-04 16:10:16 +0200 |
---|---|---|
committer | Andreas Schwab <schwab@redhat.com> | 2011-10-05 14:35:40 +0200 |
commit | 3a62d00d408e9ec19479b6c7d39e89021061f9cd (patch) | |
tree | 6f2c708cb3da2fe6d0cbcddfe096cc7e7a8051ba /sysdeps | |
parent | 68577918437e2ccfd6bd2836892f59ef42994963 (diff) | |
download | glibc-3a62d00d408e9ec19479b6c7d39e89021061f9cd.zip glibc-3a62d00d408e9ec19479b6c7d39e89021061f9cd.tar.gz glibc-3a62d00d408e9ec19479b6c7d39e89021061f9cd.tar.bz2 |
Don't call ifunc functions in trace mode
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/i386/dl-machine.h | 27 | ||||
-rw-r--r-- | sysdeps/ia64/dl-machine.h | 6 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/dl-machine.h | 8 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/dl-machine.h | 15 | ||||
-rw-r--r-- | sysdeps/s390/s390-32/dl-machine.h | 5 | ||||
-rw-r--r-- | sysdeps/s390/s390-64/dl-machine.h | 5 | ||||
-rw-r--r-- | sysdeps/sh/dl-machine.h | 5 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/dl-machine.h | 11 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/dl-machine.h | 11 | ||||
-rw-r--r-- | sysdeps/x86_64/dl-machine.h | 11 |
10 files changed, 65 insertions, 39 deletions
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index d1a83ee..9469a2b 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -305,7 +305,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); @@ -341,7 +341,8 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *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 = ((Elf32_Addr (*) (void)) value) (); switch (r_type) @@ -482,7 +483,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); @@ -499,8 +500,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, if (sym != NULL && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1) - && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, - 0)) + && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0) + && __builtin_expect (!skip_ifunc, 1)) value = ((Elf32_Addr (*) (void)) value) (); switch (ELF32_R_TYPE (reloc->r_info)) @@ -647,7 +648,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); @@ -698,19 +700,20 @@ elf_machine_lazy_rel (struct link_map *map, ElfW(Half) ndx = version[ELFW(R_SYM) (r->r_info)] & 0x7fff; elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], &map->l_versions[ndx], - (void *) (l_addr + r->r_offset)); + (void *) (l_addr + r->r_offset), skip_ifunc); } # ifndef RTLD_BOOTSTRAP else elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], NULL, - (void *) (l_addr + r->r_offset)); + (void *) (l_addr + r->r_offset), skip_ifunc); # endif } } else if (__builtin_expect (r_type == R_386_IRELATIVE, 0)) { Elf32_Addr value = map->l_addr + *reloc_addr; - value = ((Elf32_Addr (*) (void)) value) (); + if (__builtin_expect (!skip_ifunc, 1)) + value = ((Elf32_Addr (*) (void)) value) (); *reloc_addr = value; } else @@ -722,7 +725,8 @@ elf_machine_lazy_rel (struct link_map *map, auto inline void __attribute__ ((always_inline)) elf_machine_lazy_rela (struct link_map *map, - Elf32_Addr l_addr, const Elf32_Rela *reloc) + Elf32_Addr l_addr, const Elf32_Rela *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); @@ -739,7 +743,8 @@ elf_machine_lazy_rela (struct link_map *map, else if (__builtin_expect (r_type == R_386_IRELATIVE, 0)) { Elf32_Addr value = map->l_addr + reloc->r_addend; - value = ((Elf32_Addr (*) (void)) value) (); + if (__builtin_expect (!skip_ifunc, 1)) + value = ((Elf32_Addr (*) (void)) value) (); *reloc_addr = value; } else diff --git a/sysdeps/ia64/dl-machine.h b/sysdeps/ia64/dl-machine.h index 6f88005..6053b3b 100644 --- a/sysdeps/ia64/dl-machine.h +++ b/sysdeps/ia64/dl-machine.h @@ -372,7 +372,8 @@ 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); @@ -486,7 +487,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); diff --git a/sysdeps/powerpc/powerpc32/dl-machine.h b/sysdeps/powerpc/powerpc32/dl-machine.h index e7052b6..b24fee0 100644 --- a/sysdeps/powerpc/powerpc32/dl-machine.h +++ b/sysdeps/powerpc/powerpc32/dl-machine.h @@ -272,7 +272,7 @@ extern void _dl_reloc_overflow (struct link_map *map, 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 Elf32_Sym *const refsym = sym; @@ -307,7 +307,8 @@ elf_machine_rela (struct link_map *map, const Elf32_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 = ((Elf32_Addr (*) (void)) value) (); /* A small amount of code is duplicated here for speed. In libc, @@ -382,7 +383,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_Rela *reloc) + Elf32_Addr l_addr, const Elf32_Rela *reloc, + int skip_ifunc) { /* elf_machine_runtime_setup handles this. */ } diff --git a/sysdeps/powerpc/powerpc64/dl-machine.h b/sysdeps/powerpc/powerpc64/dl-machine.h index ab90d1e..f4265bb 100644 --- a/sysdeps/powerpc/powerpc64/dl-machine.h +++ b/sysdeps/powerpc/powerpc64/dl-machine.h @@ -556,7 +556,8 @@ 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 int r_type = ELF64_R_TYPE (reloc->r_info); @@ -579,7 +580,8 @@ elf_machine_rela (struct link_map *map, 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 = resolve_ifunc (value, map, sym_map); /* For relocs that don't edit code, return. @@ -592,12 +594,14 @@ elf_machine_rela (struct link_map *map, return; case R_PPC64_IRELATIVE: - value = resolve_ifunc (value, map, sym_map); + if (__builtin_expect (!skip_ifunc, 1)) + value = resolve_ifunc (value, map, sym_map); *reloc_addr = value; return; case R_PPC64_JMP_IREL: - value = resolve_ifunc (value, map, sym_map); + if (__builtin_expect (!skip_ifunc, 1)) + value = resolve_ifunc (value, map, sym_map); /* Fall thru */ case R_PPC64_JMP_SLOT: #ifdef RESOLVE_CONFLICT_FIND_MAP @@ -846,7 +850,8 @@ elf_machine_rela (struct link_map *map, 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) { /* elf_machine_runtime_setup handles this. */ } diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h index b1f6f41..ea7c6a6 100644 --- a/sysdeps/s390/s390-32/dl-machine.h +++ b/sysdeps/s390/s390-32/dl-machine.h @@ -275,7 +275,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); @@ -433,7 +433,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_Rela *reloc) + Elf32_Addr l_addr, const Elf32_Rela *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); diff --git a/sysdeps/s390/s390-64/dl-machine.h b/sysdeps/s390/s390-64/dl-machine.h index 913ea08..68015a7 100644 --- a/sysdeps/s390/s390-64/dl-machine.h +++ b/sysdeps/s390/s390-64/dl-machine.h @@ -247,7 +247,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 int r_type = ELF64_R_TYPE (reloc->r_info); @@ -412,7 +412,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 int r_type = ELF64_R_TYPE (reloc->r_info); diff --git a/sysdeps/sh/dl-machine.h b/sysdeps/sh/dl-machine.h index 4e09ea4..e02f47c 100644 --- a/sysdeps/sh/dl-machine.h +++ b/sysdeps/sh/dl-machine.h @@ -262,7 +262,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); @@ -446,7 +446,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_Rela *reloc) + Elf32_Addr l_addr, const Elf32_Rela *reloc, + int skip_ifunc) { Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset); /* Check for unexpected PLT reloc type. */ diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h index 8f54f7e..0ef5d28 100644 --- a/sysdeps/sparc/sparc32/dl-machine.h +++ b/sysdeps/sparc/sparc32/dl-machine.h @@ -342,7 +342,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 Elf32_Sym *const refsym = sym; @@ -392,7 +392,8 @@ elf_machine_rela (struct link_map *map, const Elf32_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 = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap)); } @@ -546,7 +547,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_Rela *reloc) + Elf32_Addr l_addr, const Elf32_Rela *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); @@ -556,7 +558,8 @@ elf_machine_lazy_rel (struct link_map *map, else if (r_type == R_SPARC_JMP_IREL) { Elf32_Addr value = map->l_addr + reloc->r_addend; - value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap)); + if (__builtin_expect (!skip_ifunc, 1)) + value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap)); sparc_fixup_plt (reloc, reloc_addr, value, 1, 1); } else if (r_type == R_SPARC_NONE) diff --git a/sysdeps/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h index 47579cd..501092e 100644 --- a/sysdeps/sparc/sparc64/dl-machine.h +++ b/sysdeps/sparc/sparc64/dl-machine.h @@ -368,7 +368,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; #if !defined RTLD_BOOTSTRAP && !defined RESOLVE_CONFLICT_FIND_MAP @@ -422,7 +422,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 (*) (int)) value) (GLRO(dl_hwcap)); switch (r_type) @@ -639,7 +640,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 int r_type = ELF64_R_TYPE (reloc->r_info); @@ -650,7 +652,8 @@ elf_machine_lazy_rel (struct link_map *map, || r_type == R_SPARC_IRELATIVE) { Elf64_Addr value = map->l_addr + reloc->r_addend; - value = ((Elf64_Addr (*) (int)) value) (GLRO(dl_hwcap)); + if (__builtin_expect (!skip_ifunc, 1)) + value = ((Elf64_Addr (*) (int)) value) (GLRO(dl_hwcap)); if (r_type == R_SPARC_JMP_IREL) { /* 'high' is always zero, for large PLT entries the linker diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h index 4c31ac5..6d66ff6 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 |