[PATCH] MIPS objdump: Add `eabi32` and `eabi64` ABI options

Anghelo Carvajal angheloalf95@gmail.com
Sun Feb 9 22:46:37 GMT 2025


From: angie <angheloalf95@gmail.com>

Extend gpr and fpr register names with names suitable for both EABIs.

Heavily inspired by the EABI documenation written by Eric Christopher,
which can be read at
https://sourceware.org/legacy-ml/binutils/2003-06/msg00436.html

Signed-off-by: Anghelo Carvajal <angheloalf95@gmail.com>
---
 opcodes/ChangeLog  |  6 ++++++
 opcodes/mips-dis.c | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 609e621dada..bdbe59461ce 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
+2025-02-09  Anghelo Carvajal  <angheloalf95@gmail.com>
+
+        * mips-dis.c (mips_fpr_names_eabi32): New variable.
+        (mips_fpr_names_eabi64): New variable.
+        (mips_abi_choices): Added "eabi32" and "eabi64" options.
+
 2025-01-19  Nick Clifton  <nickc@redhat.com>
 
 	* 2.44 Branch point.
diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
index befe353b663..cef67fef036 100644
--- a/opcodes/mips-dis.c
+++ b/opcodes/mips-dis.c
@@ -106,6 +106,22 @@ static const char * const mips_fpr_names_64[32] =
   "fs0",  "fs1",  "fs2",  "fs3",  "fs4",  "fs5",  "fs6",  "fs7"
 };
 
+static const char * const mips_fpr_names_eabi32[32] =
+{
+  "fv0",  "fv0f", "fv1",  "fv1f", "ft0",  "ft0f",  "ft1", "ft1f",
+  "ft2",  "ft2f", "ft3",  "ft3f", "fa0",  "fa0f",  "fa1", "fa1f",
+  "fa2",  "fa2f", "fa3",  "fa3f", "fs0",  "fs0f",  "fs1", "fs1f",
+  "fs2",  "fs2f", "fs3",  "fs3f", "fs4",  "fs4f",  "fs5", "fs5f",
+};
+
+static const char * const mips_fpr_names_eabi64[32] =
+{
+  "fv0",  "fv1",  "ft0",  "ft1",  "ft2",  "ft3",  "ft4",  "ft5",
+  "ft6",  "ft7",  "ft8",  "ft9",  "fa0",  "fa1",  "fa2",  "fa3",
+  "fa4",  "fa5",  "fa6",  "fa7",  "fs0",  "fs1",  "fs2",  "fs3",
+  "fs4",  "fs5",  "fs6",  "fs7",  "fs8",  "fs9",  "fs10", "fs11",
+};
+
 static const char * const mips_cp0_names_numeric[32] =
 {
   "$0",   "$1",   "$2",   "$3",   "$4",   "$5",   "$6",   "$7",
@@ -454,6 +470,8 @@ struct mips_abi_choice mips_abi_choices[] =
   { "32", mips_gpr_names_oldabi, mips_fpr_names_32 },
   { "n32", mips_gpr_names_newabi, mips_fpr_names_n32 },
   { "64", mips_gpr_names_newabi, mips_fpr_names_64 },
+  { "eabi32", mips_gpr_names_newabi, mips_fpr_names_eabi32 },
+  { "eabi64", mips_gpr_names_newabi, mips_fpr_names_eabi64 },
 };
 
 struct mips_arch_choice
-- 
2.34.1



More information about the Binutils mailing list