diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-03-30 08:14:09 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-03-30 08:14:09 +0200 |
commit | ec6a6a6bb5bb30ca1821c9df312893ec9bd52d26 (patch) | |
tree | d493aeaf6a4f1a77aeb65823dd4d3b66e114699e /src/ortho/mcode | |
parent | baa9dfbdac7e9d2c8e1960a62e62dd807d751c46 (diff) | |
download | ghdl-ec6a6a6bb5bb30ca1821c9df312893ec9bd52d26.tar.gz ghdl-ec6a6a6bb5bb30ca1821c9df312893ec9bd52d26.tar.bz2 ghdl-ec6a6a6bb5bb30ca1821c9df312893ec9bd52d26.zip |
Add chkstk-x64 for windows x64
Diffstat (limited to 'src/ortho/mcode')
-rw-r--r-- | src/ortho/mcode/ortho_code-x86-abi.adb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ortho/mcode/ortho_code-x86-abi.adb b/src/ortho/mcode/ortho_code-x86-abi.adb index 44c435de2..0bba430a0 100644 --- a/src/ortho/mcode/ortho_code-x86-abi.adb +++ b/src/ortho/mcode/ortho_code-x86-abi.adb @@ -846,7 +846,12 @@ package body Ortho_Code.X86.Abi is procedure Chkstk (Sz : Integer); pragma Import (C, Chkstk, "__chkstk"); - procedure Link_Intrinsics is + procedure Chkstk_Ms (Sz : Integer); + pragma Import (C, Chkstk_Ms, "__chkstk_ms"); + + procedure Link_Intrinsics + is + Addr : System.Address; begin if not Flags.M64 then Binary_File.Memory.Set_Symbol_Address @@ -863,8 +868,13 @@ package body Ortho_Code.X86.Abi is Moddi3'Address); end if; if X86.Flags.Flag_Alloca_Call then + if Flags.Win64 then + Addr := Chkstk_Ms'Address; + else + Addr := Chkstk'Address; + end if; Binary_File.Memory.Set_Symbol_Address - (Ortho_Code.X86.Emits.Chkstk_Symbol, Chkstk'Address); + (Ortho_Code.X86.Emits.Chkstk_Symbol, Addr); end if; end Link_Intrinsics; |