(
&mut self,
labeled: bool,
func: &[u8],
align: u32,
ctrl_plane: &mut ControlPlane,
)
| 2482 | |
| 2483 | impl<I: VCodeInst> TextSectionBuilder for MachTextSectionBuilder<I> { |
| 2484 | fn append( |
| 2485 | &mut self, |
| 2486 | labeled: bool, |
| 2487 | func: &[u8], |
| 2488 | align: u32, |
| 2489 | ctrl_plane: &mut ControlPlane, |
| 2490 | ) -> u64 { |
| 2491 | // Conditionally emit an island if it's necessary to resolve jumps |
| 2492 | // between functions which are too far away. |
| 2493 | let size = func.len() as u32; |
| 2494 | if self.force_veneers == ForceVeneers::Yes || self.buf.island_needed(size) { |
| 2495 | self.buf |
| 2496 | .emit_island_maybe_forced(self.force_veneers, size, ctrl_plane); |
| 2497 | } |
| 2498 | |
| 2499 | self.buf.align_to(align); |
| 2500 | let pos = self.buf.cur_offset(); |
| 2501 | if labeled { |
| 2502 | self.buf.bind_label( |
| 2503 | MachLabel::from_block(BlockIndex::new(self.next_func)), |
| 2504 | ctrl_plane, |
| 2505 | ); |
| 2506 | self.next_func += 1; |
| 2507 | } |
| 2508 | self.buf.put_data(func); |
| 2509 | u64::from(pos) |
| 2510 | } |
| 2511 | |
| 2512 | fn resolve_reloc(&mut self, offset: u64, reloc: Reloc, addend: Addend, target: usize) -> bool { |
| 2513 | crate::trace!( |
nothing calls this directly
no test coverage detected