Skip to content
Snippets Groups Projects
Verified Commit ae8e070b authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Init TLS before allocator

parent 0c6398ab
No related branches found
No related tags found
No related merge requests found
...@@ -112,15 +112,17 @@ pub unsafe extern "C" fn relibc_start(sp: &'static Stack) -> ! { ...@@ -112,15 +112,17 @@ pub unsafe extern "C" fn relibc_start(sp: &'static Stack) -> ! {
fn _init(); fn _init();
fn main(argc: isize, argv: *mut *mut c_char, envp: *mut *mut c_char) -> c_int; 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 // Ensure correct host system before executing more system calls
relibc_verify_host(); relibc_verify_host();
// Initialize TLS, if necessary
ld_so::init(sp); 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 // Set up argc and argv
let argc = sp.argc; let argc = sp.argc;
let argv = sp.argv(); let argv = sp.argv();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment