ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.SysTools.Elf

Synopsis

- readElfSectionByName :: Logger -> ByteString -> String -> IO (Maybe ByteString)
- readElfNoteAsString :: Logger -> FilePath -> String -> String -> IO (Maybe String)
- makeElfNote :: Platform -> String -> String -> Word32 -> String -> SDoc

# Documentation

readElfSectionByName :: Logger -> ByteString -> String -> IO (Maybe ByteString) Source #

Given a section name, read its contents as a ByteString.

If the section isn't found or if there is any parsing error, we return Nothing

readElfNoteAsString :: Logger -> FilePath -> String -> String -> IO (Maybe String) Source #

read a Note as a String

If you try to read a note from a section which does not support the Note format, the parsing is likely to fail and Nothing will be returned

makeElfNote :: Platform -> String -> String -> Word32 -> String -> SDoc Source #

Generate the GAS code to create a Note section

Header fields for notes are 32-bit long (see Note [ELF specification]).