crt: exe: Inline pre_c_init() and pre_cpp_init() into _CRT_INIT()

This allows to remove the whole pre_c_init() and pre_cpp_init() functions
and registration of __mingw_pcinit and __mingw_pcppinit hooks.

Inlining the code allows to easily figure out in which order is
initialization code called.

Also merge code which is protected by __native_startup_lock into one
if-branch for better code readability.

Function pre_c_init() was the first callback in .CRT$XI section, so now
call its code before the _initterm_e(__xi_a, __xi_z) (which executes all
remaining .CRT$XI callbacks).

Function pre_cpp_init() was the first callback in .CRT$XC section, so now
call its code before the _initterm (__xc_a, __xc_z) (which executes all
remaining .CRT$XC callbacks).

Signed-off-by: Martin Storsjö <martin@martin.st>
1 file changed