[binutils-gdb] MIPS: Add missing interAptiv MR2 machine type handling

Maciej W. Rozycki macro@sourceware.org
Sun Nov 8 18:44:47 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d8230037f50641b3697e672551b72aa0797f95dd

commit d8230037f50641b3697e672551b72aa0797f95dd
Author: Maciej W. Rozycki <macro@orcam.me.uk>
Date:   Sun Nov 8 18:28:22 2026 +0000

    MIPS: Add missing interAptiv MR2 machine type handling
    
    Complement commit 38bf472a1521 ("MIPS: Add Imagination interAptiv MR2
    MIPS32r3 processor support") and add missing AFL_EXT_INTERAPTIV_MR2 to
    machine type conversion in BFD and add interAptiv MR2 machine type to
    a.out and gold.

Diff:
---
 bfd/aoutx.h      |  1 +
 bfd/elfxx-mips.c |  1 +
 elfcpp/mips.h    |  6 +++++-
 gold/mips.cc     | 15 +++++++++++++++
 4 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index ee5512ce7f3..12950157ab1 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -818,6 +818,7 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
 	case bfd_mach_mips_octeon2:
 	case bfd_mach_mips_octeon3:
 	case bfd_mach_mips_xlr:
+	case bfd_mach_mips_interaptiv_mr2:
 	  /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc.  */
 	  arch_flags = M_MIPS2;
 	  break;
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index b89ff47652f..fd33ca2e0b2 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -14800,6 +14800,7 @@ bfd_mips_isa_ext_mach (unsigned int isa_ext)
     case AFL_EXT_OCTEON2:     return bfd_mach_mips_octeon2;
     case AFL_EXT_OCTEON3:     return bfd_mach_mips_octeon3;
     case AFL_EXT_XLR:	      return bfd_mach_mips_xlr;
+    case AFL_EXT_INTERAPTIV_MR2: return bfd_mach_mips_interaptiv_mr2;
     default:		      return bfd_mach_mips3000;
     }
 }
diff --git a/elfcpp/mips.h b/elfcpp/mips.h
index a1d838ceb0d..b202ed07223 100644
--- a/elfcpp/mips.h
+++ b/elfcpp/mips.h
@@ -228,6 +228,7 @@ enum
   EF_MIPS_MACH_OCTEON3 = 0x008e0000,
   EF_MIPS_MACH_5400 = 0x00910000,
   EF_MIPS_MACH_5900 = 0x00920000,
+  EF_MIPS_MACH_IAMR2 = 0x00930000,
   EF_MIPS_MACH_5500 = 0x00980000,
   EF_MIPS_MACH_9000 = 0x00990000,
   EF_MIPS_MACH_LS2E = 0x00A00000,
@@ -251,6 +252,7 @@ enum
   E_MIPS_MACH_OCTEON3 = EF_MIPS_MACH_OCTEON3,
   E_MIPS_MACH_5400    = EF_MIPS_MACH_5400,
   E_MIPS_MACH_5900    = EF_MIPS_MACH_5900,
+  E_MIPS_MACH_IAMR2   = EF_MIPS_MACH_IAMR2,
   E_MIPS_MACH_5500    = EF_MIPS_MACH_5500,
   E_MIPS_MACH_9000    = EF_MIPS_MACH_9000,
   E_MIPS_MACH_LS2E    = EF_MIPS_MACH_LS2E,
@@ -387,7 +389,9 @@ enum
   // ST Microelectronics Loongson 2F.
   AFL_EXT_LOONGSON_2F = 18,
   // Cavium Networks Octeon3.
-  AFL_EXT_OCTEON3 = 19
+  AFL_EXT_OCTEON3 = 19,
+  // Imagination interAptiv MR2.
+  AFL_EXT_INTERAPTIV_MR2 = 20
 };
 
 // Masks for the flags1 word of an ABI flags structure.
diff --git a/gold/mips.cc b/gold/mips.cc
index 46de404cda0..826ab8f76fc 100644
--- a/gold/mips.cc
+++ b/gold/mips.cc
@@ -3990,6 +3990,7 @@ class Target_mips : public Sized_target<size, big_endian>
     mach_mips_octeon2         = 6502,
     mach_mips_octeon3         = 6503,
     mach_mips_xlr             = 887682,   // decimal 'XLR'
+    mach_mips_interaptiv_mr2  = 736550,   // decimal 'IA2'
     mach_mipsisa32            = 32,
     mach_mipsisa32r2          = 33,
     mach_mipsisa32r3          = 34,
@@ -4196,6 +4197,9 @@ class Target_mips : public Sized_target<size, big_endian>
     this->add_extension(mach_mips4100, mach_mips4000);
     this->add_extension(mach_mips5900, mach_mips4000);
 
+    // MIPS32r2 extensions.
+    this->add_extension(mach_mips_interaptiv_mr2, mach_mipsisa32r2);
+
     // MIPS32 extensions.
     this->add_extension(mach_mipsisa32r2, mach_mipsisa32);
 
@@ -8920,6 +8924,9 @@ Target_mips<size, big_endian>::elf_mips_mach(elfcpp::Elf_Word flags)
     case elfcpp::EF_MIPS_MACH_XLR:
       return mach_mips_xlr;
 
+    case elfcpp::EF_MIPS_MACH_IAMR2:
+      return mach_mips_interaptiv_mr2;
+
     default:
       switch (flags & elfcpp::EF_MIPS_ARCH)
         {
@@ -9024,6 +9031,9 @@ Target_mips<size, big_endian>::mips_isa_ext_mach(unsigned int isa_ext)
     case elfcpp::AFL_EXT_XLR:
       return mach_mips_xlr;
 
+    case elfcpp::AFL_EXT_INTERAPTIV_MR2:
+      return mach_mips_interaptiv_mr2;
+
     default:
       return mach_mips3000;
     }
@@ -9091,6 +9101,9 @@ Target_mips<size, big_endian>::mips_isa_ext(unsigned int mips_mach)
     case mach_mips_xlr:
       return elfcpp::AFL_EXT_XLR;
 
+    case mach_mips_interaptiv_mr2:
+      return elfcpp::AFL_EXT_INTERAPTIV_MR2;
+
     default:
       return 0;
     }
@@ -12596,6 +12609,8 @@ Target_mips<size, big_endian>::elf_mips_mach_name(elfcpp::Elf_Word e_flags)
       return "mips:octeon3";
     case elfcpp::EF_MIPS_MACH_XLR:
       return "mips:xlr";
+    case elfcpp::EF_MIPS_MACH_IAMR2:
+      return "mips:interaptiv-mr2";
     default:
       switch (e_flags & elfcpp::EF_MIPS_ARCH)
         {


More information about the Binutils-cvs mailing list