Struct object::read::elf::ElfSection
source · pub struct ElfSection<'data, 'file, Elf, R = &'data [u8]>where
Elf: FileHeader,
R: ReadRef<'data>,{
pub(super) file: &'file ElfFile<'data, Elf, R>,
pub(super) index: SectionIndex,
pub(super) section: &'data Elf::SectionHeader,
}
Expand description
A section in an ElfFile
.
Most functionality is provided by the ObjectSection
trait implementation.
Fields§
§file: &'file ElfFile<'data, Elf, R>
§index: SectionIndex
§section: &'data Elf::SectionHeader
Implementations§
source§impl<'data, 'file, Elf: FileHeader, R: ReadRef<'data>> ElfSection<'data, 'file, Elf, R>
impl<'data, 'file, Elf: FileHeader, R: ReadRef<'data>> ElfSection<'data, 'file, Elf, R>
sourcepub fn elf_file(&self) -> &'file ElfFile<'data, Elf, R>
pub fn elf_file(&self) -> &'file ElfFile<'data, Elf, R>
Get the ELF file containing this section.
sourcepub fn elf_section_header(&self) -> &'data Elf::SectionHeader
pub fn elf_section_header(&self) -> &'data Elf::SectionHeader
Get the raw ELF section header.
sourcepub fn elf_relocation_section_index(&self) -> Result<Option<SectionIndex>>
pub fn elf_relocation_section_index(&self) -> Result<Option<SectionIndex>>
Get the index of the relocation section that references this section.
Returns None
if there are no relocations.
Returns an error if there are multiple relocation sections that reference this section.
sourcepub fn elf_relocation_section(
&self,
) -> Result<Option<&'data Elf::SectionHeader>>
pub fn elf_relocation_section( &self, ) -> Result<Option<&'data Elf::SectionHeader>>
Get the relocation section that references this section.
Returns None
if there are no relocations.
Returns an error if there are multiple relocation sections that reference this section.
sourcepub fn elf_linked_rel(&self) -> Result<&'data [Elf::Rel]>
pub fn elf_linked_rel(&self) -> Result<&'data [Elf::Rel]>
Get the Elf::Rel
entries that apply to this section.
Returns an empty slice if there are no relocations. Returns an error if there are multiple relocation sections that reference this section.
sourcepub fn elf_linked_rela(&self) -> Result<&'data [Elf::Rela]>
pub fn elf_linked_rela(&self) -> Result<&'data [Elf::Rela]>
Get the Elf::Rela
entries that apply to this section.
Returns an empty slice if there are no relocations. Returns an error if there are multiple relocation sections that reference this section.