Browse Source

Improve PIC startup code when not using C libraries. It correctly reaches PascalMain, but it crashes inside fpc_cpucodeinit when setting has_mmx_support :/

git-svn-id: branches/svenbarth/packages@32497 -
svenbarth 9 years ago
parent
commit
ca73033018
1 changed files with 8 additions and 7 deletions
  1. 8 7
      rtl/linux/i386/si_prc.inc

+ 8 - 7
rtl/linux/i386/si_prc.inc

@@ -107,22 +107,23 @@ asm
         addl    $_GLOBAL_OFFSET_TABLE_,%ebx
 
         movl    SysInitEntryInformation@GOT(%ebx),%ecx
-        movl    %eax,SysInitEntryInformation.Platform.envp(%ebx)
+
+        movl    %eax,TEntryInformation.Platform.envp(%ecx)
 
         popl    %eax
-        movl    %eax,SysInitEntryInformation.Platform.argc(%ebx)
+        movl    %eax,TEntryInformation.Platform.argc(%ecx)
 
         popl    %eax
-        movl    %eax,SysInitEntryInformation.Platform.argv(%ebx)
+        movl    %eax,TEntryInformation.Platform.argv(%ecx)
 
-        leal    _FPC_proc_haltproc,%eax
-        movl    %eax,SysInitEntryInformation.Platform.haltproc(%ebx)
+        movl    _FPC_proc_haltproc@GOT(%ebx),%eax
+        movl    %eax,TEntryInformation.Platform.haltproc(%ecx)
 
         call    SysResetFPU
 
-        movl    %esp,SysInitEntryInformation.Platform.stkptr(%ebx)
+        movl    %esp,TEntryInformation.Platform.stkptr(%ecx)
 
-        movl    %ebx,%eax
+        movl    %ecx,%eax
   {$else FPC_PIC}
         movl    %eax,SysInitEntryInformation.Platform.envp
         movl    %ecx,SysInitEntryInformation.Platform.argc