[][src]Struct metagoblin::mach::relocation::RelocationInfo

#[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

impl RelocationInfo[src]

pub fn r_symbolnum(self) -> usize[src]

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

pub fn r_pcrel(self) -> u8[src]

Was relocated pc relative already, 1 bit

pub fn r_length(self) -> u8[src]

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

pub fn r_extern(self) -> u8[src]

Does not include value of sym referenced, 1 bit

pub fn r_type(self) -> u8[src]

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

pub fn is_extern(self) -> bool[src]

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

pub fn is_pic(self) -> bool[src]

If true, this is a PIC relocation

pub fn to_str(self, cputype: u32) -> &'static str[src]

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

Trait Implementations

impl Clone for RelocationInfo[src]

impl Copy for RelocationInfo[src]

impl Debug for RelocationInfo[src]

impl FromCtx<Endian, [u8]> for RelocationInfo[src]

impl<'a> IntoCtx<Endian, [u8]> for &'a RelocationInfo[src]

impl IntoCtx<Endian, [u8]> for RelocationInfo[src]

impl SizeWith<Endian> for RelocationInfo[src]

impl<'a> TryFromCtx<'a, Endian, [u8]> for RelocationInfo where
    RelocationInfo: 'a, 
[src]

type Error = Error

impl<'a> TryIntoCtx<Endian, [u8]> for &'a RelocationInfo[src]

type Error = Error

impl TryIntoCtx<Endian, [u8]> for RelocationInfo[src]

type Error = Error

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.