Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Macaw.Memory.ElfLoader.PLTStubs
Description
Functionality for computing the names and addresses of PLT stub functions in a dynamically linked ELF binary.
Note that the API in this library is somewhat experimental, and as we further
develop the underlying heuristics involved (see Note [PLT stub names]
), we
may need to change the API accordingly.
Synopsis
- data PLTStubInfo reloc = PLTStubInfo {}
- pltStubSymbols :: forall reloc (w :: Nat). (w ~ RelocationWidth reloc, MemWidth w, IsRelocationType reloc) => PLTStubInfo reloc -> LoadOptions -> ElfHeaderInfo w -> Map (MemWord w) (VersionedSymbol (ElfWordType w))
- noPLTStubInfo :: forall (w :: Nat). String -> PLTStubInfo (NoRelocationType w)
- data NoRelocationType (w :: Nat) = NoRelocationType
Documentation
data PLTStubInfo reloc Source #
Heuristics about how large (in bytes) the sizes of PLT-related stub
functions are. See Note [PLT stub names]
for more information. These
heuristics are tailored to each architecture's dynamic relocations, which is
why this is parameterized by a reloc
type.
For more information about how to add your own value of type PLTStubInfo
,
see Note [Creating a new PLTStubInfo value]
.
Constructors
PLTStubInfo | |
Fields
|
Arguments
:: forall reloc (w :: Nat). (w ~ RelocationWidth reloc, MemWidth w, IsRelocationType reloc) | |
=> PLTStubInfo reloc | Heuristics about how large PLT stubs should be. |
-> LoadOptions | Options configuring how to load the address of each PLT stub. |
-> ElfHeaderInfo w | The dynamically linked ELF binary. |
-> Map (MemWord w) (VersionedSymbol (ElfWordType w)) |
Match up names to PLT stub entries in a dynamically linked ELF binary.
Calls to functions in shared libraries are issued through PLT stubs. These are short sequences included in the binary by the compiler that jump to the *real* function implementation in the shared library via the Global Offset Table. The GOT is populated by the dynamic loader.
See Note [PLT stub names]
for more details.
noPLTStubInfo :: forall (w :: Nat). String -> PLTStubInfo (NoRelocationType w) Source #
data NoRelocationType (w :: Nat) Source #
A dummy relocation type that is used for architectures that do not yet have
a dynamic relocation type defined in elf-edit
. The corresponding
IsRelocationType
instance will simply error.
Constructors
NoRelocationType |
Instances
Show (NoRelocationType w) Source # | |||||
Defined in Data.Macaw.Memory.ElfLoader.PLTStubs Methods showsPrec :: Int -> NoRelocationType w -> ShowS # show :: NoRelocationType w -> String # showList :: [NoRelocationType w] -> ShowS # | |||||
Show (ElfWordType w) => IsRelocationType (NoRelocationType w) Source # | A dummy | ||||
Defined in Data.Macaw.Memory.ElfLoader.PLTStubs Associated Types
Methods relaWidth :: NoRelocationType w -> ElfClass (RelocationWidth (NoRelocationType w)) relocTargetBits :: NoRelocationType w -> Int toRelocType :: Word32 -> NoRelocationType w isRelative :: NoRelocationType w -> Bool | |||||
type RelocationWidth (NoRelocationType w) Source # | |||||
Defined in Data.Macaw.Memory.ElfLoader.PLTStubs type RelocationWidth (NoRelocationType w) = w |