Add ARM logic for inferred function size padding

Resolves #237
This commit is contained in:
Luke Street 2025-08-15 14:48:26 -06:00
parent cff4be2979
commit 2c57e4960f

View File

@ -464,6 +464,22 @@ impl Arch for ArchArm {
}
flags
}
fn infer_function_size(
&self,
symbol: &Symbol,
section: &Section,
mut next_address: u64,
) -> Result<u64> {
// Trim any trailing 4-byte zeroes from the end (padding)
while next_address >= symbol.address + 4
&& let Some(data) = section.data_range(next_address - 4, 4)
&& data == [0u8; 4]
{
next_address -= 4;
}
Ok(next_address.saturating_sub(symbol.address))
}
}
#[derive(Clone, Copy, Debug)]