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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.