From 4db71d2f9897c6ca7a9d0cadc1fc4067557a4eb3 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 29 Nov 2019 17:55:22 +0100 Subject: elf: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214] This commit adds missing skip_ifunc checks to aarch64, arm, i386, sparc, and x86_64. A new test case ensures that IRELATIVE IFUNC resolvers do not run in various diagnostic modes of the dynamic loader. Reviewed-By: Szabolcs Nagy --- sysdeps/x86_64/dl-machine.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sysdeps/x86_64') diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h index f17f5fb7cd..58260c7876 100644 --- a/sysdeps/x86_64/dl-machine.h +++ b/sysdeps/x86_64/dl-machine.h @@ -512,7 +512,8 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, # endif case R_X86_64_IRELATIVE: value = map->l_addr + reloc->r_addend; - value = ((ElfW(Addr) (*) (void)) value) (); + if (__glibc_likely (!skip_ifunc)) + value = ((ElfW(Addr) (*) (void)) value) (); *reloc_addr = value; break; default: -- cgit 1.4.1