Pārlūkot izejas kodu

[Pal/Linux] 16-align stack before calling pal_linux_main

Isaku Yamahata 4 gadi atpakaļ
vecāks
revīzija
0214a5b7ca
1 mainītis faili ar 6 papildinājumiem un 5 dzēšanām
  1. 6 5
      Pal/src/host/Linux/db_main.c

+ 6 - 5
Pal/src/host/Linux/db_main.c

@@ -40,11 +40,12 @@
 /* At the begining of entry point, rsp starts at argc, then argvs,
    envps and auxvs. Here we store rsp to rdi, so it will not be
    messed up by function calls */
-__asm__ (".global pal_start \n"
-     "  .type pal_start,@function \n"
-     "pal_start: \n"
-     "  movq %rsp, %rdi \n"
-     "  call pal_linux_main \n");
+__asm__ (".global pal_start\n"
+     "  .type pal_start,@function\n"
+     "pal_start:\n"
+     "  movq %rsp, %rdi\n"
+     "  andq $~15, %rsp\n"
+     "  call pal_linux_main\n");
 
 #define RTLD_BOOTSTRAP