melf-1.0.0: An Elf parser
Copyright(c) Aleksey Makarov 2021
LicenseBSD 3-Clause License
Maintaineraleksey.makarov@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.Elf.Constants

Description

Definitions of constants used in ELF files

Synopsis

Documentation

Constants defined here are declared using Template Haskell so there are no docs. See the sources or the documents describing ELF file format.

Data types, patterns and instances are generated by mkDeclarations TH macros. Below is an example of how it works. The code

$(mkDeclarations BaseWord16 "TypeName" "ValuePrefix" "DefaultConstructorName"
    [ ("_A", 0)
    , ("_B", 1)
    ])

produces this:

    newtype TypeName = TypeName Word16 deriving (Eq, Ord, Enum, Num, Real, Integral, Bits, FiniteBits)

    instance Show TypeName where
        show (TypeName 0) = ("ValuePrefix" ++ "_A")
        show (TypeName 1) = ("ValuePrefix" ++ "_B")
        show (TypeName n_a5QI) = ("DefaultConstructorName" ++ (" " ++ show n_a5QI))

    pattern ValuePrefix_A :: TypeName
    pattern ValuePrefix_A = TypeName 0

    pattern ValuePrefix_B :: TypeName
    pattern ValuePrefix_B = TypeName 1

    pattern DefaultConstructorName :: Word16 -> TypeName
    pattern DefaultConstructorName n_a5QJ = TypeName n_a5QJ

    instance Binary (Le TypeName) where
        get = (Le <$> (TypeName <$> getWord16le))
        put (Le (TypeName n_a5QK)) = putWord16le n_a5QK

    instance Binary (Be TypeName) where
        get = (Be <$> (TypeName <$> getWord16be))
        put (Be (TypeName n_a5QL)) = putWord16be n_a5QL

newtype ElfOSABI Source #

Operating system and ABI for which the object is prepared

Constructors

ElfOSABI Word8 

Instances

Instances details
Enum ElfOSABI Source # 
Instance details

Defined in Data.Elf.Constants.Data

Eq ElfOSABI Source # 
Instance details

Defined in Data.Elf.Constants.Data

Integral ElfOSABI Source # 
Instance details

Defined in Data.Elf.Constants.Data

Num ElfOSABI Source # 
Instance details

Defined in Data.Elf.Constants.Data

Ord ElfOSABI Source # 
Instance details

Defined in Data.Elf.Constants.Data

Real ElfOSABI Source # 
Instance details

Defined in Data.Elf.Constants.Data

Show ElfOSABI Source # 
Instance details

Defined in Data.Elf.Constants.Data

Bits ElfOSABI Source # 
Instance details

Defined in Data.Elf.Constants.Data

FiniteBits ElfOSABI Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary ElfOSABI Source # 
Instance details

Defined in Data.Elf.Constants.Data

Methods

put :: ElfOSABI -> Put #

get :: Get ElfOSABI #

putList :: [ElfOSABI] -> Put #

newtype ElfType Source #

Object file type

Constructors

ElfType Word16 

Instances

Instances details
Enum ElfType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Eq ElfType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Methods

(==) :: ElfType -> ElfType -> Bool #

(/=) :: ElfType -> ElfType -> Bool #

Integral ElfType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Num ElfType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Ord ElfType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Real ElfType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Show ElfType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Bits ElfType Source # 
Instance details

Defined in Data.Elf.Constants.Data

FiniteBits ElfType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Le ElfType) Source # 
Instance details

Defined in Data.Elf.Constants.Data

Methods

put :: Le ElfType -> Put #

get :: Get (Le ElfType) #

putList :: [Le ElfType] -> Put #

Binary (Be ElfType) Source # 
Instance details

Defined in Data.Elf.Constants.Data

Methods

put :: Be ElfType -> Put #

get :: Get (Be ElfType) #

putList :: [Be ElfType] -> Put #

pattern ET_EXT :: Word16 -> ElfType Source #

pattern ET_CORE :: ElfType Source #

pattern ET_DYN :: ElfType Source #

pattern ET_EXEC :: ElfType Source #

pattern ET_REL :: ElfType Source #

pattern ET_NONE :: ElfType Source #

newtype ElfMachine Source #

Target architecture

Constructors

ElfMachine Word16 

Instances

Instances details
Enum ElfMachine Source # 
Instance details

Defined in Data.Elf.Constants.Data

Eq ElfMachine Source # 
Instance details

Defined in Data.Elf.Constants.Data

Integral ElfMachine Source # 
Instance details

Defined in Data.Elf.Constants.Data

