pub enum RawElf<D>where
D: 'static,{
Dylib(RawDylib<D>),
Exec(RawExec<D>),
Object(RawObject<D>),
}Expand description
A mapped but unrelocated ELF image.
This enum represents an ELF file that has been loaded into memory (mapped) but has not yet undergone the relocation process. It can be a dynamic library, an executable, or a relocatable object file.
Variants§
Dylib(RawDylib<D>)
A dynamic library (shared object, typically .so).
Exec(RawExec<D>)
An executable file (typically a PIE or non-PIE executable).
Object(RawObject<D>)
A relocatable object file (typically .o).
Implementations§
Source§impl<D: 'static> RawElf<D>
impl<D: 'static> RawElf<D>
Sourcepub fn relocator(self) -> Relocator<Self, (), (), (), (), (), D>
pub fn relocator(self) -> Relocator<Self, (), (), (), (), (), D>
Creates a builder for relocating the ELF file.
§Examples
use elf_loader::{Loader, input::ElfBinary};
let mut loader = Loader::new();
let bytes = &[]; // ELF file bytes
let lib = loader.load_dylib(ElfBinary::new("liba.so", bytes)).unwrap();
let relocated = lib.relocator()
.lazy(true)
.relocate()
.unwrap();Sourcepub fn mapped_len(&self) -> usize
pub fn mapped_len(&self) -> usize
Gets the total length of mapped memory for the ELF file
Trait Implementations§
Auto Trait Implementations§
impl<D> Freeze for RawElf<D>
impl<D> !RefUnwindSafe for RawElf<D>
impl<D> !Send for RawElf<D>
impl<D> !Sync for RawElf<D>
impl<D> Unpin for RawElf<D>
impl<D> !UnwindSafe for RawElf<D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more