| 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]. |