diff --git a/base/src/platform/_main.cc b/base/src/platform/_main.cc index 82527ab644..a6120ef4ec 100644 --- a/base/src/platform/_main.cc +++ b/base/src/platform/_main.cc @@ -236,6 +236,12 @@ extern "C" int _main() /* initialize exception handling */ init_exception_handling(); + /* + * We create the thread-context area as early as possible to prevent other + * mappings from occupying the predefined virtual-memory region. + */ + env_context_area_rm_session(); + /* * Trigger first exception. This step has two purposes. * First, it enables us to detect problems related to exception handling as @@ -261,9 +267,6 @@ extern "C" int _main() /* now, it is save to call printf */ - /* create the thread context area RM session */ - env_context_area_rm_session(); - /* enable tracing support */ inhibit_tracing = false;