Struct object::read::Relocation
source · pub struct Relocation {
kind: RelocationKind,
encoding: RelocationEncoding,
size: u8,
target: RelocationTarget,
addend: i64,
implicit_addend: bool,
flags: RelocationFlags,
}
Expand description
A relocation entry.
Returned by Object::dynamic_relocations
or ObjectSection::relocations
.
Fields§
§kind: RelocationKind
§encoding: RelocationEncoding
§size: u8
§target: RelocationTarget
§addend: i64
§implicit_addend: bool
§flags: RelocationFlags
Implementations§
source§impl Relocation
impl Relocation
sourcepub fn kind(&self) -> RelocationKind
pub fn kind(&self) -> RelocationKind
The operation used to calculate the result of the relocation.
sourcepub fn encoding(&self) -> RelocationEncoding
pub fn encoding(&self) -> RelocationEncoding
Information about how the result of the relocation operation is encoded in the place.
sourcepub fn size(&self) -> u8
pub fn size(&self) -> u8
The size in bits of the place of the relocation.
If 0, then the size is determined by the relocation kind.
sourcepub fn target(&self) -> RelocationTarget
pub fn target(&self) -> RelocationTarget
The target of the relocation.
sourcepub fn set_addend(&mut self, addend: i64)
pub fn set_addend(&mut self, addend: i64)
Set the addend to use in the relocation calculation.
sourcepub fn has_implicit_addend(&self) -> bool
pub fn has_implicit_addend(&self) -> bool
Returns true if there is an implicit addend stored in the data at the offset to be relocated.
sourcepub fn flags(&self) -> RelocationFlags
pub fn flags(&self) -> RelocationFlags
Relocation flags that are specific to each file format.
The values returned by kind
, encoding
and size
are derived
from these flags.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Relocation
impl RefUnwindSafe for Relocation
impl Send for Relocation
impl Sync for Relocation
impl Unpin for Relocation
impl UnwindSafe for Relocation
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more