diff --git a/compiler/ghci/ByteCodeAsm.hs b/compiler/GHC/ByteCode/Asm.hs
similarity index 98%
rename from compiler/ghci/ByteCodeAsm.hs
rename to compiler/GHC/ByteCode/Asm.hs
index adf701b7e570ac9fbf81c21cb5ebb899887ea5fc..db5c14b806684aec553724315c9197d2485c8cc4 100644
--- a/compiler/ghci/ByteCodeAsm.hs
+++ b/compiler/GHC/ByteCode/Asm.hs
@@ -4,8 +4,8 @@
 --  (c) The University of Glasgow 2002-2006
 --
 
--- | ByteCodeLink: Bytecode assembler and linker
-module ByteCodeAsm (
+-- | Bytecode assembler and linker
+module GHC.ByteCode.Asm (
         assembleBCOs, assembleOneBCO,
 
         bcoFreeNames,
@@ -17,11 +17,11 @@ module ByteCodeAsm (
 
 import GhcPrelude
 
-import ByteCodeInstr
-import ByteCodeItbls
-import ByteCodeTypes
+import GHC.ByteCode.Instr
+import GHC.ByteCode.InfoTable
+import GHC.ByteCode.Types
 import GHCi.RemoteTypes
-import GHCi
+import GHC.Runtime.Interpreter
 
 import HscTypes
 import Name
@@ -30,7 +30,7 @@ import Literal
 import TyCon
 import FastString
 import GHC.StgToCmm.Layout     ( ArgRep(..) )
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import DynFlags
 import Outputable
 import GHC.Platform
@@ -460,8 +460,8 @@ assembleI dflags i = case i of
       LitNumWord    -> int (fromIntegral i)
       LitNumInt64   -> int64 (fromIntegral i)
       LitNumWord64  -> int64 (fromIntegral i)
-      LitNumInteger -> panic "ByteCodeAsm.literal: LitNumInteger"
-      LitNumNatural -> panic "ByteCodeAsm.literal: LitNumNatural"
+      LitNumInteger -> panic "GHC.ByteCode.Asm.literal: LitNumInteger"
+      LitNumNatural -> panic "GHC.ByteCode.Asm.literal: LitNumNatural"
     -- We can lower 'LitRubbish' to an arbitrary constant, but @NULL@ is most
     -- likely to elicit a crash (rather than corrupt memory) in case absence
     -- analysis messed up.
diff --git a/compiler/ghci/ByteCodeItbls.hs b/compiler/GHC/ByteCode/InfoTable.hs
similarity index 93%
rename from compiler/ghci/ByteCodeItbls.hs
rename to compiler/GHC/ByteCode/InfoTable.hs
index 2138482051b70a7dfa258f865e5b2821387f80fc..40a107756d54c46dcd4b8ce3079fff8e7c66f7be 100644
--- a/compiler/ghci/ByteCodeItbls.hs
+++ b/compiler/GHC/ByteCode/InfoTable.hs
@@ -4,15 +4,15 @@
 --  (c) The University of Glasgow 2002-2006
 --
 
--- | ByteCodeItbls: Generate infotables for interpreter-made bytecodes
-module ByteCodeItbls ( mkITbls ) where
+-- | Generate infotables for interpreter-made bytecodes
+module GHC.ByteCode.InfoTable ( mkITbls ) where
 
 #include "HsVersions.h"
 
 import GhcPrelude
 
-import ByteCodeTypes
-import GHCi
+import GHC.ByteCode.Types
+import GHC.Runtime.Interpreter
 import DynFlags
 import HscTypes
 import Name             ( Name, getName )
diff --git a/compiler/ghci/ByteCodeInstr.hs b/compiler/GHC/ByteCode/Instr.hs
similarity index 99%
rename from compiler/ghci/ByteCodeInstr.hs
rename to compiler/GHC/ByteCode/Instr.hs
index 9cdd297dbdc0f0cadc6042e57eea568e6d084107..d6c9cd5391f5f498080d0864d13cfd2820f40393 100644
--- a/compiler/ghci/ByteCodeInstr.hs
+++ b/compiler/GHC/ByteCode/Instr.hs
@@ -4,8 +4,8 @@
 --  (c) The University of Glasgow 2002-2006
 --
 
--- | ByteCodeInstrs: Bytecode instruction definitions
-module ByteCodeInstr (
+-- | Bytecode instruction definitions
+module GHC.ByteCode.Instr (
         BCInstr(..), ProtoBCO(..), bciStackUse,
   ) where
 
@@ -13,7 +13,7 @@ module ByteCodeInstr (
 
 import GhcPrelude
 
-import ByteCodeTypes
+import GHC.ByteCode.Types
 import GHCi.RemoteTypes
 import GHCi.FFI (C_ffi_cif)
 import GHC.StgToCmm.Layout     ( ArgRep(..) )
@@ -28,7 +28,7 @@ import Literal
 import DataCon
 import VarSet
 import PrimOp
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 
 import Data.Word
 import GHC.Stack.CCS (CostCentre)
diff --git a/compiler/ghci/ByteCodeLink.hs b/compiler/GHC/ByteCode/Linker.hs
similarity index 93%
rename from compiler/ghci/ByteCodeLink.hs
rename to compiler/GHC/ByteCode/Linker.hs
index 9138d1c125b0d308da5a71c47423dd32bbbea937..69bdb63a91d461782fc33715e533e6a3b63de4e0 100644
--- a/compiler/ghci/ByteCodeLink.hs
+++ b/compiler/GHC/ByteCode/Linker.hs
@@ -8,8 +8,8 @@
 --  (c) The University of Glasgow 2002-2006
 --
 
--- | ByteCodeLink: Bytecode assembler and linker
-module ByteCodeLink (
+-- | Bytecode assembler and linker
+module GHC.ByteCode.Linker (
         ClosureEnv, emptyClosureEnv, extendClosureEnv,
         linkBCO, lookupStaticPtr,
         lookupIE,
@@ -25,8 +25,8 @@ import GHCi.ResolvedBCO
 import GHCi.BreakArray
 import SizedSeq
 
-import GHCi
-import ByteCodeTypes
+import GHC.Runtime.Interpreter
+import GHC.ByteCode.Types
 import HscTypes
 import Name
 import NameEnv
@@ -90,7 +90,7 @@ lookupStaticPtr hsc_env addr_of_label_string = do
   m <- lookupSymbol hsc_env addr_of_label_string
   case m of
     Just ptr -> return ptr
-    Nothing  -> linkFail "ByteCodeLink: can't find label"
+    Nothing  -> linkFail "GHC.ByteCode.Linker: can't find label"
                   (unpackFS addr_of_label_string)
 
 lookupIE :: HscEnv -> ItblEnv -> Name -> IO (Ptr ())
@@ -108,7 +108,7 @@ lookupIE hsc_env ie con_nm =
                    n <- lookupSymbol hsc_env sym_to_find2
                    case n of
                       Just addr -> return addr
-                      Nothing   -> linkFail "ByteCodeLink.lookupIE"
+                      Nothing   -> linkFail "GHC.ByteCode.Linker.lookupIE"
                                       (unpackFS sym_to_find1 ++ " or " ++
                                        unpackFS sym_to_find2)
 
@@ -118,7 +118,7 @@ lookupPrimOp hsc_env primop = do
   m <- lookupSymbol hsc_env (mkFastString sym_to_find)
   case m of
     Just p -> return (toRemotePtr p)
-    Nothing -> linkFail "ByteCodeLink.lookupCE(primop)" sym_to_find
+    Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE(primop)" sym_to_find
 
 resolvePtr
   :: HscEnv -> ItblEnv -> ClosureEnv -> NameEnv Int -> RemoteRef BreakArray
@@ -135,7 +135,7 @@ resolvePtr hsc_env _ie ce bco_ix _ (BCOPtrName nm)
        m <- lookupSymbol hsc_env sym_to_find
        case m of
          Just p -> return (ResolvedBCOStaticPtr (toRemotePtr p))
-         Nothing -> linkFail "ByteCodeLink.lookupCE" (unpackFS sym_to_find)
+         Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE" (unpackFS sym_to_find)
 resolvePtr hsc_env _ _ _ _ (BCOPtrPrimOp op) =
   ResolvedBCOStaticPtr <$> lookupPrimOp hsc_env op
 resolvePtr hsc_env ie ce bco_ix breakarray (BCOPtrBCO bco) =
diff --git a/compiler/ghci/ByteCodeTypes.hs b/compiler/GHC/ByteCode/Types.hs
similarity index 98%
rename from compiler/ghci/ByteCodeTypes.hs
rename to compiler/GHC/ByteCode/Types.hs
index 0c0c34ad64cb7b8a02e1bb5b30fc86a9f4a13303..ce80c53279ce529cd6128a0a879c59be5ed4eca3 100644
--- a/compiler/ghci/ByteCodeTypes.hs
+++ b/compiler/GHC/ByteCode/Types.hs
@@ -4,7 +4,7 @@
 --
 
 -- | Bytecode assembler types
-module ByteCodeTypes
+module GHC.ByteCode.Types
   ( CompiledByteCode(..), seqCompiledByteCode, FFIInfo(..)
   , UnlinkedBCO(..), BCOPtr(..), BCONPtr(..)
   , ItblEnv, ItblPtr(..)
@@ -114,7 +114,7 @@ data CgBreakInfo
    { cgb_vars   :: [Maybe (Id,Word16)]
    , cgb_resty  :: Type
    }
--- See Note [Syncing breakpoint info] in compiler/main/InteractiveEval.hs
+-- See Note [Syncing breakpoint info] in GHC.Runtime.Eval
 
 -- Not a real NFData instance because we can't rnf Id or Type
 seqCgBreakInfo :: CgBreakInfo -> ()
diff --git a/compiler/GHC/Cmm.hs b/compiler/GHC/Cmm.hs
index 8850f2e19ab65e1cd60f736f10bcf3f10f3934da..f8cf5789d75b39b42c10a5ff30cc11f1a69c1738 100644
--- a/compiler/GHC/Cmm.hs
+++ b/compiler/GHC/Cmm.hs
@@ -31,7 +31,7 @@ import CostCentre
 import GHC.Cmm.CLabel
 import GHC.Cmm.BlockId
 import GHC.Cmm.Node
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import GHC.Cmm.Expr
 import GHC.Cmm.Dataflow.Block
 import GHC.Cmm.Dataflow.Collections
diff --git a/compiler/GHC/Cmm/CallConv.hs b/compiler/GHC/Cmm/CallConv.hs
index 9200daec570f49e8716b8023f6c0d33fb213d08f..db9603c524f113a8fb4ce7a5fecd2cd36c7c467c 100644
--- a/compiler/GHC/Cmm/CallConv.hs
+++ b/compiler/GHC/Cmm/CallConv.hs
@@ -8,7 +8,7 @@ module GHC.Cmm.CallConv (
 import GhcPrelude
 
 import GHC.Cmm.Expr
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import GHC.Cmm (Convention(..))
 import GHC.Cmm.Ppr () -- For Outputable instances
 
diff --git a/compiler/GHC/Cmm/Graph.hs b/compiler/GHC/Cmm/Graph.hs
index 8d19e7fdb9cce2f712a28ec24cfb304412d51361..1d8b44776dd7a90b02e1ee1f99674412edb5fd4a 100644
--- a/compiler/GHC/Cmm/Graph.hs
+++ b/compiler/GHC/Cmm/Graph.hs
@@ -35,7 +35,7 @@ import DynFlags
 import FastString
 import ForeignCall
 import OrdList
-import GHC.Runtime.Layout (ByteOff)
+import GHC.Runtime.Heap.Layout (ByteOff)
 import UniqSupply
 import Util
 import Panic
diff --git a/compiler/GHC/Cmm/Info.hs b/compiler/GHC/Cmm/Info.hs
index 9e12fb170d2664f51258f64582b6812ba590a644..6948f78969d0dd2976aad5714c6af9cc303b2b60 100644
--- a/compiler/GHC/Cmm/Info.hs
+++ b/compiler/GHC/Cmm/Info.hs
@@ -38,7 +38,7 @@ import GhcPrelude
 import GHC.Cmm
 import GHC.Cmm.Utils
 import GHC.Cmm.CLabel
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import GHC.Data.Bitmap
 import Stream (Stream)
 import qualified Stream
diff --git a/compiler/GHC/Cmm/Info/Build.hs b/compiler/GHC/Cmm/Info/Build.hs
index d90c776c88cf48223ac93af74af1da17e8e64b68..4b0532eef1c9faa6d29245016b5697200c3a2d7e 100644
--- a/compiler/GHC/Cmm/Info/Build.hs
+++ b/compiler/GHC/Cmm/Info/Build.hs
@@ -27,7 +27,7 @@ import GHC.Cmm.Utils
 import DynFlags
 import Maybes
 import Outputable
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import UniqSupply
 import CostCentre
 import GHC.StgToCmm.Heap
diff --git a/compiler/GHC/Cmm/LayoutStack.hs b/compiler/GHC/Cmm/LayoutStack.hs
index f6dda7728c4d6aee03886be1b92471c932f05f13..b34de95982e8d7f95231a7100640e1c0819714d6 100644
--- a/compiler/GHC/Cmm/LayoutStack.hs
+++ b/compiler/GHC/Cmm/LayoutStack.hs
@@ -18,7 +18,7 @@ import GHC.Cmm.Graph
 import ForeignCall
 import GHC.Cmm.Liveness
 import GHC.Cmm.ProcPoint
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import GHC.Cmm.Dataflow.Block
 import GHC.Cmm.Dataflow.Collections
 import GHC.Cmm.Dataflow
diff --git a/compiler/GHC/Cmm/Node.hs b/compiler/GHC/Cmm/Node.hs
index 0764d6d8a3141d52a3b499ca0644ea45003a76f3..f7cee80145c11449e4c5ba05d792e9fb2596c59a 100644
--- a/compiler/GHC/Cmm/Node.hs
+++ b/compiler/GHC/Cmm/Node.hs
@@ -35,7 +35,7 @@ import DynFlags
 import FastString
 import ForeignCall
 import Outputable
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import CoreSyn (Tickish)
 import qualified Unique as U
 
diff --git a/compiler/GHC/Cmm/Parser.y b/compiler/GHC/Cmm/Parser.y
index 886f429611e39984a11e7c8c86e87d98346c739b..ed2d95a28364647a41266ece76dd33235d9a6854 100644
--- a/compiler/GHC/Cmm/Parser.y
+++ b/compiler/GHC/Cmm/Parser.y
@@ -231,7 +231,7 @@ import GHC.Cmm.BlockId
 import GHC.Cmm.Lexer
 import GHC.Cmm.CLabel
 import GHC.Cmm.Monad
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import Lexer
 
 import CostCentre
diff --git a/compiler/GHC/Cmm/Utils.hs b/compiler/GHC/Cmm/Utils.hs
index eda440040d2f9d13228f33c7096d477f1328b149..c62f7eb3df1670305bc9b2b5ddea93c7eb3616dd 100644
--- a/compiler/GHC/Cmm/Utils.hs
+++ b/compiler/GHC/Cmm/Utils.hs
@@ -75,7 +75,7 @@ import GhcPrelude
 import TyCon    ( PrimRep(..), PrimElemRep(..) )
 import GHC.Types.RepType  ( UnaryType, SlotTy (..), typePrimRep1 )
 
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import GHC.Cmm
 import GHC.Cmm.BlockId
 import GHC.Cmm.CLabel
diff --git a/compiler/ghci/ByteCodeGen.hs b/compiler/GHC/CoreToByteCode.hs
similarity index 98%
rename from compiler/ghci/ByteCodeGen.hs
rename to compiler/GHC/CoreToByteCode.hs
index 5d5b2990e68796b8c475edee0e0684c334aa874a..f6ceadf1bedcef5e18aac11e4fa496129901f352 100644
--- a/compiler/ghci/ByteCodeGen.hs
+++ b/compiler/GHC/CoreToByteCode.hs
@@ -7,18 +7,18 @@
 --  (c) The University of Glasgow 2002-2006
 --
 
--- | ByteCodeGen: Generate bytecode from Core
-module ByteCodeGen ( UnlinkedBCO, byteCodeGen, coreExprToBCOs ) where
+-- | GHC.CoreToByteCode: Generate bytecode from Core
+module GHC.CoreToByteCode ( UnlinkedBCO, byteCodeGen, coreExprToBCOs ) where
 
 #include "HsVersions.h"
 
 import GhcPrelude
 
-import ByteCodeInstr
-import ByteCodeAsm
-import ByteCodeTypes
+import GHC.ByteCode.Instr
+import GHC.ByteCode.Asm
+import GHC.ByteCode.Types
 
-import GHCi
+import GHC.Runtime.Interpreter
 import GHCi.FFI
 import GHCi.RemoteTypes
 import BasicTypes
@@ -51,7 +51,7 @@ import FastString
 import Panic
 import GHC.StgToCmm.Closure    ( NonVoid(..), fromNonVoid, nonVoidIds )
 import GHC.StgToCmm.Layout
-import GHC.Runtime.Layout hiding (WordOff, ByteOff, wordsToBytes)
+import GHC.Runtime.Heap.Layout hiding (WordOff, ByteOff, wordsToBytes)
 import GHC.Data.Bitmap
 import OrdList
 import Maybes
@@ -88,7 +88,7 @@ byteCodeGen :: HscEnv
             -> IO CompiledByteCode
 byteCodeGen hsc_env this_mod binds tycs mb_modBreaks
    = withTiming dflags
-                (text "ByteCodeGen"<+>brackets (ppr this_mod))
+                (text "GHC.CoreToByteCode"<+>brackets (ppr this_mod))
                 (const ()) $ do
         -- Split top-level binds into strings and others.
         -- See Note [generating code for top-level string literal bindings].
@@ -105,7 +105,7 @@ byteCodeGen hsc_env this_mod binds tycs mb_modBreaks
              mapM schemeTopBind flatBinds
 
         when (notNull ffis)
-             (panic "ByteCodeGen.byteCodeGen: missing final emitBc?")
+             (panic "GHC.CoreToByteCode.byteCodeGen: missing final emitBc?")
 
         dumpIfSet_dyn dflags Opt_D_dump_BCOs
            "Proto-BCOs" FormatByteCode
@@ -161,7 +161,7 @@ coreExprToBCOs :: HscEnv
                -> IO UnlinkedBCO
 coreExprToBCOs hsc_env this_mod expr
  = withTiming dflags
-              (text "ByteCodeGen"<+>brackets (ppr this_mod))
+              (text "GHC.CoreToByteCode"<+>brackets (ppr this_mod))
               (const ()) $ do
       -- create a totally bogus name for the top-level BCO; this
       -- should be harmless, since it's never used for anything
@@ -175,7 +175,7 @@ coreExprToBCOs hsc_env this_mod expr
               schemeR [] (invented_name, simpleFreeVars expr)
 
       when (notNull mallocd)
-           (panic "ByteCodeGen.coreExprToBCOs: missing final emitBc?")
+           (panic "GHC.CoreToByteCode.coreExprToBCOs: missing final emitBc?")
 
       dumpIfSet_dyn dflags Opt_D_dump_BCOs "Proto-BCOs" FormatByteCode
          (ppr proto_bco)
@@ -212,7 +212,7 @@ bytesToWords dflags (ByteOff bytes) =
     let (q, r) = bytes `quotRem` (wORD_SIZE dflags)
     in if r == 0
            then fromIntegral q
-           else panic $ "ByteCodeGen.bytesToWords: bytes=" ++ show bytes
+           else panic $ "GHC.CoreToByteCode.bytesToWords: bytes=" ++ show bytes
 
 wordSize :: DynFlags -> ByteOff
 wordSize dflags = ByteOff (wORD_SIZE dflags)
@@ -674,7 +674,7 @@ schemeE d s p (AnnCase scrut bndr _ alts)
    = doCase d s p scrut bndr alts Nothing{-not an unboxed tuple-}
 
 schemeE _ _ _ expr
-   = pprPanic "ByteCodeGen.schemeE: unhandled case"
+   = pprPanic "GHC.CoreToByteCode.schemeE: unhandled case"
                (pprCoreExpr (deAnnotate' expr))
 
 -- Is this Id a not-necessarily-lifted join point?
@@ -965,7 +965,7 @@ findPushSeq (D: rest)
 findPushSeq (L: rest)
   = (PUSH_APPLY_L, 1, rest)
 findPushSeq _
-  = panic "ByteCodeGen.findPushSeq"
+  = panic "GHC.CoreToByteCode.findPushSeq"
 
 -- -----------------------------------------------------------------------------
 -- Case expressions
@@ -1222,7 +1222,7 @@ generateCCall d0 s p (CCallSpec target cconv safety) fn args_r_to_l
          !d_after_args = d0 + wordsToBytes dflags a_reps_sizeW
          a_reps_pushed_RAW
             | null a_reps_pushed_r_to_l || not (isVoidRep (head a_reps_pushed_r_to_l))
-            = panic "ByteCodeGen.generateCCall: missing or invalid World token?"
+            = panic "GHC.CoreToByteCode.generateCCall: missing or invalid World token?"
             | otherwise
             = reverse (tail a_reps_pushed_r_to_l)
 
@@ -1294,7 +1294,7 @@ generateCCall d0 s p (CCallSpec target cconv safety) fn args_r_to_l
          a_reps --  | trace (showSDoc (ppr a_reps_pushed_RAW)) False = error "???"
                 | is_static = a_reps_pushed_RAW
                 | otherwise = if null a_reps_pushed_RAW
-                              then panic "ByteCodeGen.generateCCall: dyn with no args"
+                              then panic "GHC.CoreToByteCode.generateCCall: dyn with no args"
                               else tail a_reps_pushed_RAW
 
          -- push the Addr#
@@ -1324,7 +1324,7 @@ generateCCall d0 s p (CCallSpec target cconv safety) fn args_r_to_l
          conv = case cconv of
            CCallConv -> FFICCall
            StdCallConv -> FFIStdCall
-           _ -> panic "ByteCodeGen: unexpected calling convention"
+           _ -> panic "GHC.CoreToByteCode: unexpected calling convention"
 
      -- the only difference in libffi mode is that we prepare a cif
      -- describing the call type by calling libffi, and we attach the
@@ -1620,7 +1620,7 @@ pushAtom _ _ (AnnLit lit) = do
           LitNumNatural -> panic "pushAtom: LitNatural"
 
 pushAtom _ _ expr
-   = pprPanic "ByteCodeGen.pushAtom"
+   = pprPanic "GHC.CoreToByteCode.pushAtom"
               (pprCoreExpr (deAnnotate' expr))
 
 
@@ -2007,7 +2007,7 @@ getLabelsBc n
 
 getCCArray :: BcM (Array BreakIndex (RemotePtr CostCentre))
 getCCArray = BcM $ \st ->
-  let breaks = expectJust "ByteCodeGen.getCCArray" $ modBreaks st in
+  let breaks = expectJust "GHC.CoreToByteCode.getCCArray" $ modBreaks st in
   return (st, modBreaks_ccs breaks)
 
 
diff --git a/compiler/GHC/CoreToStg/Prep.hs b/compiler/GHC/CoreToStg/Prep.hs
index 59de501fa86720e491a43687fe3648d8dbb1d381..fdd182b48b105b08d0255d487b53a794c9cf64c3 100644
--- a/compiler/GHC/CoreToStg/Prep.hs
+++ b/compiler/GHC/CoreToStg/Prep.hs
@@ -946,7 +946,7 @@ pragma.  It is levity-polymorphic.
                               -> (# State# RealWorld, o #)
 
 It needs no special treatment in GHC except this special inlining here
-in CorePrep (and in ByteCodeGen).
+in CorePrep (and in GHC.CoreToByteCode).
 
 -- ---------------------------------------------------------------------------
 --      CpeArg: produces a result satisfying CpeArg
diff --git a/compiler/GHC/Data/Bitmap.hs b/compiler/GHC/Data/Bitmap.hs
index a8eba5e2e82846aa0148ea7bf0d5d6ae209c3b18..c778a575f84d0f4e3d4624d7f4a2dace892a503e 100644
--- a/compiler/GHC/Data/Bitmap.hs
+++ b/compiler/GHC/Data/Bitmap.hs
@@ -17,7 +17,7 @@ module GHC.Data.Bitmap (
 
 import GhcPrelude
 
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import DynFlags
 import Util
 
diff --git a/compiler/ghci/Debugger.hs b/compiler/GHC/Runtime/Debugger.hs
similarity index 98%
rename from compiler/ghci/Debugger.hs
rename to compiler/GHC/Runtime/Debugger.hs
index 7bfc4eff4c5352875cd663764ebe2053fa56595f..9443ff942120c4970d8dc834978ac134bdc2bd33 100644
--- a/compiler/ghci/Debugger.hs
+++ b/compiler/GHC/Runtime/Debugger.hs
@@ -12,14 +12,14 @@
 --
 -----------------------------------------------------------------------------
 
-module Debugger (pprintClosureCommand, showTerm, pprTypeAndContents) where
+module GHC.Runtime.Debugger (pprintClosureCommand, showTerm, pprTypeAndContents) where
 
 import GhcPrelude
 
-import Linker
-import RtClosureInspect
+import GHC.Runtime.Linker
+import GHC.Runtime.Heap.Inspect
 
-import GHCi
+import GHC.Runtime.Interpreter
 import GHCi.RemoteTypes
 import GhcMonad
 import HscTypes
diff --git a/compiler/main/InteractiveEval.hs b/compiler/GHC/Runtime/Eval.hs
similarity index 99%
rename from compiler/main/InteractiveEval.hs
rename to compiler/GHC/Runtime/Eval.hs
index badb746718d272e026853d8b70973de44aac1265..d43c5be7b88b3f6914d96f8f56aee6d7b2dce439 100644
--- a/compiler/main/InteractiveEval.hs
+++ b/compiler/GHC/Runtime/Eval.hs
@@ -11,7 +11,7 @@
 --
 -- -----------------------------------------------------------------------------
 
-module InteractiveEval (
+module GHC.Runtime.Eval (
         Resume(..), History(..),
         execStmt, execStmt', ExecOptions(..), execOptions, ExecResult(..), resumeExec,
         runDecls, runDeclsWithLocation, runParsedDecls,
@@ -48,9 +48,9 @@ module InteractiveEval (
 
 import GhcPrelude
 
-import InteractiveEvalTypes
+import GHC.Runtime.Eval.Types
 
-import GHCi
+import GHC.Runtime.Interpreter as GHCi
 import GHCi.Message
 import GHCi.RemoteTypes
 import GhcMonad
@@ -75,8 +75,8 @@ import NameSet
 import Avail
 import RdrName
 import VarEnv
-import ByteCodeTypes
-import Linker
+import GHC.ByteCode.Types
+import GHC.Runtime.Linker as Linker
 import DynFlags
 import Unique
 import UniqSupply
@@ -88,7 +88,7 @@ import Panic
 import Maybes
 import ErrUtils
 import SrcLoc
-import RtClosureInspect
+import GHC.Runtime.Heap.Inspect
 import Outputable
 import FastString
 import Bag
@@ -661,7 +661,7 @@ pushResume hsc_env resume = hsc_env { hsc_IC = ictxt1 }
   Note [Syncing breakpoint info]
 
   To display the values of the free variables for a single breakpoint, the
-  function `compiler/main/InteractiveEval.hs:bindLocalsAtBreakpoint` pulls
+  function `GHC.Runtime.Eval.bindLocalsAtBreakpoint` pulls
   out the information from the fields `modBreaks_breakInfo` and
   `modBreaks_vars` of the `ModBreaks` data structure.
   For a specific breakpoint this gives 2 lists of type `Id` (or `Var`)
@@ -671,9 +671,9 @@ pushResume hsc_env resume = hsc_env { hsc_IC = ictxt1 }
 
   There are 3 situations where items are removed from the Id list
   (or replaced with `Nothing`):
-  1.) If function `compiler/ghci/ByteCodeGen.hs:schemeER_wrk` (which creates
+  1.) If function `GHC.CoreToByteCode.schemeER_wrk` (which creates
       the Id list) doesn't find an Id in the ByteCode environement.
-  2.) If function `compiler/main/InteractiveEval.hs:bindLocalsAtBreakpoint`
+  2.) If function `GHC.Runtime.Eval.bindLocalsAtBreakpoint`
       filters out unboxed elements from the Id list, because GHCi cannot
       yet handle them.
   3.) If the GHCi interpreter doesn't find the reference to a free variable
diff --git a/compiler/main/InteractiveEvalTypes.hs b/compiler/GHC/Runtime/Eval/Types.hs
similarity index 98%
rename from compiler/main/InteractiveEvalTypes.hs
rename to compiler/GHC/Runtime/Eval/Types.hs
index 3bc043f88b070702b465a16f5c6699fad7c47fe5..93072075c0368dfe4a05e0738b3a7fcba914fa42 100644
--- a/compiler/main/InteractiveEvalTypes.hs
+++ b/compiler/GHC/Runtime/Eval/Types.hs
@@ -6,7 +6,7 @@
 --
 -- -----------------------------------------------------------------------------
 
-module InteractiveEvalTypes (
+module GHC.Runtime.Eval.Types (
         Resume(..), History(..), ExecResult(..),
         SingleStep(..), isStep, ExecOptions(..),
         BreakInfo(..)
diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/GHC/Runtime/Heap/Inspect.hs
similarity index 99%
rename from compiler/ghci/RtClosureInspect.hs
rename to compiler/GHC/Runtime/Heap/Inspect.hs
index 9ed5eaef9f6acdf1c6f8315c7df06013c61846de..de6f9a7af3d24fec635cc594d29e3d7fa70388a1 100644
--- a/compiler/ghci/RtClosureInspect.hs
+++ b/compiler/GHC/Runtime/Heap/Inspect.hs
@@ -7,7 +7,7 @@
 -- Pepe Iborra (supported by Google SoC) 2006
 --
 -----------------------------------------------------------------------------
-module RtClosureInspect(
+module GHC.Runtime.Heap.Inspect(
      -- * Entry points and types
      cvObtainTerm,
      cvReconstructType,
@@ -27,7 +27,7 @@ module RtClosureInspect(
 
 import GhcPrelude
 
-import GHCi
+import GHC.Runtime.Interpreter as GHCi
 import GHCi.RemoteTypes
 import HscTypes
 
@@ -58,7 +58,7 @@ import DynFlags
 import Outputable as Ppr
 import GHC.Char
 import GHC.Exts.Heap
-import GHC.Runtime.Layout ( roundUpTo )
+import GHC.Runtime.Heap.Layout ( roundUpTo )
 
 import Control.Monad
 import Data.Maybe
diff --git a/compiler/GHC/Runtime/Layout.hs b/compiler/GHC/Runtime/Heap/Layout.hs
similarity index 99%
rename from compiler/GHC/Runtime/Layout.hs
rename to compiler/GHC/Runtime/Heap/Layout.hs
index 8f245479c1eb1278da48bc4e954c179e1d6293b0..b7899ecc1b4f729bfc26c0111c20ca12d00c6bf6 100644
--- a/compiler/GHC/Runtime/Layout.hs
+++ b/compiler/GHC/Runtime/Heap/Layout.hs
@@ -5,7 +5,7 @@
 
 {-# LANGUAGE CPP,GeneralizedNewtypeDeriving #-}
 
-module GHC.Runtime.Layout (
+module GHC.Runtime.Heap.Layout (
         -- * Words and bytes
         WordOff, ByteOff,
         wordsToBytes, bytesToWordsRoundUp,
diff --git a/compiler/ghci/GHCi.hs b/compiler/GHC/Runtime/Interpreter.hs
similarity index 99%
rename from compiler/ghci/GHCi.hs
rename to compiler/GHC/Runtime/Interpreter.hs
index 8795b30973958588f64e0fe2160548201e781294..9eadacca1c496001b8f9a74149c3e9c245b6936a 100644
--- a/compiler/ghci/GHCi.hs
+++ b/compiler/GHC/Runtime/Interpreter.hs
@@ -4,7 +4,7 @@
 -- | Interacting with the interpreter, whether it is running on an
 -- external process or in the current process.
 --
-module GHCi
+module GHC.Runtime.Interpreter
   ( -- * High-level interface to the interpreter
     evalStmt, EvalStatus_(..), EvalStatus, EvalResult(..), EvalExpr(..)
   , resumeStmt
@@ -135,7 +135,7 @@ The main pieces are:
   server.  This is a fairly simple wrapper, most of the functionality
   is provided by modules in libraries/ghci.
 
-- This module (GHCi) which provides the interface to the server used
+- This module which provides the interface to the server used
   by the rest of GHC.
 
 GHC works with and without -fexternal-interpreter.  With the flag, all
diff --git a/compiler/ghci/Linker.hs b/compiler/GHC/Runtime/Linker.hs
similarity index 99%
rename from compiler/ghci/Linker.hs
rename to compiler/GHC/Runtime/Linker.hs
index 773d396ac940d4b82e18373ce7e067cbddb40835..fb409bd75b3666b307a7033da1d1239d58a949c5 100644
--- a/compiler/ghci/Linker.hs
+++ b/compiler/GHC/Runtime/Linker.hs
@@ -9,25 +9,34 @@
 -- This module deals with the top-level issues of dynamic linking,
 -- calling the object-code linker and the byte-code linker where
 -- necessary.
-module Linker ( getHValue, showLinkerState,
-                linkExpr, linkDecls, unload, withExtendedLinkEnv,
-                extendLinkEnv, deleteFromLinkEnv,
-                extendLoadedPkgs,
-                linkPackages, initDynLinker, linkModule,
-                linkCmdLineLibs,
-                uninitializedLinker
-        ) where
+module GHC.Runtime.Linker
+   ( getHValue
+   , showLinkerState
+   , linkExpr
+   , linkDecls
+   , unload
+   , withExtendedLinkEnv
+   , extendLinkEnv
+   , deleteFromLinkEnv
+   , extendLoadedPkgs
+   , linkPackages
+   , initDynLinker
+   , linkModule
+   , linkCmdLineLibs
+   , uninitializedLinker
+   )
+where
 
 #include "HsVersions.h"
 
 import GhcPrelude
 
-import GHCi
+import GHC.Runtime.Interpreter
 import GHCi.RemoteTypes
 import GHC.Iface.Load
-import ByteCodeLink
-import ByteCodeAsm
-import ByteCodeTypes
+import GHC.ByteCode.Linker
+import GHC.ByteCode.Asm
+import GHC.ByteCode.Types
 import TcRnMonad
 import Packages
 import DriverPhases
@@ -37,7 +46,7 @@ import Name
 import NameEnv
 import Module
 import ListSetOps
-import LinkerTypes (DynLinker(..), LinkerUnitId, PersistentLinkerState(..))
+import GHC.Runtime.Linker.Types (DynLinker(..), LinkerUnitId, PersistentLinkerState(..))
 import DynFlags
 import BasicTypes
 import Outputable
@@ -175,7 +184,7 @@ getHValue hsc_env name = do
               m <- lookupClosure hsc_env (unpackFS sym_to_find)
               case m of
                 Just hvref -> mkFinalizedHValue hsc_env hvref
-                Nothing -> linkFail "ByteCodeLink.lookupCE"
+                Nothing -> linkFail "GHC.ByteCode.Linker.lookupCE"
                              (unpackFS sym_to_find)
 
 linkDependencies :: HscEnv -> PersistentLinkerState
diff --git a/compiler/ghci/LinkerTypes.hs b/compiler/GHC/Runtime/Linker/Types.hs
similarity index 97%
rename from compiler/ghci/LinkerTypes.hs
rename to compiler/GHC/Runtime/Linker/Types.hs
index 4cdfc198da7762e1a1a84229cf74eb6cde47e96f..5b2f506c6d69f4d593da8bd84d2739f259339d2d 100644
--- a/compiler/ghci/LinkerTypes.hs
+++ b/compiler/GHC/Runtime/Linker/Types.hs
@@ -6,7 +6,7 @@
 --
 -----------------------------------------------------------------------------
 
-module LinkerTypes (
+module GHC.Runtime.Linker.Types (
       DynLinker(..),
       PersistentLinkerState(..),
       LinkerUnitId,
@@ -20,7 +20,7 @@ import Data.Time               ( UTCTime )
 import Data.Maybe              ( Maybe )
 import Control.Concurrent.MVar ( MVar )
 import Module                  ( InstalledUnitId, Module )
-import ByteCodeTypes           ( ItblEnv, CompiledByteCode )
+import GHC.ByteCode.Types           ( ItblEnv, CompiledByteCode )
 import Outputable
 import Var                     ( Id )
 import GHC.Fingerprint.Type    ( Fingerprint )
diff --git a/compiler/main/DynamicLoading.hs b/compiler/GHC/Runtime/Loader.hs
similarity index 98%
rename from compiler/main/DynamicLoading.hs
rename to compiler/GHC/Runtime/Loader.hs
index a48f0238be4f531878fd51b455cfaa47df72d723..a1c7c2a0fa0e863f96100eee70a72d8577593938 100644
--- a/compiler/main/DynamicLoading.hs
+++ b/compiler/GHC/Runtime/Loader.hs
@@ -1,7 +1,7 @@
 {-# LANGUAGE CPP, MagicHash #-}
 
 -- | Dynamically lookup up values from modules and loading them.
-module DynamicLoading (
+module GHC.Runtime.Loader (
         initializePlugins,
         -- * Loading plugins
         loadFrontendPlugin,
@@ -23,8 +23,8 @@ module DynamicLoading (
 import GhcPrelude
 import DynFlags
 
-import Linker           ( linkModule, getHValue )
-import GHCi             ( wormhole )
+import GHC.Runtime.Linker      ( linkModule, getHValue )
+import GHC.Runtime.Interpreter ( wormhole )
 import SrcLoc           ( noSrcSpan )
 import Finder           ( findPluginModule, cannotFindModule )
 import TcRnMonad        ( initTcInteractive, initIfaceTcRn )
diff --git a/compiler/GHC/Stg/Lift/Analysis.hs b/compiler/GHC/Stg/Lift/Analysis.hs
index ccbad372100e9f4a3afefd935f17f74d5e28f835..881d0340a56e404098391a145ddc3898d81c24ab 100644
--- a/compiler/GHC/Stg/Lift/Analysis.hs
+++ b/compiler/GHC/Stg/Lift/Analysis.hs
@@ -26,7 +26,7 @@ import BasicTypes
 import Demand
 import DynFlags
 import Id
-import GHC.Runtime.Layout ( WordOff )
+import GHC.Runtime.Heap.Layout ( WordOff )
 import GHC.Stg.Syntax
 import qualified GHC.StgToCmm.ArgRep  as StgToCmm.ArgRep
 import qualified GHC.StgToCmm.Closure as StgToCmm.Closure
diff --git a/compiler/GHC/StgToCmm/ArgRep.hs b/compiler/GHC/StgToCmm/ArgRep.hs
index 347d908b4498524ec16adcc12c507eccc12e74a6..436b37fced8cf30932616995f2af64a977230157 100644
--- a/compiler/GHC/StgToCmm/ArgRep.hs
+++ b/compiler/GHC/StgToCmm/ArgRep.hs
@@ -19,7 +19,7 @@ import GhcPrelude
 
 import GHC.StgToCmm.Closure ( idPrimRep )
 
-import GHC.Runtime.Layout            ( WordOff )
+import GHC.Runtime.Heap.Layout            ( WordOff )
 import Id               ( Id )
 import TyCon            ( PrimRep(..), primElemRepSizeB )
 import BasicTypes       ( RepArity )
diff --git a/compiler/GHC/StgToCmm/Bind.hs b/compiler/GHC/StgToCmm/Bind.hs
index 977fa4649ecf02e5954a3f1f6bc0cb051fbb7648..089fec789ca87c731b91c374b27a766a999f41b3 100644
--- a/compiler/GHC/StgToCmm/Bind.hs
+++ b/compiler/GHC/StgToCmm/Bind.hs
@@ -31,7 +31,7 @@ import GHC.StgToCmm.Foreign    (emitPrimCall)
 import GHC.Cmm.Graph
 import CoreSyn          ( AltCon(..), tickishIsCode )
 import GHC.Cmm.BlockId
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import GHC.Cmm
 import GHC.Cmm.Info
 import GHC.Cmm.Utils
diff --git a/compiler/GHC/StgToCmm/Closure.hs b/compiler/GHC/StgToCmm/Closure.hs
index 724ca6000a009f615c0d343dff705f48a126f230..b171e7a1fb446dd0a545d91767bd9fbe38a4f12a 100644
--- a/compiler/GHC/StgToCmm/Closure.hs
+++ b/compiler/GHC/StgToCmm/Closure.hs
@@ -67,7 +67,7 @@ module GHC.StgToCmm.Closure (
 import GhcPrelude
 
 import GHC.Stg.Syntax
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import GHC.Cmm
 import GHC.Cmm.Ppr.Expr() -- For Outputable instances
 
diff --git a/compiler/GHC/StgToCmm/DataCon.hs b/compiler/GHC/StgToCmm/DataCon.hs
index 7d866207080e72095d9657baf5d3198c49c69380..eb7f9223d7de75cfa2b0314cc2047843f72d82bb 100644
--- a/compiler/GHC/StgToCmm/DataCon.hs
+++ b/compiler/GHC/StgToCmm/DataCon.hs
@@ -33,7 +33,7 @@ import GHC.Cmm.Expr
 import GHC.Cmm.Utils
 import GHC.Cmm.CLabel
 import GHC.Cmm.Graph
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import CostCentre
 import Module
 import DataCon
diff --git a/compiler/GHC/StgToCmm/Expr.hs b/compiler/GHC/StgToCmm/Expr.hs
index 1befdd7d3af6aa7ee9179c406fb76ef9a677c51a..95c8f7defbf76e04744ecc8e9b30d97707445d07 100644
--- a/compiler/GHC/StgToCmm/Expr.hs
+++ b/compiler/GHC/StgToCmm/Expr.hs
@@ -354,7 +354,7 @@ We want to generate an assignment
      y := x
 We want to allow this assignment to be generated in the case when the
 types are compatible, because this allows some slightly-dodgy but
-occasionally-useful casts to be used, such as in RtClosureInspect
+occasionally-useful casts to be used, such as in GHC.Runtime.Heap.Inspect
 where we cast an HValue to a MutVar# so we can print out the contents
 of the MutVar#.  If instead we generate code that enters the HValue,
 then we'll get a runtime panic, because the HValue really is a
diff --git a/compiler/GHC/StgToCmm/Foreign.hs b/compiler/GHC/StgToCmm/Foreign.hs
index 62a948d13cdd6aa90bc731ce084a99e1d3ff49f0..b2302a175a244b70cb6c315b55a4d2262c5468b3 100644
--- a/compiler/GHC/StgToCmm/Foreign.hs
+++ b/compiler/GHC/StgToCmm/Foreign.hs
@@ -35,7 +35,7 @@ import GHC.Cmm.Graph
 import Type
 import GHC.Types.RepType
 import GHC.Cmm.CLabel
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import ForeignCall
 import DynFlags
 import Maybes
diff --git a/compiler/GHC/StgToCmm/Heap.hs b/compiler/GHC/StgToCmm/Heap.hs
index 085d47219f72c2615f3a93881faa885e839559ff..0656cb2a089e5012490eea81d107c8909f51cc6d 100644
--- a/compiler/GHC/StgToCmm/Heap.hs
+++ b/compiler/GHC/StgToCmm/Heap.hs
@@ -37,7 +37,7 @@ import GHC.StgToCmm.Env
 import GHC.Cmm.Graph
 
 import GHC.Cmm.Dataflow.Label
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import GHC.Cmm.BlockId
 import GHC.Cmm
 import GHC.Cmm.Utils
diff --git a/compiler/GHC/StgToCmm/Layout.hs b/compiler/GHC/StgToCmm/Layout.hs
index e78221de3aa615e717cedf11b8977a196b97a349..9139c36f0b51a90a537959940229afb252c88925 100644
--- a/compiler/GHC/StgToCmm/Layout.hs
+++ b/compiler/GHC/StgToCmm/Layout.hs
@@ -42,7 +42,7 @@ import GHC.StgToCmm.Monad
 import GHC.StgToCmm.Utils
 
 import GHC.Cmm.Graph
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import GHC.Cmm.BlockId
 import GHC.Cmm
 import GHC.Cmm.Utils
diff --git a/compiler/GHC/StgToCmm/Monad.hs b/compiler/GHC/StgToCmm/Monad.hs
index 4f7d2e122088154fb38947811a87d4979a6aeef3..34709f3d677ccea3f3a0052b6eb315eb4d618f86 100644
--- a/compiler/GHC/StgToCmm/Monad.hs
+++ b/compiler/GHC/StgToCmm/Monad.hs
@@ -68,7 +68,7 @@ import GHC.Cmm.Dataflow.Collections
 import GHC.Cmm.Graph as CmmGraph
 import GHC.Cmm.BlockId
 import GHC.Cmm.CLabel
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import Module
 import Id
 import VarEnv
diff --git a/compiler/GHC/StgToCmm/Prim.hs b/compiler/GHC/StgToCmm/Prim.hs
index 6c5a836d7b2d66881dc989442f866b91e7053fb9..63cb5a532fab8ef156799c17b21d767a25193fb6 100644
--- a/compiler/GHC/StgToCmm/Prim.hs
+++ b/compiler/GHC/StgToCmm/Prim.hs
@@ -48,7 +48,7 @@ import TyCon
 import GHC.Cmm.CLabel
 import GHC.Cmm.Utils
 import PrimOp
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import FastString
 import Outputable
 import Util
diff --git a/compiler/GHC/StgToCmm/Prof.hs b/compiler/GHC/StgToCmm/Prof.hs
index 581e8279dcf097cd3de96ed1006cfce62e26b845..068b76807316e97f0401c5833b1ac2d90336881e 100644
--- a/compiler/GHC/StgToCmm/Prof.hs
+++ b/compiler/GHC/StgToCmm/Prof.hs
@@ -28,7 +28,7 @@ import GhcPrelude
 import GHC.StgToCmm.Closure
 import GHC.StgToCmm.Utils
 import GHC.StgToCmm.Monad
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 
 import GHC.Cmm.Graph
 import GHC.Cmm
diff --git a/compiler/GHC/StgToCmm/Ticky.hs b/compiler/GHC/StgToCmm/Ticky.hs
index fbb121dae656c54692ef1997818288adb56db389..22f91518f3acb1522aa8e8f54f0422fd0cb80e8f 100644
--- a/compiler/GHC/StgToCmm/Ticky.hs
+++ b/compiler/GHC/StgToCmm/Ticky.hs
@@ -116,7 +116,7 @@ import GHC.Cmm.Expr
 import GHC.Cmm.Graph
 import GHC.Cmm.Utils
 import GHC.Cmm.CLabel
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 
 import Module
 import Name
diff --git a/compiler/GHC/StgToCmm/Utils.hs b/compiler/GHC/StgToCmm/Utils.hs
index 373beeed0718e0db4b386b6b632e271d7ef954ce..3611a64f75acd4d44e089ed691f6d421ca60c57f 100644
--- a/compiler/GHC/StgToCmm/Utils.hs
+++ b/compiler/GHC/StgToCmm/Utils.hs
@@ -66,7 +66,7 @@ import ForeignCall
 import IdInfo
 import Type
 import TyCon
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import Module
 import Literal
 import Digraph
diff --git a/compiler/basicTypes/Literal.hs b/compiler/basicTypes/Literal.hs
index 526115d5efd6ed36ad9a19788148c53b86eecd6a..8e4d82a0f33875db9340b872e1d181cacde730fb 100644
--- a/compiler/basicTypes/Literal.hs
+++ b/compiler/basicTypes/Literal.hs
@@ -846,6 +846,6 @@ Here are the moving parts:
   it in the code generators, but it seems simpler to do it
   once and for all in CoreToSTG.
 
-  In ByteCodeAsm we just lower it as a 0 literal, because
+  In GHC.ByteCode.Asm we just lower it as a 0 literal, because
   it's all boxed and lifted to the host GC anyway.
 -}
diff --git a/compiler/ghci/keepCAFsForGHCi.c b/compiler/cbits/keepCAFsForGHCi.c
similarity index 100%
rename from compiler/ghci/keepCAFsForGHCi.c
rename to compiler/cbits/keepCAFsForGHCi.c
diff --git a/compiler/deSugar/Coverage.hs b/compiler/deSugar/Coverage.hs
index 0092e991ef733b384977d5d6ec56b07b35b14d76..3e124b58294f98d080a52f7182d9da8bbf49c493 100644
--- a/compiler/deSugar/Coverage.hs
+++ b/compiler/deSugar/Coverage.hs
@@ -14,10 +14,10 @@ module Coverage (addTicksToBinds, hpcInitCode) where
 
 import GhcPrelude as Prelude
 
-import qualified GHCi
+import qualified GHC.Runtime.Interpreter as GHCi
 import GHCi.RemoteTypes
 import Data.Array
-import ByteCodeTypes
+import GHC.ByteCode.Types
 import GHC.Stack.CCS
 import Type
 import GHC.Hs
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index c96597340393b0ddbef9643a0837b888a16075af..84a912998fca454ec803923104423ca147ddc2c1 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -156,7 +156,7 @@ Library
     c-sources:
         cbits/cutils.c
         cbits/genSym.c
-        ghci/keepCAFsForGHCi.c
+        cbits/keepCAFsForGHCi.c
 
     hs-source-dirs:
         .
@@ -165,7 +165,6 @@ Library
         cmm
         coreSyn
         deSugar
-        ghci
         iface
         llvmGen
         main
@@ -304,7 +303,7 @@ Library
         GHC.StgToCmm.Ticky
         GHC.StgToCmm.Utils
         GHC.StgToCmm.ExtCode
-        GHC.Runtime.Layout
+        GHC.Runtime.Heap.Layout
         CoreArity
         CoreFVs
         CoreLint
@@ -380,13 +379,13 @@ Library
         GhcMake
         GhcPlugins
         GhcPrelude
-        DynamicLoading
         HeaderInfo
         HscMain
         HscStats
         HscTypes
-        InteractiveEval
-        InteractiveEvalTypes
+        GHC.Runtime.Eval
+        GHC.Runtime.Eval.Types
+        GHC.Runtime.Loader
         UnitInfo
         Packages
         PlatformConstants
@@ -650,14 +649,14 @@ Library
             Dwarf.Types
             Dwarf.Constants
             GHC.ThToHs
-            ByteCodeTypes
-            ByteCodeAsm
-            ByteCodeGen
-            ByteCodeInstr
-            ByteCodeItbls
-            ByteCodeLink
-            Debugger
-            LinkerTypes
-            Linker
-            RtClosureInspect
-            GHCi
+            GHC.ByteCode.Types
+            GHC.ByteCode.Asm
+            GHC.ByteCode.Instr
+            GHC.ByteCode.InfoTable
+            GHC.ByteCode.Linker
+            GHC.CoreToByteCode
+            GHC.Runtime.Debugger
+            GHC.Runtime.Linker.Types
+            GHC.Runtime.Linker
+            GHC.Runtime.Heap.Inspect
+            GHC.Runtime.Interpreter
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 1ca0f0bb17775a582e669f551fa9eee46bb0bd29..2276559cd69f2066b61790337622566074c42fb8 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -1106,7 +1106,7 @@ data DynFlags = DynFlags {
     -- loaded here is directed by pluginModNames. Arguments are loaded from
     -- pluginModNameOpts. The purpose of this field is to cache the plugins so
     -- they don't have to be loaded each time they are needed.  See
-    -- 'DynamicLoading.initializePlugins'.
+    -- 'GHC.Runtime.Loader.initializePlugins'.
   staticPlugins            :: [StaticPlugin],
     -- ^ static plugins which do not need dynamic loading. These plugins are
     -- intended to be added by GHC API users directly to this list.
diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs
index 1510947e7bfeea8d8c5aff89a40be269a1cef947..49017611ce259a0d18db081d1f82313d60d49a00 100644
--- a/compiler/main/GHC.hs
+++ b/compiler/main/GHC.hs
@@ -132,7 +132,7 @@ module GHC (
 
         -- ** Compiling expressions
         HValue, parseExpr, compileParsedExpr,
-        InteractiveEval.compileExpr, dynCompileExpr,
+        GHC.Runtime.Eval.compileExpr, dynCompileExpr,
         ForeignHValue,
         compileExprRemote, compileParsedExprRemote,
 
@@ -154,8 +154,8 @@ module GHC (
         modInfoModBreaks,
         ModBreaks(..), BreakIndex,
         BreakInfo(breakInfo_number, breakInfo_module),
-        InteractiveEval.back,
-        InteractiveEval.forward,
+        GHC.Runtime.Eval.back,
+        GHC.Runtime.Eval.forward,
 
         -- * Abstract syntax elements
 
@@ -295,10 +295,10 @@ module GHC (
 
 import GhcPrelude hiding (init)
 
-import ByteCodeTypes
-import InteractiveEval
-import InteractiveEvalTypes
-import GHCi
+import GHC.ByteCode.Types
+import GHC.Runtime.Eval
+import GHC.Runtime.Eval.Types
+import GHC.Runtime.Interpreter
 import GHCi.RemoteTypes
 
 import PprTyThing       ( pprFamInst )
@@ -1526,15 +1526,15 @@ getGHCiMonad = fmap (ic_monad . hsc_IC) getSession
 
 getHistorySpan :: GhcMonad m => History -> m SrcSpan
 getHistorySpan h = withSession $ \hsc_env ->
-    return $ InteractiveEval.getHistorySpan hsc_env h
+    return $ GHC.Runtime.Eval.getHistorySpan hsc_env h
 
 obtainTermFromVal :: GhcMonad m => Int ->  Bool -> Type -> a -> m Term
 obtainTermFromVal bound force ty a = withSession $ \hsc_env ->
-    liftIO $ InteractiveEval.obtainTermFromVal hsc_env bound force ty a
+    liftIO $ GHC.Runtime.Eval.obtainTermFromVal hsc_env bound force ty a
 
 obtainTermFromId :: GhcMonad m => Int -> Bool -> Id -> m Term
 obtainTermFromId bound force id = withSession $ \hsc_env ->
-    liftIO $ InteractiveEval.obtainTermFromId hsc_env bound force id
+    liftIO $ GHC.Runtime.Eval.obtainTermFromId hsc_env bound force id
 
 
 -- | Returns the 'TyThing' for a 'Name'.  The 'Name' may refer to any
diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs
index 0f1e5cdc4bcbd87e09f20a7d20608beb1d978e6e..2a597a205db99ac54a5cbc84131b8da2601bcb2e 100644
--- a/compiler/main/GhcMake.hs
+++ b/compiler/main/GhcMake.hs
@@ -35,7 +35,7 @@ module GhcMake(
 
 import GhcPrelude
 
-import qualified Linker         ( unload )
+import qualified GHC.Runtime.Linker as Linker
 
 import DriverPhases
 import DriverPipeline
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index 8ce49e4aab62af5d73ee7f07d748dc8585c506c7..8e7a9db87a149017a2979a37c4aca81bd7636503 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -89,10 +89,10 @@ import GhcPrelude
 import Data.Data hiding (Fixity, TyCon)
 import Data.Maybe       ( fromJust )
 import Id
-import GHCi             ( addSptEntry )
+import GHC.Runtime.Interpreter ( addSptEntry )
 import GHCi.RemoteTypes ( ForeignHValue )
-import ByteCodeGen      ( byteCodeGen, coreExprToBCOs )
-import Linker
+import GHC.CoreToByteCode ( byteCodeGen, coreExprToBCOs )
+import GHC.Runtime.Linker
 import CoreTidy         ( tidyExpr )
 import Type             ( Type )
 import {- Kind parts of -} Type         ( Kind )
@@ -147,7 +147,7 @@ import Hooks
 import TcEnv
 import PrelNames
 import Plugins
-import DynamicLoading   ( initializePlugins )
+import GHC.Runtime.Loader   ( initializePlugins )
 
 import DynFlags
 import ErrUtils
diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs
index b43c41db2a07abc0e7916ff03520faa1fd5545b8..33f827e2c6c55ddcc57c5a3870feeeb0df4ff757 100644
--- a/compiler/main/HscTypes.hs
+++ b/compiler/main/HscTypes.hs
@@ -155,8 +155,8 @@ module HscTypes (
 
 import GhcPrelude
 
-import ByteCodeTypes
-import InteractiveEvalTypes ( Resume )
+import GHC.ByteCode.Types
+import GHC.Runtime.Eval.Types ( Resume )
 import GHCi.Message         ( Pipe )
 import GHCi.RemoteTypes
 import GHC.ForeignSrcLang
@@ -190,7 +190,7 @@ import TysWiredIn
 import Packages hiding  ( Version(..) )
 import CmdLineParser
 import DynFlags
-import LinkerTypes      ( DynLinker, Linkable(..), Unlinked(..), SptEntry(..) )
+import GHC.Runtime.Linker.Types      ( DynLinker, Linkable(..), Unlinked(..), SptEntry(..) )
 import DriverPhases     ( Phase, HscSource(..), hscSourceString
                         , isHsBootOrSig, isHsigFile )
 import qualified DriverPhases as Phase
@@ -1680,7 +1680,7 @@ data InteractiveContext
 
          ic_rn_gbl_env :: GlobalRdrEnv,
              -- ^ The cached 'GlobalRdrEnv', built by
-             -- 'InteractiveEval.setContext' and updated regularly
+             -- 'GHC.Runtime.Eval.setContext' and updated regularly
              -- It contains everything in scope at the command line,
              -- including everything in ic_tythings
 
diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs
index b8fb162432b277126c544101310ed5b2782eaaf7..026631df37c8dc08ea319cdded05f3ecea46d9bb 100644
--- a/compiler/simplCore/SimplCore.hs
+++ b/compiler/simplCore/SimplCore.hs
@@ -52,7 +52,7 @@ import SrcLoc
 import Util
 import Module
 import Plugins          ( withPlugins, installCoreToDos )
-import DynamicLoading  -- ( initializePlugins )
+import GHC.Runtime.Loader  -- ( initializePlugins )
 
 import UniqSupply       ( UniqSupply, mkSplitUniqSupply, splitUniqSupply )
 import UniqFM
diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs
index 9557efa40caba4c90f5676dbb516e59d3257f703..3fd70d0a2bc3eba10e835bda1bcf0029b3a001b3 100644
--- a/compiler/typecheck/TcErrors.hs
+++ b/compiler/typecheck/TcErrors.hs
@@ -2946,7 +2946,7 @@ Note [Runtime skolems]
 ~~~~~~~~~~~~~~~~~~~~~~
 We want to give a reasonably helpful error message for ambiguity
 arising from *runtime* skolems in the debugger.  These
-are created by in RtClosureInspect.zonkRTTIType.
+are created by in GHC.Runtime.Heap.Inspect.zonkRTTIType.
 
 ************************************************************************
 *                                                                      *
diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs
index 566db1c1dfae4389204f9c05fb48c576a150e915..485948a5a31ffd6ba79e9f8839bbb9466d0a6152 100644
--- a/compiler/typecheck/TcSplice.hs
+++ b/compiler/typecheck/TcSplice.hs
@@ -57,7 +57,7 @@ import Control.Monad
 
 import GHCi.Message
 import GHCi.RemoteTypes
-import GHCi
+import GHC.Runtime.Interpreter
 import HscMain
         -- These imports are the reason that TcSplice
         -- is very high up the module hierarchy
diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs
index 4cec96a847a6c731df661338c9b87949e96f6299..ac3820884ea482009e83562c86b2b2fd14f7fbdb 100644
--- a/compiler/typecheck/TcType.hs
+++ b/compiler/typecheck/TcType.hs
@@ -1025,7 +1025,7 @@ isMetaTyVar tv
 -- isAmbiguousTyVar is used only when reporting type errors
 -- It picks out variables that are unbound, namely meta
 -- type variables and the RuntimUnk variables created by
--- RtClosureInspect.zonkRTTIType.  These are "ambiguous" in
+-- GHC.Runtime.Heap.Inspect.zonkRTTIType.  These are "ambiguous" in
 -- the sense that they stand for an as-yet-unknown type
 isAmbiguousTyVar tv
   | isTyVar tv -- See Note [Coercion variables in free variable lists]
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index f49c1834d3efd221d0465f94f7ebcce8672f7a4d..6bca4e8dbad7a8b461a29ea071448a9e39f5589c 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -33,10 +33,10 @@ import qualified GHCi.UI.Monad as GhciMonad ( args, runStmt, runDecls' )
 import GHCi.UI.Monad hiding ( args, runStmt )
 import GHCi.UI.Tags
 import GHCi.UI.Info
-import Debugger
+import GHC.Runtime.Debugger
 
 -- The GHC interface
-import GHCi
+import GHC.Runtime.Interpreter
 import GHCi.RemoteTypes
 import GHCi.BreakArray
 import DynFlags
@@ -68,7 +68,7 @@ import qualified Lexer
 import StringBuffer
 import Outputable hiding ( printForUser, printForUserPartWay )
 
-import DynamicLoading ( initializePlugins )
+import GHC.Runtime.Loader ( initializePlugins )
 
 -- Other random utilities
 import BasicTypes hiding ( isTopLevel )
@@ -76,7 +76,7 @@ import Config
 import Digraph
 import Encoding
 import FastString
-import Linker
+import GHC.Runtime.Linker
 import Maybes ( orElse, expectJust )
 import NameSet
 import Panic hiding ( showException )
@@ -3153,7 +3153,7 @@ ticket contains an analysis of the situation and suggests the solution
 implemented above.
 
 The same filter was also implemented to fix #11051 [3]. See the
-Note [What to show to users] in compiler/main/InteractiveEval.hs
+Note [What to show to users] in GHC.Runtime.Eval
 
 [1] https://gitlab.haskell.org/ghc/ghc/issues/12525
 [2] https://gitlab.haskell.org/ghc/ghc/issues/12525#note_123489
diff --git a/ghc/GHCi/UI/Monad.hs b/ghc/GHCi/UI/Monad.hs
index 63356d6418aa9201162319ff8ccb0186cc95f7d1..6bd584bbe6cd6306c7731d745358775531d90d72 100644
--- a/ghc/GHCi/UI/Monad.hs
+++ b/ghc/GHCi/UI/Monad.hs
@@ -48,7 +48,7 @@ import SrcLoc
 import Module
 import RdrName (mkOrig)
 import PrelNames (gHC_GHCI_HELPERS)
-import GHCi
+import GHC.Runtime.Interpreter
 import GHCi.RemoteTypes
 import GHC.Hs (ImportDecl, GhcPs, GhciLStmt, LHsDecl)
 import GHC.Hs.Utils
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 6514a003458acab0c0c1fa520c25798f374ef0a2..c30109d5aa201b1545691ed48f7267498e5bb500 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -33,10 +33,10 @@ import GHCi.UI          ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings )
 #endif
 
 -- Frontend plugins
-import DynamicLoading   ( loadFrontendPlugin )
+import GHC.Runtime.Loader   ( loadFrontendPlugin )
 import Plugins
 #if defined(HAVE_INTERNAL_INTERPRETER)
-import DynamicLoading   ( initializePlugins )
+import GHC.Runtime.Loader   ( initializePlugins )
 #endif
 import Module           ( ModuleName )
 
diff --git a/includes/rts/Bytecodes.h b/includes/rts/Bytecodes.h
index e5d55f694fbce9f588723bdaf189b4b306fab390..f7a0d6f151c727c39f21dfe48bbf9f095d988945 100644
--- a/includes/rts/Bytecodes.h
+++ b/includes/rts/Bytecodes.h
@@ -17,7 +17,7 @@
 
 /* NOTE:
 
-   THIS FILE IS INCLUDED IN HASKELL SOURCES (ghc/compiler/ghci/ByteCodeAsm.hs).
+   THIS FILE IS INCLUDED IN HASKELL SOURCES (ghc/compiler/GHC/ByteCode/Asm.hs).
    DO NOT PUT C-SPECIFIC STUFF IN HERE!
 
    I hope that's clear :-)
diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h
index 0843b95b37e2e360f37527884fdfddf2d61b06e9..e69e28ecaf89a8dd7c04ce4a068afc11a8b8bbec 100644
--- a/includes/stg/MiscClosures.h
+++ b/includes/stg/MiscClosures.h
@@ -72,7 +72,7 @@ RTS_RET(stg_restore_cccs_eval);
 // RTS_FUN(stg_interp_constr6_entry);
 // RTS_FUN(stg_interp_constr7_entry);
 //
-// This is referenced using the FFI in the compiler (ByteCodeItbls),
+// This is referenced using the FFI in the compiler (GHC.ByteCode.InfoTable),
 // so we can't give it the correct type here because the prototypes
 // would clash (FFI references are always declared with type StgWord[]
 // in the generated C code).
diff --git a/libraries/ghc-heap/GHC/Exts/Heap.hs b/libraries/ghc-heap/GHC/Exts/Heap.hs
index 4865dd60c91b2a43eb3739063ba76ea5aae7a6d7..c1f2376729a2ecc2f88513f6607474281cfd754b 100644
--- a/libraries/ghc-heap/GHC/Exts/Heap.hs
+++ b/libraries/ghc-heap/GHC/Exts/Heap.hs
@@ -122,7 +122,7 @@ getClosureRaw x = do
                 ptrList = amap' Box $ Array 0 (pelems - 1) pelems pointers
             pure (Ptr iptr, rawWds, ptrList)
 
--- From compiler/ghci/RtClosureInspect.hs
+-- From GHC.Runtime.Heap.Inspect
 amap' :: (t -> b) -> Array Int t -> [b]
 amap' f (Array i0 i _ arr#) = map g [0 .. i - i0]
     where g (I# i#) = case indexArray# arr# i# of
@@ -145,7 +145,7 @@ getClosure x = do
     case tipe itbl of
         t | t >= CONSTR && t <= CONSTR_NOCAF -> do
             (p, m, n) <- dataConNames iptr
-            if m == "ByteCodeInstr" && n == "BreakInfo"
+            if m == "GHC.ByteCode.Instr" && n == "BreakInfo"
               then pure $ UnsupportedClosure itbl
               else pure $ ConstrClosure itbl pts npts p m n
 
diff --git a/libraries/ghci/GHCi/BreakArray.hs b/libraries/ghci/GHCi/BreakArray.hs
index 8ab813a5a76a8bebd8d79ea78e09ccba760c93d9..a0f9d03bdcfd082b527b96e95381da37937746c5 100644
--- a/libraries/ghci/GHCi/BreakArray.hs
+++ b/libraries/ghci/GHCi/BreakArray.hs
@@ -19,7 +19,7 @@
 module GHCi.BreakArray
     (
       BreakArray
-          (BA) -- constructor is exported only for ByteCodeGen
+          (BA) -- constructor is exported only for GHC.CoreToByteCode
     , newBreakArray
     , getBreak
     , setBreakOn
diff --git a/libraries/integer-gmp/src/GHC/Integer/Type.hs b/libraries/integer-gmp/src/GHC/Integer/Type.hs
index 44a2964895c269c2038503f4796d0a009730fac6..cc9408982843a615bda81d1a47df64832dc2122c 100644
--- a/libraries/integer-gmp/src/GHC/Integer/Type.hs
+++ b/libraries/integer-gmp/src/GHC/Integer/Type.hs
@@ -159,7 +159,7 @@ data Integer  = S#                !Int#
                 -- ^ iff value in @]-inf, minBound::'Int'[@ range
 
 -- NOTE: the above representation is baked into the GHCi debugger in
--- compiler/ghci/RtClosureInspect.hs. If you change it here, fixes
+-- GHC.Runtime.Heap.Inspect. If you change it here, fixes
 -- will be required over there too. Tests for this are in
 -- testsuite/tests/ghci.debugger.
 
diff --git a/rts/Disassembler.c b/rts/Disassembler.c
index 01d6c3b1d94d9e481139e80ba97db935d1a60bfc..d5593c8a0742f4e8e28544b585a4da0f988807a0 100644
--- a/rts/Disassembler.c
+++ b/rts/Disassembler.c
@@ -324,7 +324,7 @@ disInstr ( StgBCO *bco, int pc )
 /* Something of a kludge .. how do we know where the end of the insn
    array is, since it isn't recorded anywhere?  Answer: the first
    short is the number of bytecodes which follow it.
-   See ByteCodeGen.linkBCO.insns_arr for construction ...
+   See GHC.CoreToByteCode.linkBCO.insns_arr for construction ...
 */
 void disassemble( StgBCO *bco )
 {
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index 78a958d5ec6645cd4a1b50bb1f420755021f6dc5..e1f6fab93a30583fae5caa6a9466cf4fb772b1ea 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -2109,7 +2109,7 @@ stg_mkApUpd0zh ( P_ bco )
     W_ ap;
 
     // This function is *only* used to wrap zero-arity BCOs in an
-    // updatable wrapper (see ByteCodeLink.hs).  An AP thunk is always
+    // updatable wrapper (see GHC.ByteCode.Linker).  An AP thunk is always
     // saturated and always points directly to a FUN or BCO.
     ASSERT(%INFO_TYPE(%GET_STD_INFO(bco)) == HALF_W_(BCO) &&
            StgBCO_arity(bco) == HALF_W_(0));
diff --git a/testsuite/tests/codeGen/should_run/T13825-unit.hs b/testsuite/tests/codeGen/should_run/T13825-unit.hs
index 85777bfe72f6a1954f3276ab299f8ed863cd578e..1c8d6e2155723d964bd4e5d20fb773e6a7a400a5 100644
--- a/testsuite/tests/codeGen/should_run/T13825-unit.hs
+++ b/testsuite/tests/codeGen/should_run/T13825-unit.hs
@@ -2,7 +2,7 @@ module Main where
 
 import DynFlags
 import GHC.Types.RepType
-import GHC.Runtime.Layout
+import GHC.Runtime.Heap.Layout
 import GHC.StgToCmm.Layout
 import GHC.StgToCmm.Closure
 import GHC
diff --git a/testsuite/tests/ghc-api/T4891/T4891.hs b/testsuite/tests/ghc-api/T4891/T4891.hs
index 62edae0e789f3bf02461c873a74f61eab2c48216..feb792862b388ceaabe85273899d93d10d889c47 100644
--- a/testsuite/tests/ghc-api/T4891/T4891.hs
+++ b/testsuite/tests/ghc-api/T4891/T4891.hs
@@ -1,15 +1,15 @@
 {-# LANGUAGE BangPatterns #-}
 module Main where
 
-import ByteCodeLink
+import GHC.ByteCode.Linker
 import CoreMonad
 import Data.Array
 import DataCon
 import GHC
 import GHC.Exts.Heap
 import HscTypes
-import Linker
-import RtClosureInspect
+import GHC.Runtime.Linker
+import GHC.Runtime.Heap.Inspect
 import TcEnv
 import Type
 import TcRnMonad
diff --git a/testsuite/tests/ghci/should_run/ghcirun004.hs b/testsuite/tests/ghci/should_run/ghcirun004.hs
index f3e309527559acc58a65e70cf805eff3288f1654..1a1c47442708987791ac5a3350afb3cbd55d47d4 100644
--- a/testsuite/tests/ghci/should_run/ghcirun004.hs
+++ b/testsuite/tests/ghci/should_run/ghcirun004.hs
@@ -1,5 +1,5 @@
 -- crashes in 7.2.1 and earlier, due to bogus calculations of label
--- offsets in ByteCodeAsm for a BCO with large instructions.
+-- offsets in GHC.ByteCode.Asm for a BCO with large instructions.
 
 main = print (map foo [1,50..5000] )
 
diff --git a/testsuite/tests/rts/linker/LinkerUnload.hs b/testsuite/tests/rts/linker/LinkerUnload.hs
index 9d6b2432560a121641362bf99c31dd764065ed03..d26fae57ea8d23cfbdf67ed5fa5156a79f57af6c 100644
--- a/testsuite/tests/rts/linker/LinkerUnload.hs
+++ b/testsuite/tests/rts/linker/LinkerUnload.hs
@@ -2,7 +2,7 @@ module LinkerUnload (init) where
 
 import GHC
 import DynFlags
-import Linker
+import GHC.Runtime.Linker as Linker
 import System.Environment
 import MonadUtils ( MonadIO(..) )
 
diff --git a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr
index 30d756f05857cf4b412ca49f8467e1abae9715b4..3ec6cb6ca536afd0b70ae83e94c97c1111f57a88 100644
--- a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr
+++ b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr
@@ -12,7 +12,7 @@ This could be caused by:
 ghc-stage2: ^^ Could not load 'c', dependency unresolved. See top entry above.
 
 
-ByteCodeLink: can't find label
+GHC.ByteCode.Linker: can't find label
 During interactive linking, GHCi couldn't find the following symbol:
   c
 This may be due to you not asking GHCi to load extra object files,
diff --git a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32 b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32
index 1b32baf67e4f6ea9ef9180c9d4a21c3359834ee5..5304e84a3792c2cceba4276fadf2cc61b9677c8c 100644
--- a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32
+++ b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32
@@ -12,7 +12,7 @@ This could be caused by:
 ghc-stage2.exe: ^^ Could not load '_c', dependency unresolved. See top entry above.
 
 
-ByteCodeLink: can't find label
+GHC.ByteCode.Linker: can't find label
 During interactive linking, GHCi couldn't find the following symbol:
   c
 This may be due to you not asking GHCi to load extra object files,
diff --git a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32 b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32
index d38e1c00ec8708e75ebe98c67ce80581c62a5d0e..5396070515feeb18c63d810b2cffcf0e4a69c963 100644
--- a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32
+++ b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32
@@ -12,7 +12,7 @@ This could be caused by:
 ghc-stage2.exe: ^^ Could not load 'c', dependency unresolved. See top entry above.
 
 
-ByteCodeLink: can't find label
+GHC.ByteCode.Linker: can't find label
 During interactive linking, GHCi couldn't find the following symbol:
   c
 This may be due to you not asking GHCi to load extra object files,
diff --git a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr
index 0f54eab090d87cad0620dcf7781d99217e5e037b..b5d1872a8d995c82a00c6126841c15209f58d79e 100644
--- a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr
+++ b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr
@@ -12,7 +12,7 @@ This could be caused by:
 ghc-stage2: ^^ Could not load 'c', dependency unresolved. See top entry above.
 
 
-ByteCodeLink: can't find label
+GHC.ByteCode.Linker: can't find label
 During interactive linking, GHCi couldn't find the following symbol:
   c
 This may be due to you not asking GHCi to load extra object files,
diff --git a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32 b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32
index 6226dda848d84d55a9e1006badab5850b32c0925..fcf9f6cbd985c500de7fd4a5fe1045a7ae834322 100644
--- a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32
+++ b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32
@@ -12,7 +12,7 @@ This could be caused by:
 ghc-stage2.exe: ^^ Could not load '_c', dependency unresolved. See top entry above.
 
 
-ByteCodeLink: can't find label
+GHC.ByteCode.Linker: can't find label
 During interactive linking, GHCi couldn't find the following symbol:
   c
 This may be due to you not asking GHCi to load extra object files,
diff --git a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw32 b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw32
index 5b9103e60661286a50b465bfcef386a5be680a99..84742a8271ceb8f14aa677c476fe3e68c4bcbe03 100644
--- a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw32
+++ b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw32
@@ -12,7 +12,7 @@ This could be caused by:
 ghc-stage2.exe: ^^ Could not load 'c', dependency unresolved. See top entry above.
 
 
-ByteCodeLink: can't find label
+GHC.ByteCode.Linker: can't find label
 During interactive linking, GHCi couldn't find the following symbol:
   c
 This may be due to you not asking GHCi to load extra object files,
diff --git a/utils/haddock b/utils/haddock
index e7a650a94dbc118c423e684b27203a52baf34ff5..d838d08f0ac0173dc704d51191b1c1976964b6f1 160000
--- a/utils/haddock
+++ b/utils/haddock
@@ -1 +1 @@
-Subproject commit e7a650a94dbc118c423e684b27203a52baf34ff5
+Subproject commit d838d08f0ac0173dc704d51191b1c1976964b6f1