summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/rtld.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-11-23 09:25:51 +0000
committerkib <kib@FreeBSD.org>2016-11-23 09:25:51 +0000
commita52231cd70e92e8870126afdd5014759f6a2dc0a (patch)
treefaacad3b3c0d5f6d69c56950a84781b1f7cc59c8 /libexec/rtld-elf/rtld.c
parentf868ec0125dea0fb67f9030f66a171ed2d864860 (diff)
downloadFreeBSD-src-a52231cd70e92e8870126afdd5014759f6a2dc0a.zip
FreeBSD-src-a52231cd70e92e8870126afdd5014759f6a2dc0a.tar.gz
MFC r308689:
Pass CPUID[1] %edx (cpu_feature), %ecx (cpu_feature2) and CPUID[7].%ebx (cpu_stdext_feature), %ecx (cpu_stdext_feature2) to the ifunc resolvers on x86. MFC r308925: Adjust r308689 to make rtld compilable with either in-tree or (hopefully) stock gcc 4.2.1 on i386 and other arches.
Diffstat (limited to 'libexec/rtld-elf/rtld.c')
-rw-r--r--libexec/rtld-elf/rtld.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index fe25e59..4222c18 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -642,6 +642,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
r_debug_state(NULL, &obj_main->linkmap); /* say hello to gdb! */
map_stacks_exec(NULL);
+ ifunc_init(aux);
dbg("resolving ifuncs");
if (resolve_objects_ifunc(obj_main,
@@ -690,7 +691,7 @@ rtld_resolve_ifunc(const Obj_Entry *obj, const Elf_Sym *def)
Elf_Addr target;
ptr = (void *)make_function_pointer(def, obj);
- target = ((Elf_Addr (*)(void))ptr)();
+ target = call_ifunc_resolver(ptr);
return ((void *)target);
}
OpenPOWER on IntegriCloud