[PATCH] MIPS: allow link o32 objects with mach mips64r6 and mips32r6

YunQiang Su yunqiang.su@cipunited.com
Tue Feb 7 02:44:24 GMT 2023


The `-32 -mips32r6` and `-32 mips64r6` option of gnu as
will generate objects with different mach attributes.

   0x90001407, noreorder, pic, cpic, nan2008, o32, mips32r6
vs
   0xa0001507, noreorder, pic, cpic, 32bitmode, nan2008, o32, mips64r6

Let's allow link them togather, just like we did for r2 ones.

bfd/ChangeLog:

	* elfxx-mips.c (mips_mach_extends_p): allow link o32 objects
	with mach mips64r6 and mips32r6.
---
 bfd/elfxx-mips.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index e9fb61ff9e7..1790b78e822 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -14600,6 +14600,10 @@ mips_mach_extends_p (unsigned long base, unsigned long extension)
       && mips_mach_extends_p (bfd_mach_mipsisa64r2, extension))
     return true;
 
+  if (base == bfd_mach_mipsisa32r6
+      && mips_mach_extends_p (bfd_mach_mipsisa64r6, extension))
+    return true;
+
   for (i = 0; i < ARRAY_SIZE (mips_mach_extensions); i++)
     if (extension == mips_mach_extensions[i].extension)
       {
-- 
2.30.2



More information about the Binutils mailing list