#[repr(C)]pub struct Relocation {
pub offset: Integer<LittleEndian<u16>, AlignAs<2>>,
pub segment: Integer<LittleEndian<u16>, AlignAs<2>>,
}
Expand description
Relocation Information
This structure describes an entry of the relocation table. Each entry points into the program code, at a 2-byte value that must be adjusted with the start-segment before the program is run. The value of the start-segment is simply added to each location pointed at by the relocation table.
A single location is described by its segment relative to the start of the program, as well as the offset inside that segment.
Fields§
§offset: Integer<LittleEndian<u16>, AlignAs<2>>
Offset of the relocation target relative to the specified segment.
segment: Integer<LittleEndian<u16>, AlignAs<2>>
Segment of the relocation target relative to the start of the code.
Implementations§
Source§impl Relocation
impl Relocation
Sourcepub fn from_bytes(data: &[u8; 4]) -> Self
pub fn from_bytes(data: &[u8; 4]) -> Self
Import a relocation entry from a byte slice
Create a new relocation structure from data copied from a byte slice. No byte-order conversions are applied.
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