summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/Info/Build.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2022-05-12 14:09:17 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-05-30 09:40:55 -0400
commit5878f439d4214ba0dd895e56460f15fc6c67283c (patch)
treee58caba9d0aabbba870f72278511104bbb32873a /compiler/GHC/Cmm/Info/Build.hs
parentacc268064daaa39823b0d566169eadb2afdff743 (diff)
downloadhaskell-5878f439d4214ba0dd895e56460f15fc6c67283c.tar.gz
Enable USE_INLINE_SRT_FIELD on ARM64
It was previously disabled because of: - a confusion about "SRT inlining" (see removed comment in this commit) - a linker bug (overflow) in the handling of ARM64_RELOC_SUBTRACTOR relocation: fixed by a previous commit.
Diffstat (limited to 'compiler/GHC/Cmm/Info/Build.hs')
-rw-r--r--compiler/GHC/Cmm/Info/Build.hs13
1 files changed, 2 insertions, 11 deletions
diff --git a/compiler/GHC/Cmm/Info/Build.hs b/compiler/GHC/Cmm/Info/Build.hs
index 4d5b277f52..5a3b22f8b8 100644
--- a/compiler/GHC/Cmm/Info/Build.hs
+++ b/compiler/GHC/Cmm/Info/Build.hs
@@ -167,16 +167,6 @@ Requires:
- 64-bit architecture
- small memory model
-Currently it is only enabled on x86_64 with TABLES_NEXT_TO_CODE.
-
-It is claimed that MachO doesn't support it due to #15169. However I believe
-that two kinds of SRT inlining have been confused:
-- inlining the SRT offset in the info->srt field
- - should always be fine
-- inlining singleton SRT (i.e. SRT containing one reference)
- - this can lead to a relative reference to an object external to the
- compilation unit (c.f. #15169)
-
We optimise the info table representation further. The offset to the SRT can
be stored in 32 bits (all code lives within a 2GB region in x86_64's small
memory model), so we can save a word in the info table by storing the
@@ -1162,7 +1152,8 @@ oneSRT cfg staticFuns lbls caf_lbls isCAF cafs static_data_env = do
not (labelDynamic this_mod platform (cmmExternalDynamicRefs cfg) lbl)
-- MachO relocations can't express offsets between compilation units at
- -- all, so we are always forced to build a singleton SRT in this case.
+ -- all, so we are always forced to build a singleton SRT in this case
+ -- (cf #15169)
&& (not (osMachOTarget $ platformOS $ profilePlatform profile)
|| isLocalCLabel this_mod lbl) -> do