Trait object::read::elf::SectionHeader [−][src]
A trait for generic access to SectionHeader32
and SectionHeader64
.
Associated Types
type Elf: FileHeader<SectionHeader = Self, Endian = Self::Endian, Word = Self::Word>
[src]
type Word: Into<u64>
[src]
type Endian: Endian
[src]
Required methods
fn sh_name(&self, endian: Self::Endian) -> u32
[src]
fn sh_type(&self, endian: Self::Endian) -> u32
[src]
fn sh_flags(&self, endian: Self::Endian) -> Self::Word
[src]
fn sh_addr(&self, endian: Self::Endian) -> Self::Word
[src]
fn sh_offset(&self, endian: Self::Endian) -> Self::Word
[src]
fn sh_size(&self, endian: Self::Endian) -> Self::Word
[src]
fn sh_link(&self, endian: Self::Endian) -> u32
[src]
fn sh_info(&self, endian: Self::Endian) -> u32
[src]
fn sh_addralign(&self, endian: Self::Endian) -> Self::Word
[src]
fn sh_entsize(&self, endian: Self::Endian) -> Self::Word
[src]
Provided methods
fn name<'data>(
&self,
endian: Self::Endian,
strings: StringTable<'data>
) -> Result<&'data [u8]>
[src]
&self,
endian: Self::Endian,
strings: StringTable<'data>
) -> Result<&'data [u8]>
Parse the section name from the string table.
fn file_range(&self, endian: Self::Endian) -> Option<(u64, u64)>
[src]
Return the offset and size of the section in the file.
Returns None
for sections that have no data in the file.
fn data<'data>(
&self,
endian: Self::Endian,
data: Bytes<'data>
) -> Result<Bytes<'data>, ()>
[src]
&self,
endian: Self::Endian,
data: Bytes<'data>
) -> Result<Bytes<'data>, ()>
Return the section data.
Returns Ok(&[])
if the section has no data.
Returns Err
for invalid values.
fn data_as_array<'data, T: Pod>(
&self,
endian: Self::Endian,
data: Bytes<'data>
) -> Result<&'data [T], ()>
[src]
&self,
endian: Self::Endian,
data: Bytes<'data>
) -> Result<&'data [T], ()>
Return the section data as a slice of the given type.
Allows padding at the end of the data.
Returns Ok(&[])
if the section has no data.
Returns Err
for invalid values, including bad alignment.
fn symbols<'data>(
&self,
endian: Self::Endian,
data: Bytes<'data>,
sections: &SectionTable<'_, Self::Elf>,
section_index: usize
) -> Result<Option<SymbolTable<'data, Self::Elf>>>
[src]
&self,
endian: Self::Endian,
data: Bytes<'data>,
sections: &SectionTable<'_, Self::Elf>,
section_index: usize
) -> Result<Option<SymbolTable<'data, Self::Elf>>>
Return the symbols in the section.
Also finds the corresponding string table in sections
.
section_index
must be the 0-based index of this section, and is used
to find the corresponding extended section index table in sections
.
Returns Ok(None)
if the section does not contain symbols.
Returns Err
for invalid values.
fn rel<'data>(
&self,
endian: Self::Endian,
data: Bytes<'data>
) -> Result<Option<&'data [<Self::Elf as FileHeader>::Rel]>>
[src]
&self,
endian: Self::Endian,
data: Bytes<'data>
) -> Result<Option<&'data [<Self::Elf as FileHeader>::Rel]>>
Return the Elf::Rel
entries in the section.
Returns Ok(None)
if the section does not contain relocations.
Returns Err
for invalid values.
fn rela<'data>(
&self,
endian: Self::Endian,
data: Bytes<'data>
) -> Result<Option<&'data [<Self::Elf as FileHeader>::Rela]>>
[src]
&self,
endian: Self::Endian,
data: Bytes<'data>
) -> Result<Option<&'data [<Self::Elf as FileHeader>::Rela]>>
Return the Elf::Rela
entries in the section.
Returns Ok(None)
if the section does not contain relocations.
Returns Err
for invalid values.
fn relocation_symbols<'data>(
&self,
endian: Self::Endian,
data: Bytes<'data>,
sections: &SectionTable<'data, Self::Elf>
) -> Result<SymbolTable<'data, Self::Elf>>
[src]
&self,
endian: Self::Endian,
data: Bytes<'data>,
sections: &SectionTable<'data, Self::Elf>
) -> Result<SymbolTable<'data, Self::Elf>>
Return the symbol table for a relocation section.
Returns Err
for invalid values, including if the section does not contain
relocations.
fn notes<'data>(
&self,
endian: Self::Endian,
data: Bytes<'data>
) -> Result<Option<NoteIterator<'data, Self::Elf>>>
[src]
&self,
endian: Self::Endian,
data: Bytes<'data>
) -> Result<Option<NoteIterator<'data, Self::Elf>>>
Return a note iterator for the section data.
Returns Ok(None)
if the section does not contain notes.
Returns Err
for invalid values.
fn group<'data>(
&self,
endian: Self::Endian,
data: Bytes<'data>
) -> Result<Option<(u32, &'data [U32Bytes<Self::Endian>])>>
[src]
&self,
endian: Self::Endian,
data: Bytes<'data>
) -> Result<Option<(u32, &'data [U32Bytes<Self::Endian>])>>
Return the contents of a group section.
The first value is a GRP_*
value, and the remaining values
are section indices.
Returns Ok(None)
if the section does not define a group.
Returns Err
for invalid values.