diff --git a/src/start.rs b/src/start.rs index e45ed130014ac73c3b79418560d432cf5afeb5ff..d001d9dde0aaaa7b74a06512eb29ce3d7c4a2375 100644 --- a/src/start.rs +++ b/src/start.rs @@ -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();