ghc-lib-parser-9.8.1.20231009: The GHC API, decoupled from GHC versions
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Linker.Types

Synopsis

Documentation

newtype Loader #

Constructors

Loader 

Fields

data LoaderState #

Constructors

LoaderState 

Fields

data LinkerEnv #

Constructors

LinkerEnv 

Fields

  • closure_env :: !ClosureEnv

    Current global mapping from closure Names to their true values

  • itbl_env :: !ItblEnv

    The current global mapping from RdrNames of DataCons to info table addresses. When a new Unlinked is linked into the running image, or an existing module in the image is replaced, the itbl_env must be updated appropriately.

  • addr_env :: !AddrEnv

    Like closure_env and itbl_env, but for top-level 'Addr#' literals, see Note [Generating code for top-level string literal bindings] in GHC.StgToByteCode.

data Linkable #

Information we can use to dynamically link modules into the compiler

Constructors

LM 

Fields

  • linkableTime :: !UTCTime

    Time at which this linkable was built (i.e. when the bytecodes were produced, or the mod date on the files)

  • linkableModule :: !Module

    The linkable module itself

  • linkableUnlinked :: [Unlinked]

    Those files and chunks of code we have yet to link.

    INVARIANT: A valid linkable always has at least one Unlinked item.

Instances

Instances details
Outputable Linkable # 
Instance details

Defined in GHC.Linker.Types

Methods

ppr :: Linkable -> SDoc #

data Unlinked #

Objects which have yet to be linked by the compiler

Constructors

DotO ObjFile

An object file (.o)

DotA FilePath

Static archive file (.a)

DotDLL FilePath

Dynamically linked library file (.so, .dll, .dylib)

CoreBindings WholeCoreBindings

Serialised core which we can turn into BCOs (or object files), or used by some other backend See Note [Interface Files with Core Definitions]

LoadedBCOs [Unlinked]

A list of BCOs, but hidden behind extra indirection to avoid being too strict.

BCOs CompiledByteCode [SptEntry]

A byte-code object, lives only in memory. Also carries some static pointer table entries which should be loaded along with the BCOs. See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable.

Instances

Instances details
Outputable Unlinked # 
Instance details

Defined in GHC.Linker.Types

Methods

ppr :: Unlinked -> SDoc #

data SptEntry #

An entry to be inserted into a module's static pointer table. See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable.

Constructors

SptEntry Id Fingerprint 

Instances

Instances details
Outputable SptEntry # 
Instance details

Defined in GHC.Linker.Types

Methods

ppr :: SptEntry -> SDoc #

isObject :: Unlinked -> Bool #

Is this an actual file on disk we can link in somehow?

nameOfObject :: Unlinked -> FilePath #

Retrieve the filename of the linkable if possible. Panic if it is a byte-code object

isInterpretable :: Unlinked -> Bool #

Is this a bytecode linkable with no file on disk?

byteCodeOfObject :: Unlinked -> [CompiledByteCode] #

Retrieve the compiled byte-code if possible. Panic if it is a file-based linkable

data LibrarySpec #

Instances

Instances details
Outputable LibrarySpec # 
Instance details

Defined in GHC.Linker.Types

Methods

ppr :: LibrarySpec -> SDoc #