Skip to content

MachO linker fix and SRT doc changes

Sylvain Henry requested to merge hsyl20/ghc:hsyl20/srt into master

I have been reading the documentation about the SRT implementation in GHC.Cmm.Info.Build. I've made some fixes to it (second commit).

While doing this I've noticed that we weren't enabling USE_INLINE_SRT_FIELD on AArch64 apparently because of #15169 (closed). However I believe that this issue is unrelated to USE_INLINE_SRT_FIELD because it's related to another kind of "SRT inlining" (avoiding the creation of a singleton SRT, which apparently we can't do with MachO). Third commit enables USE_INLINE_SRT_FIELD on every 64-bit platforms. I think we always assume that small memory model is used, so it should be safe.

Doing this triggered a linker bug in our MachO linker: we were handling ARM64_RELOC_SUBTRACTOR relocations in two steps, which led to overflows. First commit fixes this (I've put it first to ensure that no commit breaks on CI).

Merge request reports