Experimental objdiff-cli (WIP)

This commit is contained in:
Luke Street
2024-02-27 18:47:51 -07:00
parent 4eba5f71b0
commit 9a7d2bcebf
23 changed files with 1541 additions and 501 deletions
+11 -7
View File
@@ -78,13 +78,17 @@ pub fn process_code(
ObjRelocKind::PpcAddr16Hi
| ObjRelocKind::PpcAddr16Ha
| ObjRelocKind::PpcAddr16Lo => {
let arg = args.iter_mut().rfind(|a| is_rel_abs_arg(a)).ok_or_else(|| {
anyhow::Error::msg("Failed to locate rel/abs arg for reloc")
})?;
*arg = if is_offset_arg(arg) {
ObjInsArg::RelocWithBase
} else {
ObjInsArg::Reloc
match args.iter_mut().rfind(|a| is_rel_abs_arg(a)) {
Some(arg) => {
*arg = if is_offset_arg(arg) {
ObjInsArg::RelocWithBase
} else {
ObjInsArg::Reloc
};
}
None => {
log::warn!("Failed to locate rel/abs arg for reloc");
}
};
}
_ => {}