Num ElfMachine Source # 
Instance details

Defined in Data.Elf.Constants.Data

Ord ElfMachine Source # 
Instance details

Defined in Data.Elf.Constants.Data

Real ElfMachine Source # 
Instance details

Defined in Data.Elf.Constants.Data

Show ElfMachine Source # 
Instance details

Defined in Data.Elf.Constants.Data

Bits ElfMachine Source # 
Instance details

Defined in Data.Elf.Constants.Data

FiniteBits ElfMachine Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Le ElfMachine) Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Be ElfMachine) Source # 
Instance details

Defined in Data.Elf.Constants.Data

newtype ElfSectionType Source #

Section type

Constructors

ElfSectionType Word32 

Instances

Instances details
Enum ElfSectionType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Eq ElfSectionType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Integral ElfSectionType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Num ElfSectionType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Ord ElfSectionType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Real ElfSectionType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Show ElfSectionType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Bits ElfSectionType Source # 
Instance details

Defined in Data.Elf.Constants.Data

FiniteBits ElfSectionType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Le ElfSectionType) Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Be ElfSectionType) Source # 
Instance details

Defined in Data.Elf.Constants.Data

newtype ElfSegmentType Source #

Segment type

Constructors

ElfSegmentType Word32 

Instances

Instances details
Enum ElfSegmentType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Eq ElfSegmentType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Integral ElfSegmentType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Num ElfSegmentType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Ord ElfSegmentType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Real ElfSegmentType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Show ElfSegmentType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Bits ElfSegmentType Source # 
Instance details

Defined in Data.Elf.Constants.Data

FiniteBits ElfSegmentType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Le ElfSegmentType) Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Be ElfSegmentType) Source # 
Instance details

Defined in Data.Elf.Constants.Data

newtype ElfSectionFlag Source #

Attributes of the section

Constructors

ElfSectionFlag Word64 

Instances

Instances details
Enum ElfSectionFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Eq ElfSectionFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Integral ElfSectionFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Num ElfSectionFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Ord ElfSectionFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Real ElfSectionFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Show ElfSectionFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Bits ElfSectionFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

FiniteBits ElfSectionFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Le ElfSectionFlag) Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Be ElfSectionFlag) Source # 
Instance details

Defined in Data.Elf.Constants.Data

newtype ElfSegmentFlag Source #

Attributes of the segment

Constructors

ElfSegmentFlag Word32 

Instances

Instances details
Enum ElfSegmentFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Eq ElfSegmentFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Integral ElfSegmentFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Num ElfSegmentFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Ord ElfSegmentFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Real ElfSegmentFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Show ElfSegmentFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Bits ElfSegmentFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

FiniteBits ElfSegmentFlag Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Le ElfSegmentFlag) Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Be ElfSegmentFlag) Source # 
Instance details

Defined in Data.Elf.Constants.Data

newtype ElfSymbolType Source #

Symbol type

Constructors

ElfSymbolType Word8 

Instances

Instances details
Enum ElfSymbolType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Eq ElfSymbolType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Integral ElfSymbolType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Num ElfSymbolType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Ord ElfSymbolType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Real ElfSymbolType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Show ElfSymbolType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Bits ElfSymbolType Source # 
Instance details

Defined in Data.Elf.Constants.Data

FiniteBits ElfSymbolType Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary ElfSymbolType Source # 
Instance details

Defined in Data.Elf.Constants.Data

newtype ElfSymbolBinding Source #

Symbol binding

Constructors

ElfSymbolBinding Word8 

Instances

Instances details
Enum ElfSymbolBinding Source # 
Instance details

Defined in Data.Elf.Constants.Data

Eq ElfSymbolBinding Source # 
Instance details

Defined in Data.Elf.Constants.Data

Integral ElfSymbolBinding Source # 
Instance details

Defined in Data.Elf.Constants.Data

Num ElfSymbolBinding Source # 
Instance details

Defined in Data.Elf.Constants.Data

Ord ElfSymbolBinding Source # 
Instance details

Defined in Data.Elf.Constants.Data

Real ElfSymbolBinding Source # 
Instance details

Defined in Data.Elf.Constants.Data

Show ElfSymbolBinding Source # 
Instance details

Defined in Data.Elf.Constants.Data

Bits ElfSymbolBinding Source # 
Instance details

Defined in Data.Elf.Constants.Data

FiniteBits ElfSymbolBinding Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary ElfSymbolBinding Source # 
Instance details

Defined in Data.Elf.Constants.Data

newtype ElfSectionIndex Source #

Section index

Constructors

ElfSectionIndex Word16 

