summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2020-11-20 21:48:25 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-04-19 15:40:25 -0400
commit8b5e5b0524f614679a20ffaebab731c54dc6dee9 (patch)
treea9122d0912955c43b44cbe5734b32ba700af5c29 /libraries
parent0b398d554f0cc2f5341ccf62f40347c9c025767f (diff)
downloadhaskell-8b5e5b0524f614679a20ffaebab731c54dc6dee9.tar.gz
Enable tables next to code for riscv64
This requires adding another rewrite to the mangler, to avoid generating PLT entries.
Diffstat (limited to 'libraries')
-rw-r--r--libraries/ghci/GHCi/InfoTable.hsc9
1 files changed, 9 insertions, 0 deletions
diff --git a/libraries/ghci/GHCi/InfoTable.hsc b/libraries/ghci/GHCi/InfoTable.hsc
index fce2c653f2..c5dd4f0db8 100644
--- a/libraries/ghci/GHCi/InfoTable.hsc
+++ b/libraries/ghci/GHCi/InfoTable.hsc
@@ -241,6 +241,15 @@ mkJumpToAddr a = case hostPlatformArch of
0xC0, 0x19, byte3 w64, byte2 w64, byte1 w64, byte0 w64,
0x07, 0xF1 ]
+ ArchRISCV64 -> pure $
+ let w64 = fromIntegral (funPtrToInt a) :: Word64
+ in Right [ 0x00000297 -- auipc t0,0
+ , 0x01053283 -- ld t0,16(t0)
+ , 0x00028067 -- jr t0
+ , 0x00000013 -- nop
+ , fromIntegral w64
+ , fromIntegral (w64 `shiftR` 32) ]
+
arch ->
-- The arch isn't supported. You either need to add your architecture as a
-- distinct case, or use non-TABLES_NEXT_TO_CODE mode.