Forráskód Böngészése

* Fixed register rsi being overwritten. It is used to pass argc into libc_start_main.

git-svn-id: trunk@22043 -
sergei 13 éve
szülő
commit
393f1d58ed
2 módosított fájl, 6 hozzáadás és 6 törlés
  1. 2 2
      rtl/linux/x86_64/cprt0.as
  2. 4 4
      rtl/linux/x86_64/gprt0.as

+ 2 - 2
rtl/linux/x86_64/cprt0.as

@@ -50,8 +50,8 @@ _start:
         movq    %rsp,(%rax)   /* argv starts just at the current stack top.  */
         leaq    8(,%rsi,8),%rax
         addq    %rsp,%rax
-        movq    operatingsystem_parameter_envp@GOTPCREL(%rip),%rsi
-        movq    %rax,(%rsi)
+        movq    operatingsystem_parameter_envp@GOTPCREL(%rip),%rcx
+        movq    %rax,(%rcx)
 
 	/* Align the stack to a 16 byte boundary to follow the ABI.  */
 	andq  $~15, %rsp

+ 4 - 4
rtl/linux/x86_64/gprt0.as

@@ -48,10 +48,10 @@ _start:
         movq    %rsi,(%rax)
         movq    operatingsystem_parameter_argv@GOTPCREL(%rip),%rax
         movq    %rsp,(%rax)   /* argv starts just at the current stack top.  */
-        leaq     8(,%rsi,8),%rax
-        addq     %rsp,%rax
-        movq    operatingsystem_parameter_envp@GOTPCREL(%rip),%rsi
-        movq    %rax,(%rsi)
+        leaq    8(,%rsi,8),%rax
+        addq    %rsp,%rax
+        movq    operatingsystem_parameter_envp@GOTPCREL(%rip),%rcx
+        movq    %rax,(%rcx)
 
 	/* Align the stack to a 16 byte boundary to follow the ABI.  */
 	andq  $~15, %rsp