aboutsummaryrefslogtreecommitdiff
path: root/development/fpc/patches/Fix-liking-with-libc-when-PIC-is-enabled.patch
blob: 096c05891270e26bc8a08563381562fcf038b3b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From: Florian Klämpfl <florian@freepascal.org>
Date: Mon Aug 3 19:42:14 2020 UTC
Description: @PLT is needed for calls to link it properly with pic code

--- fpc.orig/fpcsrc/rtl/linux/x86_64/si_c.inc
+++ fpc/fpcsrc/rtl/linux/x86_64/si_c.inc
@@ -86,7 +86,7 @@
 
     { start the program }
     xorq    %rbp,%rbp
-    call    PASCALMAIN
+    call    PASCALMAIN@PLT
 {$endif FPC_HAS_INDIRECT_ENTRY_INFORMATION}
     hlt
   end;
@@ -162,7 +162,7 @@
 
     { Call the user's main function, and exit with its value.
      But let the libc call main.    }
-    call libc_start_main
+    call libc_start_main@PLT
 
     hlt                     { Crash if somehow `exit' does return.  }
   end;