[PATCH 1/2] MIPS: Add n32 VECs to non-vendor elf targets

YunQiang Su yunqiang.su@cipunited.com
Mon Jun 5 10:22:24 GMT 2023


For triples mips*-elf without vendor, such as mipsisa32r2el-elf,
mipstx39-elf, the NUBI is used. These targets use non-trad VECs.

Currently, N32 VECs are missing from targ_selvecs in bfd/config.bfd.
Let's add them.

This patch also fixes gas testcases for these targets.

bfd:
	* config.bfd (mips*-*-elf*): add N32 VECs.
	(mips*el-*-elf*): Ditto.
---
 bfd/config.bfd                           | 4 ++--
 gas/testsuite/gas/mips/comdat-reloc-r6.d | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bfd/config.bfd b/bfd/config.bfd
index 78752994456..2927f35b614 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -923,11 +923,11 @@ case "${targ}" in
     ;;
   mips*el-*-elf* | mips*-*-chorus*)
     targ_defvec=mips_elf32_le_vec
-    targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec"
+    targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec mips_elf32_n_be_vec mips_elf32_n_le_vec"
     ;;
   mips*-*-elf* | mips*-*-rtems* | mips*-*-windiss | mips*-*-none)
     targ_defvec=mips_elf32_be_vec
-    targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
+    targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_elf32_n_be_vec mips_elf32_n_le_vec"
     ;;
   mips64*-*-openbsd*)
     targ_defvec=mips_elf64_trad_be_vec
diff --git a/gas/testsuite/gas/mips/comdat-reloc-r6.d b/gas/testsuite/gas/mips/comdat-reloc-r6.d
index 513589e73d3..f7d9a4e57c0 100644
--- a/gas/testsuite/gas/mips/comdat-reloc-r6.d
+++ b/gas/testsuite/gas/mips/comdat-reloc-r6.d
@@ -26,9 +26,9 @@ Relocation section '\.rel\.text\.bar' at offset .+ contains .+ entries:
  Offset     Info    Type            Sym\.Value  Sym\. Name
 00000000  ......05 R_MIPS_HI16       00000000   _gp_disp
 00000004  ......06 R_MIPS_LO16       00000000   _gp_disp
-0000000c  0000070a R_MIPS_PC16       00000020   \.L1\^B1
+0000000c  00000[7d]0a R_MIPS_PC16       00000020   \.L1\^B1
 00000014  ......09 R_MIPS_GOT16      00000000   foo
 00000024  ......09 R_MIPS_GOT16      00000000   foo
 0000001c  ......06 R_MIPS_LO16       00000000   foo
-00000020  0000080a R_MIPS_PC16       00000018   \.L0\^B1
+00000020  00000[8e]0a R_MIPS_PC16       00000018   \.L0\^B1
 #pass
-- 
2.30.2



More information about the Binutils mailing list