Struct goblin::mach::relocation::RelocationInfo

source ·
#[repr(C)]
pub struct RelocationInfo { pub r_address: i32, pub r_info: u32, }

Fields§

§r_address: i32

Offset in the section to what is being relocated

§r_info: u32

Contains all of the relocation info as a bitfield. r_symbolnum, 24 bits, r_pcrel 1 bit, r_length 2 bits, r_extern 1 bit, r_type 4 bits

Implementations§

source§

impl RelocationInfo

source

pub fn r_symbolnum(self) -> usize

Symbol index if r_extern == 1 or section ordinal if r_extern == 0. In bits :24

source

pub fn r_pcrel(self) -> u8

Was relocated pc relative already, 1 bit

source

pub fn r_length(self) -> u8

The length of the relocation, 0=byte, 1=word, 2=long, 3=quad, 2 bits

source

pub fn r_extern(self) -> u8

Does not include value of sym referenced, 1 bit

source

pub fn r_type(self) -> u8

Ff not 0, machine specific relocation type, in bits :4

source

pub fn is_extern(self) -> bool

If true, this relocation is for a symbol; if false, or a section ordinal otherwise

source

pub fn is_pic(self) -> bool

If true, this is a PIC relocation

source

pub fn to_str(self, cputype: CpuType) -> &'static str

Returns a string representation of this relocation, given the machine cputype

Trait Implementations§

source§

impl Clone for RelocationInfo

source§

fn clone(&self) -> RelocationInfo

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 RelocationInfo

source§

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

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

impl FromCtx<Endian> for RelocationInfo

source§

fn from_ctx(src: &[u8], ctx: Endian) -> Self

source§

impl<'a> IntoCtx<Endian> for &'a RelocationInfo

source§

fn into_ctx(self, dst: &mut [u8], ctx: Endian)

source§

impl IntoCtx<Endian> for RelocationInfo

source§

fn into_ctx(self, dst: &mut [u8], ctx: Endian)

source§

impl SizeWith<Endian> for RelocationInfo

source§

impl<'a> TryFromCtx<'a, Endian> for RelocationInfo
where RelocationInfo: 'a,

§

type Error = Error

source§

fn try_from_ctx( src: &'a [u8], ctx: Endian ) -> Result<(Self, usize), Self::Error>

source§

impl<'a> TryIntoCtx<Endian> for &'a RelocationInfo

§

type Error = Error

source§

fn try_into_ctx(self, dst: &mut [u8], ctx: Endian) -> Result<usize, Self::Error>

source§

impl TryIntoCtx<Endian> for RelocationInfo

§

type Error = Error

source§

fn try_into_ctx(self, dst: &mut [u8], ctx: Endian) -> Result<usize, Self::Error>

source§

impl Copy for RelocationInfo

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.