Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-2734 added opinions for MIPS EABI and missing o32, n32, o64

emteereba96e7841e05
diff --git a/Ghidra/Processors/MIPS/data/languages/MIPS.opinion b/Ghidra/Processors/MIPS/data/languages/MIPS.opinion
index a739a3631f..00a1625f2a 100644
--- a/Ghidra/Processors/MIPS/data/languages/MIPS.opinion
+++ b/Ghidra/Processors/MIPS/data/languages/MIPS.opinion
@@ -98,10 +98,19 @@ Elf e_flags are used for the secondary attribute, the following are pulled from
<constraint primary="8,10" processor="MIPS" size="32" variant="default"
secondary= "0b 01.1 ..00 .... .... 00.1 0.0. 0000 ...."/>
- <!-- MIPS32-R1 and -R2, with microMIPS, don't cares: MDMX, EABI, FPU -->
+ <!-- MIPS32-R1 and -R2, don't cares: MDMX, MIPS16e, FPU -->
+ <constraint primary="8,10" processor="MIPS" size="32" variant="default" compilerSpecID="eabi"
+ secondary= "0b 01.1 ..00 .... .... 0011 0.0. 0000 ...."/>
+
+
+ <!-- MIPS32-R1 and -R2, with microMIPS, don't cares: MDMX, EABI, FPU -->
<constraint primary="8,10" processor="MIPS" size="32" variant="micro"
secondary= "0b 0111 .010 .... .... 00.1 0.0. 0000 ...."/>
+ <!-- MIPS32-R1 and -R2, with microMIPS, don't cares: MDMX, FPU -->
+ <constraint primary="8,10" processor="MIPS" size="32" variant="micro" compilerSpecID="eabi"
+ secondary= "0b 0111 .010 .... .... 0011 0.0. 0000 ...."/>
+
<!-- MIPS64 Pre-Release 6 -->
<!-- MIPS64-R1 with 32-bit addresses, don't cares: MDMX, MIPS16e, EABI, FPU -->
<constraint primary="8,10" processor="MIPS" size="32" variant="64-32addr"
@@ -113,7 +122,23 @@ Elf e_flags are used for the secondary attribute, the following are pulled from
<!-- MIPS64-R2 with 32-bit addresses, don't cares: MDMX, MIPS16e, EABI, FPU -->
<constraint primary="8,10" processor="MIPS" size="32" variant="64-32addr"
- secondary= "0b 1000 ..00 .... .... 0... 0.0. 00.0 ...."/>
+ secondary= "0b 1000 ..00 .... .... 0... 0.0. 0000 ...."/>
+
+ <!-- MIPS64-R2 with 32-bit addresses, n32 don't cares: MDMX, MIPS16e, FPU -->
+ <constraint primary="8,10" processor="MIPS" size="32" variant="64-32addr" compilerSpecID="n32"
+ secondary= "0b 1000 ..00 .... .... 0... 0.0. 0010 ...."/>
+
+ <!-- MIPS64-R2 with 32-bit addresses, o32 don't cares: MDMX, MIPS16e, FPU -->
+ <constraint primary="8,10" processor="MIPS" size="32" variant="64-32addr" compilerSpecID="o32"
+ secondary= "0b 1000 ..00 .... .... 0.01 0.0. 0000 ...."/>
+
+ <!-- MIPS64-R2 with 32-bit addresses, o64 don't cares: MDMX, MIPS16e, FPU -->
+ <constraint primary="8,10" processor="MIPS" size="32" variant="64-32addr" compilerSpecID="o64"
+ secondary= "0b 1000 ..00 .... .... 0.10 0.0. 0000 ...."/>
+
+ <!-- MIPS64-R2 with 32-bit addresses, eabi don't cares: MDMX, MIPS16e, FPU -->
+ <constraint primary="8,10" processor="MIPS" size="32" variant="64-32addr" compilerSpecID="eabi"
+ secondary= "0b 1000 ..00 .... .... 0.11 0.0. 0000 ...."/>
<!-- MIPS64-R2 with 32-bit addresses and with micromips -->
<constraint primary="8,10" processor="MIPS" size="32" variant="64-32addr-micro"