diff options
| author | Josh Ferrell <josh@vector35.com> | 2024-08-26 12:07:04 -0400 |
|---|---|---|
| committer | Alexander Taylor <alex@vector35.com> | 2024-08-30 14:45:22 -0400 |
| commit | d92df755105a32d6a9088c09d7f2f73f282decb2 (patch) | |
| tree | f1bbf0d67cb5b713fce6284fab3f9a7f12daccf8 /arch/mips/arch_mips.cpp | |
| parent | fe0d4ae2c3baa26fca84a9a8cb9670955bdfea12 (diff) | |
Add support for loading mipsel64 files
Diffstat (limited to 'arch/mips/arch_mips.cpp')
| -rw-r--r-- | arch/mips/arch_mips.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/mips/arch_mips.cpp b/arch/mips/arch_mips.cpp index 1632b165..286ae6de 100644 --- a/arch/mips/arch_mips.cpp +++ b/arch/mips/arch_mips.cpp @@ -3240,17 +3240,20 @@ extern "C" Architecture* mipsel = new MipsArchitecture("mipsel32", LittleEndian, 32); Architecture* mipseb = new MipsArchitecture("mips32", BigEndian, 32); + Architecture* mips64el = new MipsArchitecture("mipsel64", LittleEndian, 64); Architecture* mips64eb = new MipsArchitecture("mips64", BigEndian, 64); Architecture* cnmips64eb = new MipsArchitecture("cavium-mips64", BigEndian, 64, DECOMPOSE_FLAGS_CAVIUM); Architecture::Register(mipsel); Architecture::Register(mipseb); + Architecture::Register(mips64el); Architecture::Register(mips64eb); Architecture::Register(cnmips64eb); /* calling conventions */ MipsO32CallingConvention* o32LE = new MipsO32CallingConvention(mipsel); MipsO32CallingConvention* o32BE = new MipsO32CallingConvention(mipseb); + MipsN64CallingConvention* n64LE = new MipsN64CallingConvention(mips64el); MipsN64CallingConvention* n64BE = new MipsN64CallingConvention(mips64eb); MipsN64CallingConvention* n64BEc = new MipsN64CallingConvention(cnmips64eb); @@ -3258,6 +3261,8 @@ extern "C" mipseb->RegisterCallingConvention(o32BE); mipsel->SetDefaultCallingConvention(o32LE); mipseb->SetDefaultCallingConvention(o32BE); + mips64el->RegisterCallingConvention(n64LE); + mips64el->SetDefaultCallingConvention(n64LE); mips64eb->RegisterCallingConvention(n64BE); mips64eb->SetDefaultCallingConvention(n64BE); cnmips64eb->RegisterCallingConvention(n64BEc); @@ -3270,6 +3275,7 @@ extern "C" mipsel->RegisterCallingConvention(new MipsLinuxRtlResolveCallingConvention(mipsel)); mipseb->RegisterCallingConvention(new MipsLinuxRtlResolveCallingConvention(mipseb)); + mips64el->RegisterCallingConvention(new MipsLinuxRtlResolveCallingConvention(mips64el)); mips64eb->RegisterCallingConvention(new MipsLinuxRtlResolveCallingConvention(mips64eb)); cnmips64eb->RegisterCallingConvention(new MipsLinuxRtlResolveCallingConvention(cnmips64eb)); @@ -3279,6 +3285,7 @@ extern "C" mipsel->RegisterRelocationHandler("ELF", new MipsElfRelocationHandler()); mipseb->RegisterRelocationHandler("ELF", new MipsElfRelocationHandler()); + mips64el->RegisterRelocationHandler("ELF", new MipsElfRelocationHandler()); mips64eb->RegisterRelocationHandler("ELF", new MipsElfRelocationHandler()); cnmips64eb->RegisterRelocationHandler("ELF", new MipsElfRelocationHandler()); @@ -3292,13 +3299,17 @@ extern "C" #define EI_CLASS_64 (2) #define ARCH_ID_MIPS32 ((EI_CLASS_32<<16)|EM_MIPS) /* 0x10008 */ #define ARCH_ID_MIPS64 ((EI_CLASS_64<<16)|EM_MIPS) /* 0x20008 */ + BinaryViewType::RegisterArchitecture("ELF", ARCH_ID_MIPS64, LittleEndian, mips64el); BinaryViewType::RegisterArchitecture("ELF", ARCH_ID_MIPS64, BigEndian, mips64eb); BinaryViewType::RegisterArchitecture("ELF", ARCH_ID_MIPS32, LittleEndian, mipsel); BinaryViewType::RegisterArchitecture("ELF", ARCH_ID_MIPS32, BigEndian, mipseb); Ref<BinaryViewType> elf = BinaryViewType::GetByName("ELF"); if (elf) + { + elf->RegisterPlatformRecognizer(ARCH_ID_MIPS64, LittleEndian, ElfFlagsRecognize); elf->RegisterPlatformRecognizer(ARCH_ID_MIPS64, BigEndian, ElfFlagsRecognize); + } BinaryViewType::RegisterArchitecture("PE", 0x166, LittleEndian, mipsel); return true; |
