mirror of
https://github.com/encounter/objdiff.git
synced 2025-10-07 10:29:51 +00:00
[MIPS] Add support for the other ABIs supported by rabbitizer (#259)
* [MIPS] Add support for the other abis supported by rabbitizer * update test
This commit is contained in:
parent
97bcfe23d4
commit
e6035b00df
@ -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"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user