libriscv-0.1.0.0: A versatile, flexible and executable formal model for the RISC-V architecture.
Safe HaskellSafe-Inferred
LanguageHaskell2010

LibRISCV.Loader

Description

An implementation of an Executable Loadable Format (ELF) loader. The module is responsible for loading instructions into a provided memory implementation and obtaining the entry point for the executable.

Synopsis

Documentation

readElf :: FilePath -> IO Elf Source #

Read an ELF from a given FilePath.

type LoadFunc m = Address -> ByteString -> m () Source #

Load a ByteString into memory at a given address.

loadElf :: Monad m => Elf -> LoadFunc m -> m () Source #

Load all loadable segments of an ELF file into memory. An addition to the Elf file, it requires an implementation of a LoadFunc which is responsible for converting a ByteString to the internal value representation.

startAddr :: MonadCatch m => Elf -> m Word32 Source #

Return the entry point from the ELF header.