Struct object::elf::SectionHeader32

source ·
#[repr(C)]
pub struct SectionHeader32<E: Endian> { pub sh_name: U32<E>, pub sh_type: U32<E>, pub sh_flags: U32<E>, pub sh_addr: U32<E>, pub sh_offset: U32<E>, pub sh_size: U32<E>, pub sh_link: U32<E>, pub sh_info: U32<E>, pub sh_addralign: U32<E>, pub sh_entsize: U32<E>, }
Expand description

Section header.

Fields§

§sh_name: U32<E>

Section name.

This is an offset into the section header string table.

§sh_type: U32<E>

Section type. One of the SHT_* constants.

§sh_flags: U32<E>

Section flags. A combination of the SHF_* constants.

§sh_addr: U32<E>

Section virtual address at execution.

§sh_offset: U32<E>

Section file offset.

§sh_size: U32<E>

Section size in bytes.

§sh_link: U32<E>

Link to another section.

The section relationship depends on the sh_type value.

§sh_info: U32<E>

Additional section information.

The meaning of this field depends on the sh_type value.

§sh_addralign: U32<E>

Section alignment.

§sh_entsize: U32<E>

Entry size if the section holds a table.

Trait Implementations§

source§

impl<E: Clone + Endian> Clone for SectionHeader32<E>

source§

fn clone(&self) -> SectionHeader32<E>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<E: Debug + Endian> Debug for SectionHeader32<E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Endian: Endian> SectionHeader for SectionHeader32<Endian>

§

type Elf = FileHeader32<Endian>

§

type Word = u32

§

type Endian = Endian

source§

fn sh_name(&self, endian: Self::Endian) -> u32

source§

fn sh_type(&self, endian: Self::Endian) -> u32

source§

fn sh_flags(&self, endian: Self::Endian) -> Self::Word

source§

fn sh_addr(&self, endian: Self::Endian) -> Self::Word

source§

fn sh_offset(&self, endian: Self::Endian) -> Self::Word

source§

fn sh_size(&self, endian: Self::Endian) -> Self::Word

source§

fn sh_info(&self, endian: Self::Endian) -> u32

source§

fn sh_addralign(&self, endian: Self::Endian) -> Self::Word

source§

fn sh_entsize(&self, endian: Self::Endian) -> Self::Word

source§

fn name<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, strings: StringTable<'data, R>, ) -> Result<&'data [u8]>

Parse the section name from the string table.
source§

fn file_range(&self, endian: Self::Endian) -> Option<(u64, u64)>

Return the offset and size of the section in the file. Read more
source§

fn data<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<&'data [u8]>

Return the section data. Read more
source§

fn data_as_array<'data, T: Pod, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<&'data [T]>

Return the section data as a slice of the given type. Read more
source§

fn strings<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<StringTable<'data, R>>>

Return the strings in the section. Read more
source§

fn symbols<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, sections: &SectionTable<'data, Self::Elf, R>, section_index: SectionIndex, ) -> Result<Option<SymbolTable<'data, Self::Elf, R>>>

Return the symbols in the section. Read more
source§

fn rel<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<(&'data [<Self::Elf as FileHeader>::Rel], SectionIndex)>>

Return the Elf::Rel entries in the section. Read more
source§

fn rela<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<(&'data [<Self::Elf as FileHeader>::Rela], SectionIndex)>>

Return the Elf::Rela entries in the section. Read more
source§

fn dynamic<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<(&'data [<Self::Elf as FileHeader>::Dyn], SectionIndex)>>

Return entries in a dynamic section. Read more
source§

fn notes<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<NoteIterator<'data, Self::Elf>>>

Return a note iterator for the section data. Read more
source§

fn group<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<(u32, &'data [U32Bytes<Self::Endian>])>>

Return the contents of a group section. Read more
source§

fn hash_header<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<&'data HashHeader<Self::Endian>>>

Return the header of a SysV hash section. Read more
source§

fn hash<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<(HashTable<'data, Self::Elf>, SectionIndex)>>

Return the contents of a SysV hash section. Read more
source§

fn gnu_hash_header<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<&'data GnuHashHeader<Self::Endian>>>

Return the header of a GNU hash section. Read more
source§

fn gnu_hash<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<(GnuHashTable<'data, Self::Elf>, SectionIndex)>>

Return the contents of a GNU hash section. Read more
source§

fn gnu_versym<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<(&'data [Versym<Self::Endian>], SectionIndex)>>

Return the contents of a SHT_GNU_VERSYM section. Read more
source§

fn gnu_verdef<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<(VerdefIterator<'data, Self::Elf>, SectionIndex)>>

Return an iterator for the entries of a SHT_GNU_VERDEF section. Read more
source§

fn gnu_verneed<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<(VerneedIterator<'data, Self::Elf>, SectionIndex)>>

Return an iterator for the entries of a SHT_GNU_VERNEED section. Read more
source§

fn gnu_attributes<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<AttributesSection<'data, Self::Elf>>>

Return the contents of a SHT_GNU_ATTRIBUTES section. Read more
source§

fn attributes<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<AttributesSection<'data, Self::Elf>>

Parse the contents of the section as attributes. Read more
source§

fn compression<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<(&'data <Self::Elf as FileHeader>::CompressionHeader, u64, u64)>>

Parse the compression header if present. Read more
source§

impl<E: Copy + Endian> Copy for SectionHeader32<E>

source§

impl<E: Endian> Pod for SectionHeader32<E>

Auto Trait Implementations§

§

impl<E> Freeze for SectionHeader32<E>

§

impl<E> RefUnwindSafe for SectionHeader32<E>
where E: RefUnwindSafe,

§

impl<E> Send for SectionHeader32<E>
where E: Send,

§

impl<E> Sync for SectionHeader32<E>
where E: Sync,

§

impl<E> Unpin for SectionHeader32<E>
where E: Unpin,

§

impl<E> UnwindSafe for SectionHeader32<E>
where E: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.