diff --git a/libc/init/init.cpp b/libc/init/init.cpp index f9d42345..8c2e313f 100644 --- a/libc/init/init.cpp +++ b/libc/init/init.cpp @@ -43,22 +43,13 @@ static char* find_last_elem(char* str) extern "C" void initialize_standard_library(int argc, char* argv[]) { - // We got ourselves a little bootstrap problem. We'd like these variables to - // be available during early startup - however, we can't create a copy yet - // because the heap isn't initialized yet. Instead, we'll simply point at - // the original value - we're safe since argv[0] is not supposed to be - // modified until main is run. Once we heap is up, we'll strdup. const char* argv0 = argc ? argv[0] : ""; program_invocation_name = (char*) argv0; program_invocation_short_name = find_last_elem((char*) argv0); - // Initialize pthreads and stuff like thread-local storage. + // Initialize pthreads. pthread_initialize(); // Initialize stdio. init_stdio(); - - // We can now create a copy of the program name variables safely. - program_invocation_name = strdup(program_invocation_name); - program_invocation_short_name = find_last_elem(program_invocation_name); }