pub struct SectionTable<'data, Elf: FileHeader> { /* private fields */ }
Expand description
The table of section headers in an ELF file.
Also includes the string table used for the section names.
Implementations
sourceimpl<'data, Elf: FileHeader> SectionTable<'data, Elf>
impl<'data, Elf: FileHeader> SectionTable<'data, Elf>
sourcepub fn new(
sections: &'data [Elf::SectionHeader],
strings: StringTable<'data>
) -> Self
pub fn new(
sections: &'data [Elf::SectionHeader],
strings: StringTable<'data>
) -> Self
Create a new section table.
sourcepub fn iter(&self) -> Iter<'data, Elf::SectionHeader>
pub fn iter(&self) -> Iter<'data, Elf::SectionHeader>
Iterate over the section headers.
sourcepub fn section(&self, index: usize) -> Result<&'data Elf::SectionHeader>
pub fn section(&self, index: usize) -> Result<&'data Elf::SectionHeader>
Return the section header at the given index.
sourcepub fn section_by_name(
&self,
endian: Elf::Endian,
name: &[u8]
) -> Option<(usize, &'data Elf::SectionHeader)>
pub fn section_by_name(
&self,
endian: Elf::Endian,
name: &[u8]
) -> Option<(usize, &'data Elf::SectionHeader)>
Return the section header with the given name.
Ignores sections with invalid names.
sourcepub fn section_name(
&self,
endian: Elf::Endian,
section: &'data Elf::SectionHeader
) -> Result<&'data [u8]>
pub fn section_name(
&self,
endian: Elf::Endian,
section: &'data Elf::SectionHeader
) -> Result<&'data [u8]>
Return the section name for the given section header.
sourcepub fn symbols(
&self,
endian: Elf::Endian,
data: Bytes<'data>,
sh_type: u32
) -> Result<SymbolTable<'data, Elf>>
pub fn symbols(
&self,
endian: Elf::Endian,
data: Bytes<'data>,
sh_type: u32
) -> Result<SymbolTable<'data, Elf>>
Return the symbol table of the given section type.
Returns an empty symbol table if the symbol table does not exist.
sourcepub fn symbol_table_by_index(
&self,
endian: Elf::Endian,
data: Bytes<'data>,
index: usize
) -> Result<SymbolTable<'data, Elf>>
pub fn symbol_table_by_index(
&self,
endian: Elf::Endian,
data: Bytes<'data>,
index: usize
) -> Result<SymbolTable<'data, Elf>>
Return the symbol table at the given section index.
Returns an error if the section is not a symbol table.
sourcepub fn relocation_sections(
&self,
endian: Elf::Endian,
symbol_section: usize
) -> Result<RelocationSections>
pub fn relocation_sections(
&self,
endian: Elf::Endian,
symbol_section: usize
) -> Result<RelocationSections>
Create a mapping from section index to associated relocation sections.
Trait Implementations
sourceimpl<'data, Elf: Clone + FileHeader> Clone for SectionTable<'data, Elf> where
Elf::SectionHeader: Clone,
impl<'data, Elf: Clone + FileHeader> Clone for SectionTable<'data, Elf> where
Elf::SectionHeader: Clone,
sourcefn clone(&self) -> SectionTable<'data, Elf>
fn clone(&self) -> SectionTable<'data, Elf>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'data, Elf: Debug + FileHeader> Debug for SectionTable<'data, Elf> where
Elf::SectionHeader: Debug,
impl<'data, Elf: Debug + FileHeader> Debug for SectionTable<'data, Elf> where
Elf::SectionHeader: Debug,
sourceimpl<'data, Elf: Default + FileHeader> Default for SectionTable<'data, Elf> where
Elf::SectionHeader: Default,
impl<'data, Elf: Default + FileHeader> Default for SectionTable<'data, Elf> where
Elf::SectionHeader: Default,
sourcefn default() -> SectionTable<'data, Elf>
fn default() -> SectionTable<'data, Elf>
Returns the “default value” for a type. Read more
impl<'data, Elf: Copy + FileHeader> Copy for SectionTable<'data, Elf> where
Elf::SectionHeader: Copy,
Auto Trait Implementations
impl<'data, Elf> RefUnwindSafe for SectionTable<'data, Elf> where
<Elf as FileHeader>::SectionHeader: RefUnwindSafe,
impl<'data, Elf> Send for SectionTable<'data, Elf> where
<Elf as FileHeader>::SectionHeader: Sync,
impl<'data, Elf> Sync for SectionTable<'data, Elf> where
<Elf as FileHeader>::SectionHeader: Sync,
impl<'data, Elf> Unpin for SectionTable<'data, Elf>
impl<'data, Elf> UnwindSafe for SectionTable<'data, Elf> where
<Elf as FileHeader>::SectionHeader: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more