diff --git a/objdiff-core/src/arch/arm.rs b/objdiff-core/src/arch/arm.rs index 279cecb..b36b5b7 100644 --- a/objdiff-core/src/arch/arm.rs +++ b/objdiff-core/src/arch/arm.rs @@ -216,7 +216,6 @@ impl ObjArch for ObjArchArm { mnemonic: Cow::Borrowed(parsed_ins.mnemonic), args, reloc, - fake_pool_reloc: None, branch_dest, line, formatted: parsed_ins.display(display_options).to_string(), diff --git a/objdiff-core/src/arch/arm64.rs b/objdiff-core/src/arch/arm64.rs index ae78f8a..7e396fa 100644 --- a/objdiff-core/src/arch/arm64.rs +++ b/objdiff-core/src/arch/arm64.rs @@ -59,7 +59,6 @@ impl ObjArch for ObjArchArm64 { mnemonic: Cow::Borrowed(""), args: vec![], reloc: None, - fake_pool_reloc: None, branch_dest: None, line: None, formatted: "".to_string(), @@ -122,7 +121,6 @@ impl ObjArch for ObjArchArm64 { mnemonic: Cow::Borrowed(mnemonic), args, reloc, - fake_pool_reloc: None, branch_dest, line, formatted: ins.to_string(), diff --git a/objdiff-core/src/arch/mips.rs b/objdiff-core/src/arch/mips.rs index c2c28d1..4bb3be0 100644 --- a/objdiff-core/src/arch/mips.rs +++ b/objdiff-core/src/arch/mips.rs @@ -205,7 +205,6 @@ impl ObjArch for ObjArchMips { mnemonic: Cow::Borrowed(mnemonic), args, reloc: reloc.cloned(), - fake_pool_reloc: None, branch_dest, line, formatted, diff --git a/objdiff-core/src/arch/ppc.rs b/objdiff-core/src/arch/ppc.rs index 7e49267..3768a53 100644 --- a/objdiff-core/src/arch/ppc.rs +++ b/objdiff-core/src/arch/ppc.rs @@ -150,8 +150,7 @@ impl ObjArch for ObjArchPpc { size: 4, mnemonic: Cow::Borrowed(simplified.mnemonic), args, - reloc: reloc.cloned(), - fake_pool_reloc: fake_pool_reloc_for_addr.get(&cur_addr).cloned(), + reloc: reloc.or(fake_pool_reloc_for_addr.get(&cur_addr)).cloned(), op: ins.op as u16, branch_dest, line, @@ -195,12 +194,7 @@ impl ObjArch for ObjArchPpc { } fn guess_data_type(&self, instruction: &ObjIns) -> Option { - if instruction - .reloc - .as_ref() - .or(instruction.fake_pool_reloc.as_ref()) - .is_some_and(|r| r.target.name.starts_with("@stringBase")) - { + if instruction.reloc.as_ref().is_some_and(|r| r.target.name.starts_with("@stringBase")) { return Some(DataType::String); } diff --git a/objdiff-core/src/arch/x86.rs b/objdiff-core/src/arch/x86.rs index 33c6675..82399fb 100644 --- a/objdiff-core/src/arch/x86.rs +++ b/objdiff-core/src/arch/x86.rs @@ -54,7 +54,6 @@ impl ObjArch for ObjArchX86 { mnemonic: Cow::Borrowed(""), args: vec![], reloc: None, - fake_pool_reloc: None, branch_dest: None, line: None, formatted: String::new(), @@ -80,7 +79,6 @@ impl ObjArch for ObjArchX86 { mnemonic: Cow::Borrowed(""), args: vec![], reloc: reloc.cloned(), - fake_pool_reloc: None, branch_dest: None, line, formatted: String::new(), diff --git a/objdiff-core/src/diff/code.rs b/objdiff-core/src/diff/code.rs index b5c0fad..e645a24 100644 --- a/objdiff-core/src/diff/code.rs +++ b/objdiff-core/src/diff/code.rs @@ -31,7 +31,7 @@ pub fn process_code_symbol( )?; for inst in res.insts.iter_mut() { - if let Some(reloc) = &mut inst.fake_pool_reloc { + if let Some(reloc) = &mut inst.reloc { if reloc.target.size == 0 && reloc.target.name.is_empty() { // Fake target symbol we added as a placeholder. We need to find the real one. if let Some(real_target) = diff --git a/objdiff-core/src/obj/mod.rs b/objdiff-core/src/obj/mod.rs index 800259d..1ef6d0f 100644 --- a/objdiff-core/src/obj/mod.rs +++ b/objdiff-core/src/obj/mod.rs @@ -106,7 +106,6 @@ pub struct ObjIns { pub mnemonic: Cow<'static, str>, pub args: Vec, pub reloc: Option, - pub fake_pool_reloc: Option, pub branch_dest: Option, /// Line number pub line: Option, diff --git a/objdiff-gui/src/views/function_diff.rs b/objdiff-gui/src/views/function_diff.rs index d555065..df18958 100644 --- a/objdiff-gui/src/views/function_diff.rs +++ b/objdiff-gui/src/views/function_diff.rs @@ -118,7 +118,7 @@ fn ins_hover_ui( } } - if let Some(reloc) = ins.reloc.as_ref().or(ins.fake_pool_reloc.as_ref()) { + if let Some(reloc) = &ins.reloc { ui.label(format!("Relocation type: {}", obj.arch.display_reloc(reloc.flags))); let addend_str = match reloc.addend.cmp(&0i64) { Ordering::Greater => format!("+{:x}", reloc.addend),