From eb7efec9349b39ef97bd79834434dbde06587290 Mon Sep 17 00:00:00 2001 From: Huixiong Cao Date: Tue, 18 Jun 2019 06:51:24 +0800 Subject: [PATCH] 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 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/abi.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 10134096d9c..7c61260b54e 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -360,9 +360,11 @@ static Abis abiOf(const QByteArray &data) case 3: // EM_386 result.append(Abi(Abi::X86Architecture, os, flavor, Abi::ElfFormat, 32)); break; - case 8: // EM_MIPS - result.append(Abi(Abi::MipsArchitecture, os, flavor, Abi::ElfFormat, 32)); + case 8: { // EM_MIPS + const int width = getUint8(data, 4) == 2 ? 64 : 32; + result.append(Abi(Abi::MipsArchitecture, os, flavor, Abi::ElfFormat, width)); break; + } case 20: // EM_PPC result.append(Abi(Abi::PowerPCArchitecture, os, flavor, Abi::ElfFormat, 32)); break;