Struct goblin::elf::reloc::Reloc
[−]
[src]
pub struct Reloc { pub r_offset: usize, pub r_addend: isize, pub r_sym: usize, pub r_type: u32, pub is_rela: bool, }
A unified ELF relocation structure
Fields
r_offset: usize
Address
r_addend: isize
Addend
r_sym: usize
The index into the corresponding symbol table - either dynamic or regular
r_type: u32
The relocation type
is_rela: bool
Whether this was constructed from a rela or rel relocation entry type
Methods
impl Reloc
[src]
fn size(is_rela: bool, ctx: Ctx) -> usize
[src]
fn parse(
bytes: &[u8],
offset: usize,
filesz: usize,
is_rela: bool,
ctx: Ctx
) -> Result<Vec<Reloc>>
[src]
bytes: &[u8],
offset: usize,
filesz: usize,
is_rela: bool,
ctx: Ctx
) -> Result<Vec<Reloc>>
Trait Implementations
impl From<Rela> for Reloc
[src]
impl From<Rel> for Reloc
[src]
impl From<Rela> for Reloc
[src]
impl From<Rel> for Reloc
[src]
impl Clone for Reloc
[src]
fn clone(&self) -> Reloc
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Reloc
[src]
impl PartialEq for Reloc
[src]
fn eq(&self, __arg_0: &Reloc) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Reloc) -> bool
[src]
This method tests for !=
.
impl Default for Reloc
[src]
impl SizeWith<(bool, Ctx)> for Reloc
[src]
type Units = usize
fn size_with(
(is_rela, Ctx { container: container, ... }): &(bool, Ctx)
) -> Self::Units
[src]
(is_rela, Ctx { container: container, ... }): &(bool, Ctx)
) -> Self::Units
impl<'a> TryFromCtx<'a, (bool, Ctx)> for Reloc
[src]
type Error = Error
type Size = usize
fn try_from_ctx(
bytes: &'a [u8],
(is_rela, Ctx { container: container, le: le }): (bool, Ctx)
) -> Result<(Self, Self::Size), Self::Error>
[src]
bytes: &'a [u8],
(is_rela, Ctx { container: container, le: le }): (bool, Ctx)
) -> Result<(Self, Self::Size), Self::Error>
impl TryIntoCtx<(bool, Ctx)> for Reloc
[src]
type Error = Error
type Size = usize
fn try_into_ctx(
self,
bytes: &mut [u8],
(is_rela, Ctx { container: container, le: le }): (bool, Ctx)
) -> Result<Self::Size, Self::Error>
[src]
self,
bytes: &mut [u8],
(is_rela, Ctx { container: container, le: le }): (bool, Ctx)
) -> Result<Self::Size, Self::Error>
Writes the relocation into bytes