Initialize ifunc calling machinery earlier.

In particular, do it before the first call to allocate_initial_tls(),
which contains MD parts to set the initial thread' TLS pointer.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
kib 2018-10-29 23:56:39 +00:00
parent e13e892e7a
commit 8e7496aa64

View File

@ -709,6 +709,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
exit (0);
}
ifunc_init(aux);
/*
* Setup TLS for main thread. This must be done after the
* relocations are processed, since tls initialization section
@ -730,7 +732,6 @@ _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,