MCPcopy Create free account
hub / github.com/eigenform/perfect / bare_relocation

Method bare_relocation

perfect/src/asm.rs:533–549  ·  view source on GitHub ↗
(&mut self, 
        target: usize, field_offset: u8, ref_offset: u8, 
        kind: Self::Relocation)

Source from the content-addressed store, hash-verified

531 }
532
533 fn bare_relocation(&mut self,
534 target: usize, field_offset: u8, ref_offset: u8,
535 kind: Self::Relocation)
536 {
537 let location = self.offset();
538 let loc = PatchLoc::new(location, 0, field_offset, ref_offset, kind);
539 //let cursor = self.ops.len();
540 //let buf = &mut self.ops[loc.range(cursor)];
541 let buf = &mut self.ops[loc.range(0)];
542 if loc.patch(buf, self.ptr as usize, target).is_err() {
543 self.error = Some(
544 DynasmError::ImpossibleRelocation(TargetKind::Extern(target))
545 )
546 } else if loc.needs_adjustment() {
547 self.managed.add(loc)
548 }
549 }
550}
551
552/// Utility functions you might want on something implementing [DynasmApi].

Callers

nothing calls this directly

Calls 2

addMethod · 0.80
offsetMethod · 0.45

Tested by

no test coverage detected