2
0
florian 3 жил өмнө
parent
commit
baa28faa19

+ 3 - 3
rtl/linux/x86_64/si_c.inc

@@ -155,10 +155,10 @@ procedure _FPC_libc_start; assembler; nostackframe; public name '_start';
     pushq %rsp
     pushq %rsp
 
 
     { Pass address of our own entry points to .fini and .init.  }
     { Pass address of our own entry points to .fini and .init.  }
-    movq $ini_dummy, %r8
-    movq $ini_dummy, %rcx
+    movq ini_dummy@GOTPCREL(%rip), %r8
+    movq ini_dummy@GOTPCREL(%rip), %rcx
 
 
-    movq $main_stub, %rdi
+    movq main_stub@GOTPCREL(%rip), %rdi
 
 
     { Call the user's main function, and exit with its value.
     { Call the user's main function, and exit with its value.
      But let the libc call main.    }
      But let the libc call main.    }

+ 4 - 4
rtl/linux/x86_64/si_g.inc

@@ -56,7 +56,7 @@ procedure gmon_mcleanup; external name '_mcleanup';
 procedure _FPC_libc_start; forward;
 procedure _FPC_libc_start; forward;
 procedure _FPC_libc_haltproc(e:longint); forward;
 procedure _FPC_libc_haltproc(e:longint); forward;
 
 
- 
+
 procedure main_stub; assembler; nostackframe;
 procedure main_stub; assembler; nostackframe;
   asm
   asm
     { save return address }
     { save return address }
@@ -169,10 +169,10 @@ procedure ini_dummy;
     pushq %rsp
     pushq %rsp
 
 
     { Pass address of our own entry points to .fini and .init.  }
     { Pass address of our own entry points to .fini and .init.  }
-    movq $ini_dummy, %r8
-    movq $ini_dummy, %rcx
+    movq ini_dummy@GOTPCREL(%rip), %r8
+    movq ini_dummy@GOTPCREL(%rip), %rcx
 
 
-    movq $main_stub, %rdi
+    movq main_stub@GOTPCREL(%rip), %rdi
 
 
     { Call the user's main function, and exit with its value.
     { Call the user's main function, and exit with its value.
      But let the libc call main.    }
      But let the libc call main.    }