Struct elf_riscv32::Elf
source · [−]pub struct Elf<'a> {
pub header: &'a Header,
pub section_names: StringTable<'a>,
/* private fields */
}
Expand description
A 32bit little-endian RISC-V ELF file.
use elf_riscv32::*;
let elf = Elf::new(&data).unwrap();
for section in elf.sections().unwrap() {
let section = section.unwrap();
println!("{} = {section:X?}", elf.section_name(§ion).unwrap())
}
for program in elf.programs().unwrap() {
let program = program.unwrap();
println!("{program:X?}")
}
Fields
header: &'a Header
section_names: StringTable<'a>
Implementations
sourceimpl<'a> Elf<'a>
impl<'a> Elf<'a>
pub fn new(elf: &'a [u32]) -> Result<Self>
pub fn program(&self, index: u16) -> Result<Program<'a>>
sourcepub fn section_name(&'a self, section: &Section<'a>) -> Result<&'a str>
pub fn section_name(&'a self, section: &Section<'a>) -> Result<&'a str>
Get the section name string given an offset into the section header string table.
pub fn section(&self, index: u16) -> Result<Section<'a>>
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Elf<'a>
impl<'a> Send for Elf<'a>
impl<'a> Sync for Elf<'a>
impl<'a> Unpin for Elf<'a>
impl<'a> UnwindSafe for Elf<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more