Support MIPS 32 and 64 abi simultaneously for mips architecture

The original implementation only support MIPS 32. Extend it to
support MIPS 64 too.

Change-Id: Ibd11d93f448c87a5643d23014f07dcd9eb420544
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Huixiong Cao
2019-06-18 06:51:24 +08:00
committed by Orgad Shaneh
parent df8b62c6fa
commit eb7efec934

View File

@@ -360,9 +360,11 @@ static Abis abiOf(const QByteArray &data)
case 3: // EM_386 case 3: // EM_386
result.append(Abi(Abi::X86Architecture, os, flavor, Abi::ElfFormat, 32)); result.append(Abi(Abi::X86Architecture, os, flavor, Abi::ElfFormat, 32));
break; break;
case 8: // EM_MIPS case 8: { // EM_MIPS
result.append(Abi(Abi::MipsArchitecture, os, flavor, Abi::ElfFormat, 32)); const int width = getUint8(data, 4) == 2 ? 64 : 32;
result.append(Abi(Abi::MipsArchitecture, os, flavor, Abi::ElfFormat, width));
break; break;
}
case 20: // EM_PPC case 20: // EM_PPC
result.append(Abi(Abi::PowerPCArchitecture, os, flavor, Abi::ElfFormat, 32)); result.append(Abi(Abi::PowerPCArchitecture, os, flavor, Abi::ElfFormat, 32));
break; break;