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 {
2727const EF_MIPS_ABI : u32 = 0x0000F000 ;
2828const EF_MIPS_MACH : u32 = 0x00FF0000 ;
2929
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 ;
3232
3333impl ObjArchMips {
3434 pub fn new ( object : & File ) -> Result < Self > {
@@ -38,13 +38,19 @@ impl ObjArchMips {
3838 FileFlags :: None => { }
3939 FileFlags :: Elf { e_flags, .. } => {
4040 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 ,
4242 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+ }
4450 } ;
4551 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 ,
4854 _ => InstrCategory :: CPU ,
4955 } ;
5056 }
You can’t perform that action at this time.
0 commit comments