MCPcopy Index your code
hub / github.com/encounter/objdiff / infer_function_size

Method infer_function_size

objdiff-core/src/arch/ppc/mod.rs:462–477  ·  view source on GitHub ↗
(
        &self,
        symbol: &Symbol,
        section: &Section,
        mut next_address: u64,
    )

Source from the content-addressed store, hash-verified

460 }
461
462 fn infer_function_size(
463 &self,
464 symbol: &Symbol,
465 section: &Section,
466 mut next_address: u64,
467 ) -> Result<u64> {
468 // Trim any trailing 4-byte zeroes from the end (padding)
469 while next_address >= symbol.address + 4
470 && let Some(data) = section.data_range(next_address - 4, 4)
471 && data == [0u8; 4]
472 && section.relocation_at(next_address - 4, 4).is_none()
473 {
474 next_address -= 4;
475 }
476 Ok(next_address.saturating_sub(symbol.address))
477 }
478
479 fn post_init(&mut self, _sections: &[Section], _symbols: &[Symbol], symbol_indices: &[usize]) {
480 // Change the indices used as keys from the original symbol indices to the new symbol array indices

Callers

nothing calls this directly

Calls 3

data_rangeMethod · 0.80
is_noneMethod · 0.80
relocation_atMethod · 0.80

Tested by

no test coverage detected