Instances

Instances details
Enum ElfSectionIndex Source # 
Instance details

Defined in Data.Elf.Constants.Data

Eq ElfSectionIndex Source # 
Instance details

Defined in Data.Elf.Constants.Data

Integral ElfSectionIndex Source # 
Instance details

Defined in Data.Elf.Constants.Data

Num ElfSectionIndex Source # 
Instance details

Defined in Data.Elf.Constants.Data

Ord ElfSectionIndex Source # 
Instance details

Defined in Data.Elf.Constants.Data

Real ElfSectionIndex Source # 
Instance details

Defined in Data.Elf.Constants.Data

Show ElfSectionIndex Source # 
Instance details

Defined in Data.Elf.Constants.Data

Bits ElfSectionIndex Source # 
Instance details

Defined in Data.Elf.Constants.Data

FiniteBits ElfSectionIndex Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Le ElfSectionIndex) Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Be ElfSectionIndex) Source # 
Instance details

Defined in Data.Elf.Constants.Data

newtype ElfRelocationType_AARCH64 Source #

AARCH64 relocation type

Instances

Instances details
Enum ElfRelocationType_AARCH64 Source # 
Instance details

Defined in Data.Elf.Constants.Data

Eq ElfRelocationType_AARCH64 Source # 
Instance details

Defined in Data.Elf.Constants.Data

Integral ElfRelocationType_AARCH64 Source # 
Instance details

Defined in Data.Elf.Constants.Data

Num ElfRelocationType_AARCH64 Source # 
Instance details

Defined in Data.Elf.Constants.Data

Ord ElfRelocationType_AARCH64 Source # 
Instance details

Defined in Data.Elf.Constants.Data

Real ElfRelocationType_AARCH64 Source # 
Instance details

Defined in Data.Elf.Constants.Data

Show ElfRelocationType_AARCH64 Source # 
Instance details

Defined in Data.Elf.Constants.Data

Bits ElfRelocationType_AARCH64 Source # 
Instance details

Defined in Data.Elf.Constants.Data

Methods

(.&.) :: ElfRelocationType_AARCH64 -> ElfRelocationType_AARCH64 -> ElfRelocationType_AARCH64 #

(.|.) :: ElfRelocationType_AARCH64 -> ElfRelocationType_AARCH64 -> ElfRelocationType_AARCH64 #

xor :: ElfRelocationType_AARCH64 -> ElfRelocationType_AARCH64 -> ElfRelocationType_AARCH64 #

complement :: ElfRelocationType_AARCH64 -> ElfRelocationType_AARCH64 #

shift :: ElfRelocationType_AARCH64 -> Int -> ElfRelocationType_AARCH64 #

rotate :: ElfRelocationType_AARCH64 -> Int -> ElfRelocationType_AARCH64 #

zeroBits :: ElfRelocationType_AARCH64 #

bit :: Int -> ElfRelocationType_AARCH64 #

setBit :: ElfRelocationType_AARCH64 -> Int -> ElfRelocationType_AARCH64 #

clearBit :: ElfRelocationType_AARCH64 -> Int -> ElfRelocationType_AARCH64 #

complementBit :: ElfRelocationType_AARCH64 -> Int -> ElfRelocationType_AARCH64 #

testBit :: ElfRelocationType_AARCH64 -> Int -> Bool #

bitSizeMaybe :: ElfRelocationType_AARCH64 -> Maybe Int #

bitSize :: ElfRelocationType_AARCH64 -> Int #

isSigned :: ElfRelocationType_AARCH64 -> Bool #

shiftL :: ElfRelocationType_AARCH64 -> Int -> ElfRelocationType_AARCH64 #

unsafeShiftL :: ElfRelocationType_AARCH64 -> Int -> ElfRelocationType_AARCH64 #

shiftR :: ElfRelocationType_AARCH64 -> Int -> ElfRelocationType_AARCH64 #

unsafeShiftR :: ElfRelocationType_AARCH64 -> Int -> ElfRelocationType_AARCH64 #

rotateL :: ElfRelocationType_AARCH64 -> Int -> ElfRelocationType_AARCH64 #

rotateR :: ElfRelocationType_AARCH64 -> Int -> ElfRelocationType_AARCH64 #

popCount :: ElfRelocationType_AARCH64 -> Int #

FiniteBits ElfRelocationType_AARCH64 Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Le ElfRelocationType_AARCH64) Source # 
Instance details

Defined in Data.Elf.Constants.Data

Binary (Be ElfRelocationType_AARCH64) Source # 
Instance details

Defined in Data.Elf.Constants.Data