[Git][ghc/ghc][wip/davide/windows-dlls] WIP place SRT info tables into .rdata on windows
David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC Commits: 87282f89 by David Eichmann at 2026-06-18T17:07:56+01:00 WIP place SRT info tables into .rdata on windows - - - - - 2 changed files: - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs Changes: ===================================== compiler/GHC/Cmm/CLabel.hs ===================================== @@ -106,6 +106,7 @@ module GHC.Cmm.CLabel ( labelDynamic, isLocalCLabel, mayRedirectTo, + isSRTInfoLabel, isInfoTableLabel, isCmmInfoTableLabel, isConInfoTableLabel, @@ -730,6 +731,27 @@ mkOutOfBoundsAccessLabel = mkForeignLabel (fsLit "rtsOutOfBoundsAccess") mkMemcpyRangeOverlapLabel = mkForeignLabel (fsLit "rtsMemcpyRangeOverlap") ForeignLabelInExternalPackage ForeignLabelIsFunction mkMUT_VAR_CLEAN_infoLabel = CmmLabel rtsUnitId (NeedExternDecl False) (fsLit "stg_MUT_VAR_CLEAN") CmmInfo +isSRTInfoLabel :: CLabel -> Bool +isSRTInfoLabel clbl = case clbl of + CmmLabel _ _ lbl CmmInfo -> + lbl == fsLit "stg_SRT_1" + || lbl == fsLit "stg_SRT_2" + || lbl == fsLit "stg_SRT_3" + || lbl == fsLit "stg_SRT_4" + || lbl == fsLit "stg_SRT_5" + || lbl == fsLit "stg_SRT_6" + || lbl == fsLit "stg_SRT_7" + || lbl == fsLit "stg_SRT_8" + || lbl == fsLit "stg_SRT_9" + || lbl == fsLit "stg_SRT_10" + || lbl == fsLit "stg_SRT_11" + || lbl == fsLit "stg_SRT_12" + || lbl == fsLit "stg_SRT_13" + || lbl == fsLit "stg_SRT_14" + || lbl == fsLit "stg_SRT_15" + || lbl == fsLit "stg_SRT_16" + _ -> False + mkSRTInfoLabel :: Int -> CLabel mkSRTInfoLabel n = CmmLabel rtsUnitId (NeedExternDecl False) lbl CmmInfo where ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -33,7 +33,7 @@ import GHC.CmmToAsm.Ppr import GHC.Cmm hiding (topInfoTable) import GHC.Cmm.Dataflow.Label import GHC.Cmm.BlockId -import GHC.Cmm.CLabel +import GHC.Cmm.CLabel as CLabel import GHC.Cmm.InitFini import GHC.Cmm.DebugBlock (pprUnwindTable) @@ -96,10 +96,18 @@ pprNatCmmDecl config proc@(CmmProc top_info entry_lbl _ (ListGraph blocks)) = ) | otherwise = (empty,empty) + section = case top_info_table of + Just (CmmStaticsRaw info_lbl _) + | platformOS platform == OSMinGW32 + && externallyVisibleCLabel info_lbl + && isSRTInfoLabel info_lbl + -> ReadOnlyData + _ -> Text + in vcat [ -- section directive. Requires proc_lbl when split-section is enabled to -- use as a subsection name. - pprSectionAlign config (Section Text proc_lbl) + pprSectionAlign config (Section section proc_lbl) -- section alignment. Note that when there is an info table, we align the -- info table and not the entry code! View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/87282f890746b47beeac32620da58b22... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/87282f890746b47beeac32620da58b22... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
David Eichmann (@DavidEichmann)