Struct dynasmrt::components::PatchLoc [−][src]
pub struct PatchLoc<R: Relocation> {
pub location: AssemblyOffset,
pub field_offset: u8,
pub ref_offset: u8,
pub relocation: R,
pub target_offset: isize,
}
Expand description
An abstraction of a relocation of type R
, located at location
.
Fields
location: AssemblyOffset
The AssemblyOffset at which this relocation was emitted
field_offset: u8
The offset, backwards, from location that the actual field to be modified starts at
ref_offset: u8
The offset, backwards, to be subtracted from location to get the address that the relocation should be calculated relative to.
relocation: R
The type of relocation to be emitted.
target_offset: isize
A constant offset added to the destination address of this relocation when it is calculated.
Implementations
create a new PatchLoc
Returns a range that covers the entire relocation in its assembling buffer
buf_offset
is a value that is subtracted from this range when the buffer you want to slice
with this range is only a part of a bigger buffer.
Returns the actual value that should be inserted at the relocation site.
Patch buffer
so that this relocation patch will point to target
.
buf_addr
is the address that the assembling buffer will come to reside at when it is assembled.
target
is the offset that this relocation will be targetting.
Patch buffer
so that this relocation will still point to the right location due to a change in the address of the containing buffer.
buffer
is a subsection of a larger buffer, located at offset buf_offset
in this larger buffer.
adjustment
is new_buf_addr - old_buf_addr
.
Returns if this patch requires adjustment when the address of the buffer it resides in is altered.
Trait Implementations
Auto Trait Implementations
impl<R> RefUnwindSafe for PatchLoc<R> where
R: RefUnwindSafe,
impl<R> UnwindSafe for PatchLoc<R> where
R: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more