Browse Source

Fix loading of argc field (longint type) of TEntryInformation.OS record

git-svn-id: trunk@37329 -
pierre 7 years ago
parent
commit
a706c3900f
2 changed files with 4 additions and 2 deletions
  1. 2 1
      rtl/linux/x86_64/si_c.inc
  2. 2 1
      rtl/linux/x86_64/si_g.inc

+ 2 - 1
rtl/linux/x86_64/si_c.inc

@@ -128,7 +128,8 @@ procedure _FPC_libc_start; assembler; nostackframe; public name '_start';
 {$ifdef FPC_HAS_INDIRECT_ENTRY_INFORMATION}
     movq SysInitEntryInformation@GOTPCREL(%rip),%rcx
 
-    movl %rsi,TEntryInformation.OS.argc(%rcx)
+    { argc is longint in EntryInformation, thus use %edi register }
+    movl %esi,TEntryInformation.OS.argc(%rcx)
     movq %rsp,TEntryInformation.OS.argv(%rcx)
     movq %rsp,(%rax)
     leaq 8(,%rsi,8),%rax

+ 2 - 1
rtl/linux/x86_64/si_g.inc

@@ -93,7 +93,8 @@ procedure ini_dummy;
 {$ifdef FPC_HAS_INDIRECT_ENTRY_INFORMATION}
     movq SysInitEntryInformation@GOTPCREL(%rip),%rcx
 
-    movl %rsi,TEntryInformation.OS.argc(%rcx)
+    { argc is longint in EntryInformation, thus use %edi register }
+    movl %esi,TEntryInformation.OS.argc(%rcx)
     movq %rsp,TEntryInformation.OS.argv(%rcx)
     movq %rsp,(%rax)
     leaq 8(,%rsi,8),%rax