From 9bced4838d99be42dd3ebc22e97c69b394f6439f Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Tue, 9 Sep 2025 17:48:51 -0300 Subject: [PATCH 1/2] [MIPS] Add support for the other abis supported by rabbitizer --- objdiff-core/config-schema.json | 12 ++++++++++++ objdiff-core/src/arch/mips.rs | 10 ++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/objdiff-core/config-schema.json b/objdiff-core/config-schema.json index 2a307ab4..9dd46d38 100644 --- a/objdiff-core/config-schema.json +++ b/objdiff-core/config-schema.json @@ -158,6 +158,10 @@ "value": "o32", "name": "O32" }, + { + "value": "o64", + "name": "O64" + }, { "value": "n32", "name": "N32" @@ -165,6 +169,14 @@ { "value": "n64", "name": "N64" + }, + { + "value": "eabi32", + "name": "eabi32" + }, + { + "value": "eabi64", + "name": "eabi64" } ] }, diff --git a/objdiff-core/src/arch/mips.rs b/objdiff-core/src/arch/mips.rs index 51a34b04..134e2f1b 100644 --- a/objdiff-core/src/arch/mips.rs +++ b/objdiff-core/src/arch/mips.rs @@ -46,8 +46,11 @@ impl ArchMips { object::FileFlags::None => {} object::FileFlags::Elf { e_flags, .. } => { abi = match e_flags & EF_MIPS_ABI { - elf::EF_MIPS_ABI_O32 | elf::EF_MIPS_ABI_O64 => Abi::O32, - elf::EF_MIPS_ABI_EABI32 | elf::EF_MIPS_ABI_EABI64 => Abi::N32, + elf::EF_MIPS_ABI_O32 => Abi::O32, + elf::EF_MIPS_ABI_O64 if e_flags & elf::EF_MIPS_ABI2 != 0 => Abi::N64, + elf::EF_MIPS_ABI_O64 => Abi::O64, + elf::EF_MIPS_ABI_EABI32 => Abi::EABI32, + elf::EF_MIPS_ABI_EABI64 => Abi::EABI64, _ => { if e_flags & elf::EF_MIPS_ABI2 != 0 { Abi::N32 @@ -170,8 +173,11 @@ impl ArchMips { .with_abi(match diff_config.mips_abi { MipsAbi::Auto => self.abi, MipsAbi::O32 => Abi::O32, + MipsAbi::O64 => Abi::O64, MipsAbi::N32 => Abi::N32, MipsAbi::N64 => Abi::N64, + MipsAbi::Eabi32 => Abi::EABI32, + MipsAbi::Eabi64 => Abi::EABI64, }) } From 4b3d221f9fb342fb89e1b8c3b82c4923f2784fcf Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Tue, 9 Sep 2025 18:17:19 -0300 Subject: [PATCH 2/2] update test --- objdiff-core/tests/snapshots/arch_mips__read_mips.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/objdiff-core/tests/snapshots/arch_mips__read_mips.snap b/objdiff-core/tests/snapshots/arch_mips__read_mips.snap index dd4de0da..f6fdc199 100644 --- a/objdiff-core/tests/snapshots/arch_mips__read_mips.snap +++ b/objdiff-core/tests/snapshots/arch_mips__read_mips.snap @@ -1,12 +1,12 @@ --- source: objdiff-core/tests/arch_mips.rs -assertion_line: 10 +assertion_line: 12 expression: obj --- Object { arch: ArchMips { endianness: Little, - abi: N32, + abi: EABI64, isa_extension: Some( R5900EE, ),