Init TLS before allocator

This commit is contained in:
Jeremy Soller
2020-08-02 14:32:28 -06:00
parent 0c6398abcb
commit ae8e070b9e
+5 -3
View File
@@ -112,15 +112,17 @@ pub unsafe extern "C" fn relibc_start(sp: &'static Stack) -> ! {
fn _init();
fn main(argc: isize, argv: *mut *mut c_char, envp: *mut *mut c_char) -> c_int;
}
// Step 1 setup the right allocator...
// if any memory rust based memory allocation happen before this step .. we are doomed.
alloc_init();
// Ensure correct host system before executing more system calls
relibc_verify_host();
// Initialize TLS, if necessary
ld_so::init(sp);
// Set up the right allocator...
// if any memory rust based memory allocation happen before this step .. we are doomed.
alloc_init();
// Set up argc and argv
let argc = sp.argc;
let argv = sp.argv();