From 4556a9e353f3e4fd5beb7c3c568a885e28e7be1f Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Thu, 26 Sep 2013 12:38:45 +0200 Subject: [PATCH] Preserve thread-context area as early as possible --- base/src/platform/_main.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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;