lief::elf::binary

Enum PhdrReloc

pub enum PhdrReloc {
    AUTO,
    PIE_SHIFT,
    BSS_END,
    BINARY_END,
    SEGMENT_GAP,
    EXEC_BACKWARD,
    SECTIONS_SHIFT,
    Unknown(u32),
}
Expand description

Strategy used for relocating the PHDR table

Variants§

§

AUTO

Let LIEF choose the best strategy

§

PIE_SHIFT

Shift content after the PHDR table (PIE binaries only)

§

BSS_END

Relocate the PHDR after the first BSS-like segment

§

BINARY_END

Relocate at the end of the binary

§

SEGMENT_GAP

Relocate between two LOAD segments

§

EXEC_BACKWARD

Duplicate the ELF header and the PHDR table in a page inserted before the first LOAD segment (non-PIE executables only). The original content keeps its virtual addresses

§

SECTIONS_SHIFT

Grow the PHDR table by shifting known section in the first LOAD segment. Code and data keep their virtual addresses but this strategy assumes that the sections are consistent and not corrupted.

If the underlying code (or data) references the beginning of the first segment or tricks the ELF sections, you must fallback to PIE_SHIFT.
§

Unknown(u32)

Trait Implementations§

§

impl Clone for PhdrReloc

§

fn clone(&self) -> PhdrReloc

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
§

impl Debug for PhdrReloc

§

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

Formats the value using the given formatter. Read more
§

impl From<PhdrReloc> for u32

§

fn from(value: PhdrReloc) -> Self

Converts to this type from the input type.
§

impl From<u32> for PhdrReloc

§

fn from(value: u32) -> Self

Converts to this type from the input type.
§

impl Hash for PhdrReloc

§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl PartialEq for PhdrReloc

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl Copy for PhdrReloc

§

impl Eq for PhdrReloc

§

impl StructuralPartialEq for PhdrReloc

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

Source§

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>,

Source§

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>,

Source§

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.