File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ pub struct ObjArchMips {
27
27
const EF_MIPS_ABI : u32 = 0x0000F000 ;
28
28
const EF_MIPS_MACH : u32 = 0x00FF0000 ;
29
29
30
- const E_MIPS_MACH_ALLEGREX : u32 = 0x00840000 ;
31
- const E_MIPS_MACH_5900 : u32 = 0x00920000 ;
30
+ const EF_MIPS_MACH_ALLEGREX : u32 = 0x00840000 ;
31
+ const EF_MIPS_MACH_5900 : u32 = 0x00920000 ;
32
32
33
33
impl ObjArchMips {
34
34
pub fn new ( object : & File ) -> Result < Self > {
@@ -38,13 +38,19 @@ impl ObjArchMips {
38
38
FileFlags :: None => { }
39
39
FileFlags :: Elf { e_flags, .. } => {
40
40
abi = match e_flags & EF_MIPS_ABI {
41
- elf:: EF_MIPS_ABI_O32 => Abi :: O32 ,
41
+ elf:: EF_MIPS_ABI_O32 | elf :: EF_MIPS_ABI_O64 => Abi :: O32 ,
42
42
elf:: EF_MIPS_ABI_EABI32 | elf:: EF_MIPS_ABI_EABI64 => Abi :: N32 ,
43
- _ => Abi :: NUMERIC ,
43
+ _ => {
44
+ if e_flags & elf:: EF_MIPS_ABI2 != 0 {
45
+ Abi :: N32
46
+ } else {
47
+ Abi :: NUMERIC
48
+ }
49
+ }
44
50
} ;
45
51
instr_category = match e_flags & EF_MIPS_MACH {
46
- E_MIPS_MACH_ALLEGREX => InstrCategory :: R4000ALLEGREX ,
47
- E_MIPS_MACH_5900 => InstrCategory :: R5900 ,
52
+ EF_MIPS_MACH_ALLEGREX => InstrCategory :: R4000ALLEGREX ,
53
+ EF_MIPS_MACH_5900 => InstrCategory :: R5900 ,
48
54
_ => InstrCategory :: CPU ,
49
55
} ;
50
56
}
You can’t perform that action at this time.
0 commit comments