Struct elf::section::SectionHeader

source ·
pub struct SectionHeader {
    pub sh_name: u32,
    pub sh_type: u32,
    pub sh_flags: u64,
    pub sh_addr: u64,
    pub sh_offset: u64,
    pub sh_size: u64,
    pub sh_link: u32,
    pub sh_info: u32,
    pub sh_addralign: u64,
    pub sh_entsize: u64,
}
Expand description

Encapsulates the contents of an ELF Section Header

This is a Rust-native type that represents a Section Header that is bit-width-agnostic.

Fields§

§sh_name: u32

Section Name

§sh_type: u32

Section Type

§sh_flags: u64

Section Flags

§sh_addr: u64

in-memory address where this section is loaded

§sh_offset: u64

Byte-offset into the file where this section starts

§sh_size: u64

Section size in bytes

§sh_link: u32

Defined by section type

§sh_info: u32

Defined by section type

§sh_addralign: u64

address alignment

§sh_entsize: u64

size of an entry if section data is an array of entries

Trait Implementations§

source§

impl Clone for SectionHeader

source§

fn clone(&self) -> SectionHeader

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 Debug for SectionHeader

source§

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

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

impl ParseAt for SectionHeader

source§

fn parse_at<E: EndianParse>( endian: E, class: Class, offset: &mut usize, data: &[u8] ) -> Result<Self, ParseError>

Parse this type by using the given endian-awareness and ELF class layout. This is generic on EndianParse in order to allow users to optimize for their expectations of data layout. See EndianParse for more details.
source§

fn size_for(class: Class) -> usize

Returns the expected size of the type being parsed for the given ELF class
source§

fn validate_entsize(class: Class, entsize: usize) -> Result<usize, ParseError>

Checks whether the given entsize matches what we need to parse this type Read more
source§

impl PartialEq for SectionHeader

source§

fn eq(&self, other: &SectionHeader) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for SectionHeader

source§

impl Eq for SectionHeader

source§

impl StructuralEq for SectionHeader

source§

impl StructuralPartialEq for SectionHeader

Auto Trait Implementations§

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.