about summary refs log tree commit diff stats
path: root/src/main.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-02 10:47:22 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-02 10:47:22 +0100
commit26201d7e705714cd8ecca3fa28f51e819f9eb520 (patch)
treea53914e9b6b28285ed5ee1f22d7d2900f608faec /src/main.c
parent542a2a0775e5fe2921ce7893a9c1d77915a87bc4 (diff)
downloadbox64-26201d7e705714cd8ecca3fa28f51e819f9eb520.tar.gz
box64-26201d7e705714cd8ecca3fa28f51e819f9eb520.zip
More elf loader and parsing and stack preparing
Diffstat (limited to 'src/main.c')
-rwxr-xr-xsrc/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 90f513fd..4d5b7fe8 100755
--- a/src/main.c
+++ b/src/main.c
@@ -16,6 +16,7 @@
 #include "wine_tools.h"
 #include "elfloader.h"
 #include "custommem.h"
+#include "box64stack.h"
 
 box64context_t *my_context = NULL;
 int box64_log = LOG_NONE;
@@ -807,6 +808,14 @@ int main(int argc, const char **argv, const char **env) {
             printf_log(LOG_INFO, "BOX86: Using tcmalloc_minimal.so.4, and it's in the LD_PRELOAD command\n");
         }
     }
+    // get and alloc stack size and align
+    if(CalcStackSize(my_context)) {
+        printf_log(LOG_NONE, "Error: allocating stack\n");
+        free_contextargv();
+        FreeBox64Context(&my_context);
+        FreeCollection(&ld_preload);
+        return -1;
+    }
 
     return 0;
 }