mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-19 09:55:28 +00:00
Make function size inference logic arch-specific
For MIPS, account for delay slot nops. For x86, check for trailing nops (0x90). For PPC, check for 4-byte 0x00 padding. Resolves #229
This commit is contained in:
@@ -406,6 +406,15 @@ pub trait Arch: Send + Sync + Debug {
|
||||
) -> Vec<ContextItem> {
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
fn infer_function_size(
|
||||
&self,
|
||||
symbol: &Symbol,
|
||||
_section: &Section,
|
||||
next_address: u64,
|
||||
) -> Result<u64> {
|
||||
Ok(next_address.saturating_sub(symbol.address))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_arch(object: &object::File) -> Result<Box<dyn Arch>> {
|
||||
|
||||
Reference in New Issue
Block a user