Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides ELF data structures and (de)serialization routines.
- newtype FileClass = FileClass {
- unFileClass :: Word8
- invalidFileClass :: FileClass
- elf32FileClass :: FileClass
- elf64FileClass :: FileClass
- class (Typeable c, Typeable (Addr c), Data (Addr c), Typeable (Off c), Data (Off c), Typeable (UnSymIx c), Data (UnSymIx c), Typeable (UnRelType c), Data (UnRelType c), Show (Addr c), Read (Addr c), Show (Off c), Read (Off c), Show (UnSymIx c), Read (UnSymIx c), Show (UnRelType c), Read (UnRelType c), Eq (Addr c), Ord (Addr c), Bounded (Addr c), Enum (Addr c), Num (Addr c), Integral (Addr c), Real (Addr c), Bits (Addr c), FiniteBits (Addr c), Eq (Off c), Ord (Off c), Bounded (Off c), Enum (Off c), Num (Off c), Integral (Off c), Real (Off c), Bits (Off c), FiniteBits (Off c), Eq (UnSymIx c), Ord (UnSymIx c), Bounded (UnSymIx c), Enum (UnSymIx c), Ix (UnSymIx c), Num (UnSymIx c), Integral (UnSymIx c), Real (UnSymIx c), Bits (UnSymIx c), FiniteBits (UnSymIx c), Eq (UnRelType c), Ord (UnRelType c), Bounded (UnRelType c), Enum (UnRelType c), Ix (UnRelType c)) => IsFileClass c where
- data Elf32 = Elf32
- anElf32 :: Proxy Elf32
- data Elf64 = Elf64
- anElf64 :: Proxy Elf64
- newtype FileType = FileType {
- unFileType :: Word16
- noneFileType :: FileType
- relFileType :: FileType
- execFileType :: FileType
- dynFileType :: FileType
- coreFileType :: FileType
- loOsFileType :: FileType
- hiOsFileType :: FileType
- loProcFileType :: FileType
- hiProcFileType :: FileType
- newtype Machine = Machine {}
- undefMachine :: Machine
- i386Machine :: Machine
- amd64Machine :: Machine
- newtype MachFlags = MachFlags {}
- newtype Version = Version {}
- invalidVersion :: Version
- firstVersion :: Version
- newtype DataEnc = DataEnc {}
- invalidDataEnc :: DataEnc
- lsbDataEnc :: DataEnc
- msbDataEnc :: DataEnc
- newtype OsAbi = OsAbi {}
- sysvOsAbi :: OsAbi
- hpuxOsAbi :: OsAbi
- netBsdOsAbi :: OsAbi
- gnuOsAbi :: OsAbi
- solarisOsAbi :: OsAbi
- aixOsAbi :: OsAbi
- irixOsAbi :: OsAbi
- freeBsdOsAbi :: OsAbi
- tru64OsAbi :: OsAbi
- modestoOsAbi :: OsAbi
- openBsdOsAbi :: OsAbi
- openVmsOsAbi :: OsAbi
- nskOsAbi :: OsAbi
- arosOsAbi :: OsAbi
- fenixOsAbi :: OsAbi
- embedOsAbi :: OsAbi
- newtype AbiVer = AbiVer {}
- undefAbiVer :: AbiVer
- data Ident = Ident {}
- anIdent :: Proxy Ident
- data FileHdr c = FileHdr {}
- type FileHdr32 = FileHdr Elf32
- aFileHdr32 :: Proxy FileHdr32
- type FileHdr64 = FileHdr Elf64
- aFileHdr64 :: Proxy FileHdr64
- newtype SegType = SegType {}
- unusedSegType :: SegType
- loadSegType :: SegType
- dynSegType :: SegType
- interpSegType :: SegType
- noteSegType :: SegType
- shlibSegType :: SegType
- phdrSegType :: SegType
- loOsSegType :: SegType
- hiOsSegType :: SegType
- loProcSegType :: SegType
- hiProcSegType :: SegType
- newtype SegFlags = SegFlags {
- unSegFlags :: Word32
- execSegFlag :: SegFlags
- writeSegFlag :: SegFlags
- readSegFlag :: SegFlags
- osSegFlags :: SegFlags
- procSegFlags :: SegFlags
- data ProgHdr c = ProgHdr {}
- type ProgHdr32 = ProgHdr Elf32
- aProgHdr32 :: Proxy ProgHdr32
- type ProgHdr64 = ProgHdr Elf64
- aProgHdr64 :: Proxy ProgHdr64
- type StrIx = Word32
- newtype SecIx = SecIx {}
- undefSecIx :: SecIx
- lastSecIx :: SecIx
- loOsSecIx :: SecIx
- hiOsSecIx :: SecIx
- loProcSecIx :: SecIx
- hiProcSecIx :: SecIx
- absSecIx :: SecIx
- commonSecIx :: SecIx
- xIndexSecIx :: SecIx
- newtype SecType = SecType {}
- unusedSecType :: SecType
- progBitsSecType :: SecType
- symSecType :: SecType
- strSecType :: SecType
- relaSecType :: SecType
- hashSecType :: SecType
- dynSecType :: SecType
- noteSecType :: SecType
- noBitsSecType :: SecType
- relSecType :: SecType
- shlibSecType :: SecType
- dynSymSecType :: SecType
- loOsSecType :: SecType
- hiOsSecType :: SecType
- loProcSecType :: SecType
- hiProcSecType :: SecType
- newtype SecFlags = SecFlags {
- unSecFlags :: Word32
- writeSecFlag :: SecFlags
- allocSecFlag :: SecFlags
- execSecFlag :: SecFlags
- mergeSecFlag :: SecFlags
- infoLinkSecFlag :: SecFlags
- osSecFlags :: SecFlags
- procSecFlags :: SecFlags
- data SecHdr c = SecHdr {}
- type SecHdr32 = SecHdr Elf32
- aSecHdr32 :: Proxy SecHdr32
- type SecHdr64 = SecHdr Elf64
- aSecHdr64 :: Proxy SecHdr64
- zeroSecHdr :: IsFileClass c => SecHdr c
- newtype SymType = SymType {}
- undefSymType :: SymType
- objSymType :: SymType
- funSymType :: SymType
- secSymType :: SymType
- fileSymType :: SymType
- commonSymType :: SymType
- tlsSymType :: SymType
- loOsSymType :: SymType
- hiOsSymType :: SymType
- loProcSymType :: SymType
- hiProcSymType :: SymType
- newtype SymBind = SymBind {}
- localSymBind :: SymBind
- globalSymBind :: SymBind
- weakSymBind :: SymBind
- loOsSymBind :: SymBind
- hiOsSymBind :: SymBind
- loProcSymBind :: SymBind
- hiProcSymBind :: SymBind
- newtype SymVisi = SymVisi {}
- defSymVisi :: SymVisi
- intSymVisi :: SymVisi
- hiddenSymVisi :: SymVisi
- protSymVisi :: SymVisi
- exportSymVisi :: SymVisi
- singSymVisi :: SymVisi
- elimSymVisi :: SymVisi
- newtype SymIx c = SymIx {}
- undefSymIx :: IsFileClass c => SymIx c
- data SymEnt c = SymEnt {}
- type SymEnt32 = SymEnt Elf32
- aSymEnt32 :: Proxy SymEnt32
- type SymEnt64 = SymEnt Elf64
- aSymEnt64 :: Proxy SymEnt64
- zeroSymEnt :: IsFileClass c => SymEnt c
- newtype RelType c = RelType {}
- type RelType32 = RelType Elf32
- type RelType64 = RelType Elf64
- data RelEnt c = RelEnt {}
- type RelEnt32 = RelEnt Elf32
- aRelEnt32 :: Proxy RelEnt32
- type RelEnt64 = RelEnt Elf64
- aRelEnt64 :: Proxy RelEnt64
- data RelaEnt c = RelaEnt {}
- type RelaEnt32 = RelaEnt Elf32
- aRelaEnt32 :: Proxy RelaEnt32
- type RelaEnt64 = RelaEnt Elf64
- aRelaEnt64 :: Proxy RelaEnt64
File class
File class.
invalidFileClass :: FileClass Source #
Invalid class (ELFCLASSNONE
).
elf32FileClass :: FileClass Source #
ELF32 class (ELFCLASS32
).
elf64FileClass :: FileClass Source #
ELF64 class (ELFCLASS64
).
class (Typeable c, Typeable (Addr c), Data (Addr c), Typeable (Off c), Data (Off c), Typeable (UnSymIx c), Data (UnSymIx c), Typeable (UnRelType c), Data (UnRelType c), Show (Addr c), Read (Addr c), Show (Off c), Read (Off c), Show (UnSymIx c), Read (UnSymIx c), Show (UnRelType c), Read (UnRelType c), Eq (Addr c), Ord (Addr c), Bounded (Addr c), Enum (Addr c), Num (Addr c), Integral (Addr c), Real (Addr c), Bits (Addr c), FiniteBits (Addr c), Eq (Off c), Ord (Off c), Bounded (Off c), Enum (Off c), Num (Off c), Integral (Off c), Real (Off c), Bits (Off c), FiniteBits (Off c), Eq (UnSymIx c), Ord (UnSymIx c), Bounded (UnSymIx c), Enum (UnSymIx c), Ix (UnSymIx c), Num (UnSymIx c), Integral (UnSymIx c), Real (UnSymIx c), Bits (UnSymIx c), FiniteBits (UnSymIx c), Eq (UnRelType c), Ord (UnRelType c), Bounded (UnRelType c), Enum (UnRelType c), Ix (UnRelType c)) => IsFileClass c where Source #
File class type-level index.
32-bit ELF class type-level index.
64-bit ELF class type-level index.
File header
File type
File type.
noneFileType :: FileType Source #
No file type (ET_NONE
).
relFileType :: FileType Source #
Relocatable object file (ET_REL
).
execFileType :: FileType Source #
Executable file (ET_EXEC
).
dynFileType :: FileType Source #
Shared object file (ET_DYN
).
coreFileType :: FileType Source #
Core file (ET_CORE
).
loOsFileType :: FileType Source #
First environment-specific type (ET_LOOS
).
hiOsFileType :: FileType Source #
Last environment-specific type (ET_HIOS
).
loProcFileType :: FileType Source #
First processor-specific type (ET_LOPROC
).
hiProcFileType :: FileType Source #
Last processor-specific type (ET_HIPROC
).
Machine code
Machine architecture.
undefMachine :: Machine Source #
No machine (EM_NONE
).
i386Machine :: Machine Source #
Intel 80386 (EM_386
).
amd64Machine :: Machine Source #
AMD x86-64 (EM_X86_64
).
Machine flags
Architecture-specific flags.
ELF version
ELF version.
invalidVersion :: Version Source #
Invalid version.
firstVersion :: Version Source #
Version 1.
Data encoding
Data encoding.
invalidDataEnc :: DataEnc Source #
Invalid data encoding.
lsbDataEnc :: DataEnc Source #
Little-endian data encoding (ELFDATA2LSB
).
msbDataEnc :: DataEnc Source #
Big-endian data encoding (ELFDATA2MSB
).
Operating system ABI
System ABI.
netBsdOsAbi :: OsAbi Source #
NetBSD (ELFOSABI_NETBSD
).
solarisOsAbi :: OsAbi Source #
Solaris (ELFOSABI_SOLARIS
).
freeBsdOsAbi :: OsAbi Source #
FreeBSD (ELFOSABI_FREEBSD
).
tru64OsAbi :: OsAbi Source #
Tru64 UNIX (ELFOSABI_TRU64
).
modestoOsAbi :: OsAbi Source #
Novell Modesto (ELFOSABI_MODESTO
).
openBsdOsAbi :: OsAbi Source #
OpenBSD (ELFOSABI_OPENBSD
).
openVmsOsAbi :: OsAbi Source #
OpenVMS (ELFOSABI_OPENVMS
).
fenixOsAbi :: OsAbi Source #
FenixOS (ELFOSABI_FENIXOS
).
embedOsAbi :: OsAbi Source #
Standalone (embedded) application.
ABI version.
undefAbiVer :: AbiVer Source #
Undefined ABI version.
Identification
Identification.
File header
File header.
Serializable FileHdr64 Source # | |
Serializable FileHdr32 Source # | |
SizedSerializable FileHdr64 Source # | |
SizedSerializable FileHdr32 Source # | |
Deserializable FileHdr64 Source # | |
Deserializable FileHdr32 Source # | |
IsFileClass c => Eq (FileHdr c) Source # | |
(Data c, IsFileClass c) => Data (FileHdr c) Source # | |
IsFileClass c => Read (FileHdr c) Source # | |
IsFileClass c => Show (FileHdr c) Source # | |
Program header
Segment type
Segment type.
unusedSegType :: SegType Source #
Unused program header entry (PT_NULL
).
loadSegType :: SegType Source #
Loadable segment (PT_LOAD
).
dynSegType :: SegType Source #
Dynamic linking tables (PT_DYNAMIC
).
interpSegType :: SegType Source #
Program interpreter path name (PT_INTERP
).
noteSegType :: SegType Source #
Note sections (PT_NOTE
).
shlibSegType :: SegType Source #
A reserved segment type (PT_SHLIB
).
phdrSegType :: SegType Source #
Program header table (PT_PHDR
).
loOsSegType :: SegType Source #
First environment-specific segment type (PT_LOOS
).
hiOsSegType :: SegType Source #
Last environment-specific segment type (PT_HIOS
).
loProcSegType :: SegType Source #
First processor-specific segment type (PT_LOPROC
).
hiProcSegType :: SegType Source #
Last processor-specific segment type (PT_HIPROC
).
Segment flags
Segment flags.
execSegFlag :: SegFlags Source #
Execute permission (PF_X
).
writeSegFlag :: SegFlags Source #
Write permission (PF_W
).
readSegFlag :: SegFlags Source #
Read permission (PF_R
).
osSegFlags :: SegFlags Source #
Environment-specific flags mask (PF_MASKOS
).
procSegFlags :: SegFlags Source #
Processor-specific flags mask (PF_MASKPROC
).
Program header
Program header table entry.
Serializable ProgHdr64 Source # | |
Serializable ProgHdr32 Source # | |
SizedSerializable ProgHdr64 Source # | |
SizedSerializable ProgHdr32 Source # | |
Deserializable ProgHdr64 Source # | |
Deserializable ProgHdr32 Source # | |
IsFileClass c => Eq (ProgHdr c) Source # | |
(Data c, IsFileClass c) => Data (ProgHdr c) Source # | |
IsFileClass c => Read (ProgHdr c) Source # | |
IsFileClass c => Show (ProgHdr c) Source # | |
Section header
String table index
Section header table index
Section header entry index.
undefSecIx :: SecIx Source #
Undefined section reference (SHN_UNDEF
).
loProcSecIx :: SecIx Source #
First processor-specific section index (SHN_LOPROC
).
hiProcSecIx :: SecIx Source #
Last processor-specific section index (SHN_HIPROC
).
commonSecIx :: SecIx Source #
Common block indicator (SHN_COMMON
).
xIndexSecIx :: SecIx Source #
Escape value (SHN_XINDEX
).
Section type
Section type.
unusedSecType :: SecType Source #
Unused section (SHT_NULL
).
progBitsSecType :: SecType Source #
Program information (SHT_PROGBITS
).
symSecType :: SecType Source #
Symbol table (SHT_SYMTAB
).
strSecType :: SecType Source #
String table (SHT_STRTAB
).
relaSecType :: SecType Source #
Relocation entries (SHT_RELA
).
hashSecType :: SecType Source #
Symbol hash table (SHT_HASH
).
dynSecType :: SecType Source #
Dynamic linking table (SHT_DYNAMIC
).
noteSecType :: SecType Source #
Note information (SHT_NOTE
).
noBitsSecType :: SecType Source #
Uninitialized space (SHT_NOBITS
).
relSecType :: SecType Source #
Relocation entries (SHT_REL
).
shlibSecType :: SecType Source #
A reserved section type (SHT_SHLIB
).
dynSymSecType :: SecType Source #
Dynamic loader symbol table (SHT_DYNSYM
).
loOsSecType :: SecType Source #
First environment-specific section type (SHT_LOOS
).
hiOsSecType :: SecType Source #
Last environment-specific section type (SHT_HIOS
).
loProcSecType :: SecType Source #
First processor-specific section type (SHT_LOPROC
).
hiProcSecType :: SecType Source #
Last processor-specific section type (SHT_HIPROC
).
Section flags
Section flags.
writeSecFlag :: SecFlags Source #
Writable data (SHF_WRITE
).
allocSecFlag :: SecFlags Source #
Allocated data (SHF_ALLOC
).
execSecFlag :: SecFlags Source #
Executable instructions (SHF_EXECINSTR
).
mergeSecFlag :: SecFlags Source #
Mergeable data (SHF_MERGE
).
infoLinkSecFlag :: SecFlags Source #
Flag that indicates that shInfo
is a section header table index.
(SHF_INFO_LINK
)
osSecFlags :: SecFlags Source #
Environment-specific flags mask (SHF_MASKOS
).
procSecFlags :: SecFlags Source #
Processor-specific flags mask (SHF_MASKOS
).
Section header
Section header table entry.
Serializable SecHdr64 Source # | |
Serializable SecHdr32 Source # | |
SizedSerializable SecHdr64 Source # | |
SizedSerializable SecHdr32 Source # | |
Deserializable SecHdr64 Source # | |
Deserializable SecHdr32 Source # | |
IsFileClass c => Eq (SecHdr c) Source # | |
(Data c, IsFileClass c) => Data (SecHdr c) Source # | |
IsFileClass c => Read (SecHdr c) Source # | |
IsFileClass c => Show (SecHdr c) Source # | |
zeroSecHdr :: IsFileClass c => SecHdr c Source #
Section header filled with zeros.
Symbol table
Symbol type
Symbol type.
undefSymType :: SymType Source #
Undefined symbol type (STT_NOTYPE
).
objSymType :: SymType Source #
Object (STT_OBJECT
).
funSymType :: SymType Source #
Function (STT_FUNC
).
secSymType :: SymType Source #
Section (STT_SECTION
).
fileSymType :: SymType Source #
Source file name (STT_FILE
).
commonSymType :: SymType Source #
Common block label (STT_COMMON
).
tlsSymType :: SymType Source #
Thread-local storage (STT_TLS
).
loOsSymType :: SymType Source #
First environment-specific symbol type (STT_LOOS
).
hiOsSymType :: SymType Source #
Last environment-specific symbol type (STT_HIOS
).
loProcSymType :: SymType Source #
First processor-specific symbol type (STT_LOPROC
).
hiProcSymType :: SymType Source #
Last processor-specific symbol type (STT_HIPROC
).
Symbol binding
Symbol binding type.
localSymBind :: SymBind Source #
Local symbol (STB_LOCAL
).
globalSymBind :: SymBind Source #
Global symbol (STB_GLOBAL
).
weakSymBind :: SymBind Source #
Lower precedence global symbol (STB_WEAK
).
loOsSymBind :: SymBind Source #
First environment-specific symbol binding type (STB_LOOS
).
hiOsSymBind :: SymBind Source #
Last environment-specific symbol binding type (STB_HIOS
).
loProcSymBind :: SymBind Source #
First processor-specific symbol binding type (STB_LOPROC
).
hiProcSymBind :: SymBind Source #
Last processor-specific symbol binding type (STB_HIPROC
).
Symbol visibility
Symbol visibility.
defSymVisi :: SymVisi Source #
Default symbol visibility (specified by the binding type;
STV_DEFAULT
).
intSymVisi :: SymVisi Source #
Internal symbol visibility (processor-specific hidden type;
STV_INTERNAL
).
protSymVisi :: SymVisi Source #
Protected symbol (STV_PROTECTED
).
exportSymVisi :: SymVisi Source #
Global symbol (STV_EXPORTED
).
singSymVisi :: SymVisi Source #
Global singleton symbol (STV_SINGLETON
).
elimSymVisi :: SymVisi Source #
Extra hidden symbol (STV_ELIMINATE
).
Symbol table index
Symbol table index.
IsFileClass c => Bounded (SymIx c) Source # | |
IsFileClass c => Enum (SymIx c) Source # | |
IsFileClass c => Eq (SymIx c) Source # | |
IsFileClass c => Integral (SymIx c) Source # | |
(Data c, IsFileClass c) => Data (SymIx c) Source # | |
IsFileClass c => Num (SymIx c) Source # | |
IsFileClass c => Ord (SymIx c) Source # | |
IsFileClass c => Read (SymIx c) Source # | |
IsFileClass c => Real (SymIx c) Source # | |
IsFileClass c => Show (SymIx c) Source # | |
IsFileClass c => Ix (SymIx c) Source # | |
IsFileClass c => Bits (SymIx c) Source # | |
IsFileClass c => FiniteBits (SymIx c) Source # | |
undefSymIx :: IsFileClass c => SymIx c Source #
Undefined symbol table index.
Symbol table entry
Symbol table entry.
Serializable SymEnt64 Source # | |
Serializable SymEnt32 Source # | |
SizedSerializable SymEnt64 Source # | |
SizedSerializable SymEnt32 Source # | |
Deserializable SymEnt64 Source # | |
Deserializable SymEnt32 Source # | |
IsFileClass c => Eq (SymEnt c) Source # | |
(Data c, IsFileClass c) => Data (SymEnt c) Source # | |
IsFileClass c => Read (SymEnt c) Source # | |
IsFileClass c => Show (SymEnt c) Source # | |
zeroSymEnt :: IsFileClass c => SymEnt c Source #
Symbol table entry filled with zeros.
Relocation table
Relocation type
Relocation type.
IsFileClass c => Bounded (RelType c) Source # | |
IsFileClass c => Enum (RelType c) Source # | |
IsFileClass c => Eq (RelType c) Source # | |
(Data c, IsFileClass c) => Data (RelType c) Source # | |
IsFileClass c => Ord (RelType c) Source # | |
IsFileClass c => Read (RelType c) Source # | |
IsFileClass c => Show (RelType c) Source # | |
IsFileClass c => Ix (RelType c) Source # | |
Relocation table entry
Relocation table entry (REL).
Serializable RelEnt64 Source # | |
Serializable RelEnt32 Source # | |
SizedSerializable RelEnt64 Source # | |
SizedSerializable RelEnt32 Source # | |
Deserializable RelEnt64 Source # | |
Deserializable RelEnt32 Source # | |
IsFileClass c => Eq (RelEnt c) Source # | |
(Data c, IsFileClass c) => Data (RelEnt c) Source # | |
IsFileClass c => Read (RelEnt c) Source # | |
IsFileClass c => Show (RelEnt c) Source # | |
Relocation table entry (RELA).
Serializable RelaEnt64 Source # | |
Serializable RelaEnt32 Source # | |
SizedSerializable RelaEnt64 Source # | |
SizedSerializable RelaEnt32 Source # | |
Deserializable RelaEnt64 Source # | |
Deserializable RelaEnt32 Source # | |
IsFileClass c => Eq (RelaEnt c) Source # | |
(Data c, IsFileClass c) => Data (RelaEnt c) Source # | |
IsFileClass c => Read (RelaEnt c) Source # | |
IsFileClass c => Show (RelaEnt c) Source # | |