public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Some MIPS changes and testsuite fixes
@ 2023-05-12  7:17 YunQiang Su
  2023-05-12  7:17 ` [PATCH 1/4] MIPS: gas: alter 64 or 32 for mipsisa triples if march is implicit YunQiang Su
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: YunQiang Su @ 2023-05-12  7:17 UTC (permalink / raw)
  To: binutils
  Cc: syq, macro, xry111, richard.sandiford, jiaxun.yang, amodra, YunQiang Su

In this patchset, we:
1. Set the default arch to 64rN for `mipsisa32rN*-linux-gnu-as -64`
   Set the default arch to 32rN for `mipsisa64rN*-linux-gnu*-as -32`
2. Set the default arch to 32r6 for mips*-img-*.
3. Fix testsuite for all r6 targets: mipsisa32r6*/mipsisa64r6*/mips-img-*.
4. Fix testsuite for all -gnuabi64 targets, which are N64 default.

Run testsuite with targets:
	mipsisa32-linux-gnu mipsisa32r2-linux-gnu mips-linux-gnu
	mipsisa32el-linux-gnu mipsisa32r2el-linux-gnu mipsel-linux-gnu
	mipsisa32r6-linux-gnu mipsisa32r6el-linux-gnu
	mips-img-linux-gnu mipsel-img-linux-gnu
	mipsisa64r6-linux-gnu mipsisa64r6el-linux-gnu
	mips-img-elf mipsel-img-elf
	mips64el-linux-gnuabi64 mips64-linux-gnuabi64
	mipsisa64-linux-gnuabi64 mipsisa64el-linux-gnuabi64
	mipsisa64r2el-linux-gnuabi64 mipsisa64r2-linux-gnuabi64
	mipsisa64r6el-linux-gnuabi64 mipsisa64r6-linux-gnuabi64
and
	x86_64-linux-gnu i686-linux-gnu
	aarch64-linux-gnu arm-linux-gnueabi arm-none-eabi

YunQiang Su (4):
  MIPS: gas: alter 64 or 32 for mipsisa triples if march is implicit
  MIPS: default r6 if vendor is img
  MIPS: fix r6 testsuites
  MIPS: fix -gnuabi64 testsuite

 bfd/config.bfd                                |   2 +-
 binutils/testsuite/binutils-all/mips/mips.exp |  94 ++-
 binutils/testsuite/binutils-all/objcopy.exp   |   2 +-
 binutils/testsuite/binutils-all/readelf.r-64  |   2 +
 binutils/testsuite/binutils-all/readelf.s-64  |  10 +-
 .../testsuite/binutils-all/remove-relocs-01.d |   2 +-
 .../testsuite/binutils-all/remove-relocs-04.d |   2 +-
 .../testsuite/binutils-all/remove-relocs-05.d |   2 +-
 .../testsuite/binutils-all/remove-relocs-06.d |   2 +-
 binutils/testsuite/binutils-all/strip-3.d     |   2 +-
 gas/config/tc-mips.c                          | 280 ++++---
 gas/configure                                 |   8 +-
 gas/configure.ac                              |   8 +-
 gas/testsuite/gas/all/assign.d                |   4 +
 gas/testsuite/gas/all/fwdexp.d                |   2 +
 gas/testsuite/gas/all/none.d                  |   2 +
 gas/testsuite/gas/elf/missing-build-notes.d   |   8 +
 gas/testsuite/gas/macros/irp.d                |  12 +
 gas/testsuite/gas/macros/repeat.d             |  72 ++
 gas/testsuite/gas/macros/rept.d               |   6 +
 gas/testsuite/gas/macros/test2.d              |   6 +
 gas/testsuite/gas/macros/vararg.d             |  12 +
 gas/testsuite/gas/mips/align2-el.d            |  10 +-
 gas/testsuite/gas/mips/align2.d               |  10 +-
 gas/testsuite/gas/mips/attr-gnu-abi-fp-1.d    |   2 +-
 gas/testsuite/gas/mips/attr-gnu-abi-fp-5.d    |  21 +
 gas/testsuite/gas/mips/attr-gnu-abi-fp-5.s    |   1 +
 gas/testsuite/gas/mips/attr-gnu-abi-fp-6.d    |  21 +
 gas/testsuite/gas/mips/attr-gnu-abi-fp-6.s    |   1 +
 gas/testsuite/gas/mips/attr-gnu-abi-msa-1.d   |   2 +-
 .../gas/mips/branch-absolute-addend.d         |   2 +-
 gas/testsuite/gas/mips/branch-absolute.d      |   2 +-
 .../gas/mips/branch-addend-micromips.d        |   2 +-
 gas/testsuite/gas/mips/branch-addend.d        |   2 +-
 gas/testsuite/gas/mips/branch-extern-2.d      |   2 +-
 gas/testsuite/gas/mips/branch-extern-4.d      |   2 +-
 gas/testsuite/gas/mips/branch-local-1.d       |   2 +-
 gas/testsuite/gas/mips/branch-local-2.d       |   2 +-
 gas/testsuite/gas/mips/branch-local-3.d       |   2 +-
 gas/testsuite/gas/mips/branch-local-4.d       |   2 +-
 gas/testsuite/gas/mips/branch-local-5.d       |   2 +-
 gas/testsuite/gas/mips/branch-local-6.d       |   2 +-
 gas/testsuite/gas/mips/branch-local-7.d       |   2 +-
 .../gas/mips/branch-local-ignore-2.d          |   2 +-
 .../gas/mips/branch-local-ignore-3.d          |   2 +-
 .../gas/mips/branch-local-ignore-5.d          |   2 +-
 .../gas/mips/branch-local-ignore-6.d          |   2 +-
 gas/testsuite/gas/mips/branch-section-1.d     |   2 +-
 gas/testsuite/gas/mips/branch-section-2.d     |   2 +-
 gas/testsuite/gas/mips/branch-section-3.d     |   2 +-
 gas/testsuite/gas/mips/branch-section-4.d     |   2 +-
 gas/testsuite/gas/mips/branch-weak-1.d        |   2 +-
 gas/testsuite/gas/mips/branch-weak-2.d        |   2 +-
 gas/testsuite/gas/mips/branch-weak-3.d        |   2 +-
 gas/testsuite/gas/mips/branch-weak-4.d        |   2 +-
 gas/testsuite/gas/mips/branch-weak-5.d        |   2 +-
 gas/testsuite/gas/mips/branch-weak-6.d        |   2 +-
 gas/testsuite/gas/mips/branch-weak-7.d        |   2 +-
 gas/testsuite/gas/mips/comdat-reloc-r6.d      |  34 +
 gas/testsuite/gas/mips/comdat-reloc.d         |   2 +-
 gas/testsuite/gas/mips/compact-eh-eb-1.d      |  13 +-
 gas/testsuite/gas/mips/compact-eh-eb-2.d      |  25 +-
 gas/testsuite/gas/mips/compact-eh-eb-3.d      |  17 +-
 gas/testsuite/gas/mips/compact-eh-eb-4.d      |  17 +-
 gas/testsuite/gas/mips/compact-eh-eb-5.d      |  25 +-
 gas/testsuite/gas/mips/compact-eh-eb-6.d      |  17 +-
 gas/testsuite/gas/mips/compact-eh-eb-7.d      |  25 +-
 gas/testsuite/gas/mips/compact-eh-el-1.d      |  13 +-
 gas/testsuite/gas/mips/compact-eh-el-2.d      |  25 +-
 gas/testsuite/gas/mips/compact-eh-el-3.d      |  17 +-
 gas/testsuite/gas/mips/compact-eh-el-4.d      |  17 +-
 gas/testsuite/gas/mips/compact-eh-el-5.d      |  25 +-
 gas/testsuite/gas/mips/compact-eh-el-6.d      |  17 +-
 gas/testsuite/gas/mips/compact-eh-el-7.d      |  25 +-
 gas/testsuite/gas/mips/elf-rel.d              |  12 +-
 gas/testsuite/gas/mips/elf-rel.s              |  36 +-
 gas/testsuite/gas/mips/elf-rel6.d             |   2 +-
 gas/testsuite/gas/mips/elf_ase_micromips-2.d  |   2 +-
 gas/testsuite/gas/mips/elf_ase_micromips.d    |   2 +-
 gas/testsuite/gas/mips/elf_ase_mips16-2.d     |   2 +-
 gas/testsuite/gas/mips/elf_ase_mips16.d       |   2 +-
 gas/testsuite/gas/mips/elfel-rel.d            |  12 +-
 gas/testsuite/gas/mips/fix-rm7000-2.d         |   2 +-
 gas/testsuite/gas/mips/insn-isa-mode.d        |   2 +-
 gas/testsuite/gas/mips/insn-opts.d            |   1 +
 gas/testsuite/gas/mips/jalx-addend.d          |   2 +-
 gas/testsuite/gas/mips/jalx-imm.d             |   2 +-
 gas/testsuite/gas/mips/jalx-local.d           |   2 +-
 gas/testsuite/gas/mips/llpscp-64.d            |   1 +
 gas/testsuite/gas/mips/loongson-2f-2.d        |   2 +-
 gas/testsuite/gas/mips/loongson-2f-3.d        |   6 +-
 gas/testsuite/gas/mips/micromips-b16.d        |   2 +-
 .../mips/micromips-branch-absolute-addend.d   |   2 +-
 .../gas/mips/micromips-branch-absolute.d      |   2 +-
 .../gas/mips/micromips-warn-branch-delay-1.d  |   2 +-
 .../gas/mips/micromips-warn-branch-delay.d    |   2 +-
 .../gas/mips/micromips@fix-rm7000-2.d         |   2 +-
 gas/testsuite/gas/mips/mips-jalx-2.d          |   2 +-
 gas/testsuite/gas/mips/mips-jalx.d            |   4 +-
 gas/testsuite/gas/mips/mips.exp               |  74 +-
 .../gas/mips/mips16-absolute-reloc-0.d        |   2 +-
 .../gas/mips/mips16-absolute-reloc-2.d        |   2 +-
 .../gas/mips/mips16-branch-absolute-1.d       |   2 +-
 .../gas/mips/mips16-branch-absolute-2.d       |   2 +-
 .../mips/mips16-branch-absolute-addend-1.d    |   2 +-
 .../gas/mips/mips16-branch-absolute-addend.d  |   2 +-
 .../gas/mips/mips16-branch-absolute.d         |   2 +-
 .../gas/mips/mips16-branch-addend-0.d         |   2 +-
 .../gas/mips/mips16-branch-addend-1.d         |   2 +-
 .../gas/mips/mips16-branch-addend-2.d         |   2 +-
 .../gas/mips/mips16-branch-addend-3.d         |   2 +-
 .../gas/mips/mips16-branch-addend-4.d         |   2 +-
 .../gas/mips/mips16-branch-addend-5.d         |   2 +-
 .../gas/mips/mips16-branch-reloc-0.d          |   2 +-
 .../gas/mips/mips16-branch-reloc-1.d          |   2 +-
 .../gas/mips/mips16-branch-reloc-2.d          |   2 +-
 .../gas/mips/mips16-branch-reloc-3.d          |   2 +-
 .../gas/mips/mips16-branch-reloc-4.d          |   2 +-
 .../gas/mips/mips16-branch-reloc-5.d          |   2 +-
 .../gas/mips/mips16-branch-unextended-1.d     |   2 +-
 .../gas/mips/mips16-branch-unextended-2.d     |   2 +-
 gas/testsuite/gas/mips/mips16-dwarf2.d        |   2 +-
 gas/testsuite/gas/mips/mips16-e.d             |   2 +-
 gas/testsuite/gas/mips/mips16-extend.d        |   2 +-
 gas/testsuite/gas/mips/mips16-f.d             |   2 +-
 gas/testsuite/gas/mips/mips16-hilo.d          |   2 +-
 .../gas/mips/mips16-insn-length-noargs.d      |   2 +-
 gas/testsuite/gas/mips/mips16-jal-e.d         |   2 +-
 gas/testsuite/gas/mips/mips16-jal-t.d         |   2 +-
 gas/testsuite/gas/mips/mips16-pcrel-relax-0.d |   2 +-
 gas/testsuite/gas/mips/mips16-pcrel-relax-1.d |   2 +-
 gas/testsuite/gas/mips/mips16-pcrel-relax-2.d |   2 +-
 gas/testsuite/gas/mips/mips16-pcrel-relax-3.d |   2 +-
 gas/testsuite/gas/mips/mips16-vis-1.d         |   1 +
 gas/testsuite/gas/mips/mips64-dsp.d           |   2 +-
 gas/testsuite/gas/mips/mipsel16-e.d           |   2 +-
 gas/testsuite/gas/mips/mipsel16-f.d           |   2 +-
 gas/testsuite/gas/mips/module-mfp32.d         |   2 +-
 gas/testsuite/gas/mips/module-mfp64r6-noodd.d |  21 +
 gas/testsuite/gas/mips/module-mfp64r6.d       |  21 +
 .../gas/mips/module-msoft-float-r6.d          |  20 +
 .../gas/mips/module-msoft-float-r6.s          |   3 +
 gas/testsuite/gas/mips/module-msoft-float.d   |   2 +-
 gas/testsuite/gas/mips/nan-2008-3.d           |   1 +
 gas/testsuite/gas/mips/nan-legacy-1.d         |   1 +
 gas/testsuite/gas/mips/nan-legacy-2.d         |   2 +-
 gas/testsuite/gas/mips/nan-legacy-3.d         |   1 +
 gas/testsuite/gas/mips/nan-legacy-4.d         |   2 +-
 gas/testsuite/gas/mips/nan-legacy-5.d         |   1 +
 gas/testsuite/gas/mips/option-pic-1.d         |   2 +-
 gas/testsuite/gas/mips/option-pic-relax-0.d   |   2 +-
 gas/testsuite/gas/mips/option-pic-relax-1.d   |   2 +-
 gas/testsuite/gas/mips/option-pic-relax-3.d   |   4 +-
 gas/testsuite/gas/mips/option-pic-relax-3a.d  |   2 +-
 gas/testsuite/gas/mips/option-pic-relax-4.d   |   2 +-
 gas/testsuite/gas/mips/option-pic-relax-5.d   |   2 +-
 gas/testsuite/gas/mips/org-1.d                |   2 +-
 gas/testsuite/gas/mips/org-10.d               |   2 +-
 gas/testsuite/gas/mips/org-11.d               |   2 +-
 gas/testsuite/gas/mips/org-12.d               |   1 +
 gas/testsuite/gas/mips/org-2.d                |   2 +-
 gas/testsuite/gas/mips/org-3.d                |   1 +
 gas/testsuite/gas/mips/org-4.d                |   2 +-
 gas/testsuite/gas/mips/org-5.d                |   2 +-
 gas/testsuite/gas/mips/org-6.d                |   1 +
 gas/testsuite/gas/mips/org-7.d                |   2 +-
 gas/testsuite/gas/mips/org-8.d                |   2 +-
 gas/testsuite/gas/mips/org-9.d                |   1 +
 gas/testsuite/gas/mips/pcrel-1.d              |   4 +-
 gas/testsuite/gas/mips/pcrel-reloc-1.d        |   2 +-
 gas/testsuite/gas/mips/pcrel-reloc-2.d        |   2 +-
 gas/testsuite/gas/mips/pcrel-reloc-3.d        |   2 +-
 gas/testsuite/gas/mips/pcrel-reloc-4.d        |   2 +-
 gas/testsuite/gas/mips/pcrel-reloc-5.d        |   2 +-
 gas/testsuite/gas/mips/pcrel-reloc-6.d        |   2 +-
 gas/testsuite/gas/mips/set-arch.d             | 722 +++++++++---------
 gas/testsuite/gas/mips/tmips16-e.d            |   2 +-
 gas/testsuite/gas/mips/tmips16-f.d            |   2 +-
 gas/testsuite/gas/mips/tmipsel16-e.d          |   2 +-
 gas/testsuite/gas/mips/tmipsel16-f.d          |   2 +-
 .../gas/mips/unaligned-branch-r6-1.s          |   1 +
 .../gas/mips/unaligned-branch-r6-3.s          |   1 +
 .../gas/mips/unaligned-branch-r6-5.d          |   2 +-
 .../gas/mips/unaligned-jump-mips16-3.d        |   2 +-
 ld/testsuite/ld-elf/eh5.d                     |  50 +-
 ld/testsuite/ld-elf/group.ld                  |   2 +-
 ld/testsuite/ld-elf/orphan-region.ld          |   2 +-
 ld/testsuite/ld-elf/orphan.ld                 |   2 +-
 ld/testsuite/ld-mips-elf/attr-gnu-4-01.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-4-11.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-4-40.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-4-41.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-00.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-01.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-02.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-10.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-11.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-20.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-22.d      |   1 +
 ld/testsuite/ld-mips-elf/compact-eh6.d        |   6 +-
 ld/testsuite/ld-mips-elf/emit-relocs-1.d      |   2 +-
 ld/testsuite/ld-mips-elf/got-dump-1.d         |  22 +-
 ld/testsuite/ld-mips-elf/got-page-1.ld        |   2 +-
 ld/testsuite/ld-mips-elf/got-page-3.d         |  11 +-
 ld/testsuite/ld-mips-elf/gp-disp-sym.s        |   2 +-
 ld/testsuite/ld-mips-elf/jaloverflow-2.d      |   2 +-
 ld/testsuite/ld-mips-elf/jalr3.dd             |   2 +-
 ld/testsuite/ld-mips-elf/jalx-1.d             |  12 +-
 ld/testsuite/ld-mips-elf/mips-elf.exp         | 344 +++++----
 ld/testsuite/ld-mips-elf/mips16-1.d           |   4 +-
 .../ld-mips-elf/mips16-and-micromips.d        |   4 +-
 .../ld-mips-elf/mode-change-error-1.d         |   4 +-
 ld/testsuite/ld-mips-elf/n64-plt-1.dd         |   2 +-
 ld/testsuite/ld-mips-elf/n64-plt-4.dd         |   2 +-
 ld/testsuite/ld-mips-elf/nan-legacy.d         |   1 +
 ld/testsuite/ld-mips-elf/nan-mixed-1.d        |   1 +
 ld/testsuite/ld-mips-elf/nan-mixed-2.d        |   1 +
 ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d   |   2 +-
 ld/testsuite/ld-mips-elf/reloc-3.d            |   2 +-
 ld/testsuite/ld-mips-elf/reloc-estimate-1.d   |   4 +-
 ld/testsuite/ld-scripts/overlay-size.t        |   2 +-
 ld/testsuite/ld-undefined/undefined.exp       |   4 +
 222 files changed, 1600 insertions(+), 1003 deletions(-)
 create mode 100644 gas/testsuite/gas/mips/attr-gnu-abi-fp-5.d
 create mode 100644 gas/testsuite/gas/mips/attr-gnu-abi-fp-5.s
 create mode 100644 gas/testsuite/gas/mips/attr-gnu-abi-fp-6.d
 create mode 100644 gas/testsuite/gas/mips/attr-gnu-abi-fp-6.s
 create mode 100644 gas/testsuite/gas/mips/comdat-reloc-r6.d
 create mode 100644 gas/testsuite/gas/mips/module-mfp64r6-noodd.d
 create mode 100644 gas/testsuite/gas/mips/module-mfp64r6.d
 create mode 100644 gas/testsuite/gas/mips/module-msoft-float-r6.d
 create mode 100644 gas/testsuite/gas/mips/module-msoft-float-r6.s

-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] MIPS: gas: alter 64 or 32 for mipsisa triples if march is implicit
  2023-05-12  7:17 [PATCH 0/4] Some MIPS changes and testsuite fixes YunQiang Su
@ 2023-05-12  7:17 ` YunQiang Su
  2023-05-12  7:17 ` [PATCH 2/4] MIPS: default r6 if vendor is img YunQiang Su
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: YunQiang Su @ 2023-05-12  7:17 UTC (permalink / raw)
  To: binutils
  Cc: syq, macro, xry111, richard.sandiford, jiaxun.yang, amodra, YunQiang Su

When configure with triples mipsisa[32,64]rN[el,], the march value
is pinned to a fix value if not given explicitly. for example
   1) mipsisa32r6-linux-gnu -n32 xx.s will complains that:
      -march=mips32r6 is not compatible with the selected ABI
   2) mipsisa64r2el-linux-gnu -o32 generates objects with 64bit CPU:
      ELF 32-bit LSB relocatable, MIPS, MIPS64 rel2 version 1 (SYSV)
They are not good default behaviors: Let's alter the CPU info

Since we are using these triples as a regular linux distributions,
let's alter march according to ABI.
---
 gas/config/tc-mips.c            | 280 ++++++++++++++++++--------------
 gas/testsuite/gas/mips/mips.exp |   4 +-
 2 files changed, 162 insertions(+), 122 deletions(-)

diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 8a970ceada2..5110a310241 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -1431,6 +1431,8 @@ struct mips_cpu_info
   int flags;                  /* MIPS_CPU_* flags.  */
   int ase;                    /* Set of ASEs implemented by the CPU.  */
   int isa;                    /* ISA level.  */
+  int isa_32;                 /* Best matched 32bit ISA level.  */
+  int isa_64;                 /* Best matched 64bit ISA level.  */
   int cpu;                    /* CPU number (default CPU if ISA).  */
 };
 
@@ -1439,6 +1441,7 @@ struct mips_cpu_info
 static const struct mips_cpu_info *mips_parse_cpu (const char *, const char *);
 static const struct mips_cpu_info *mips_cpu_info_from_isa (int);
 static const struct mips_cpu_info *mips_cpu_info_from_arch (int);
+static const struct mips_cpu_info *mips_cpu_info_from_name (const char *);
 \f
 /* Command-line options.  */
 const char *md_shortopts = "O::g::G:";
@@ -19983,179 +19986,180 @@ s_mips_mask (int reg_type)
 static const struct mips_cpu_info mips_cpu_info_table[] =
 {
   /* Entries for generic ISAs.  */
-  { "mips1",          MIPS_CPU_IS_ISA, 0,	ISA_MIPS1,    CPU_R3000 },
-  { "mips2",          MIPS_CPU_IS_ISA, 0,	ISA_MIPS2,    CPU_R6000 },
-  { "mips3",          MIPS_CPU_IS_ISA, 0,	ISA_MIPS3,    CPU_R4000 },
-  { "mips4",          MIPS_CPU_IS_ISA, 0,	ISA_MIPS4,    CPU_R8000 },
-  { "mips5",          MIPS_CPU_IS_ISA, 0,	ISA_MIPS5,    CPU_MIPS5 },
-  { "mips32",         MIPS_CPU_IS_ISA, 0,	ISA_MIPS32,   CPU_MIPS32 },
-  { "mips32r2",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "mips32r3",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS32R3, CPU_MIPS32R3 },
-  { "mips32r5",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS32R5, CPU_MIPS32R5 },
-  { "mips32r6",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS32R6, CPU_MIPS32R6 },
-  { "mips64",         MIPS_CPU_IS_ISA, 0,	ISA_MIPS64,   CPU_MIPS64 },
-  { "mips64r2",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS64R2, CPU_MIPS64R2 },
-  { "mips64r3",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS64R3, CPU_MIPS64R3 },
-  { "mips64r5",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS64R5, CPU_MIPS64R5 },
-  { "mips64r6",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS64R6, CPU_MIPS64R6 },
+  { "mips1",          MIPS_CPU_IS_ISA, 0,	ISA_MIPS1,    ISA_MIPS1,    ISA_MIPS3,    CPU_R3000 },
+  { "mips2",          MIPS_CPU_IS_ISA, 0,	ISA_MIPS2,    ISA_MIPS2,    ISA_MIPS3,    CPU_R6000 },
+  { "mips3",          MIPS_CPU_IS_ISA, 0,	ISA_MIPS3,    ISA_MIPS2,    ISA_MIPS3,    CPU_R4000 },
+  { "mips4",          MIPS_CPU_IS_ISA, 0,	ISA_MIPS4,    ISA_MIPS2,    ISA_MIPS4,    CPU_R8000 },
+  { "mips5",          MIPS_CPU_IS_ISA, 0,	ISA_MIPS5,    ISA_MIPS2,    ISA_MIPS5,    CPU_MIPS5 },
+  { "mips32",         MIPS_CPU_IS_ISA, 0,	ISA_MIPS32,   ISA_MIPS32,   ISA_MIPS64,   CPU_MIPS32 },
+  { "mips32r2",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS32R2, ISA_MIPS32R2, ISA_MIPS64R2, CPU_MIPS32R2 },
+  { "mips32r3",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS32R3, ISA_MIPS32R3, ISA_MIPS64R3, CPU_MIPS32R3 },
+  { "mips32r5",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS32R5, ISA_MIPS32R5, ISA_MIPS64R5, CPU_MIPS32R5 },
+  { "mips32r6",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS32R6, ISA_MIPS32R6, ISA_MIPS64R6, CPU_MIPS32R6 },
+  { "mips64",         MIPS_CPU_IS_ISA, 0,	ISA_MIPS64,   ISA_MIPS32,   ISA_MIPS64,   CPU_MIPS64 },
+  { "mips64r2",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS64R2, ISA_MIPS32R2, ISA_MIPS64R2, CPU_MIPS64R2 },
+  { "mips64r3",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS64R3, ISA_MIPS32R3, ISA_MIPS64R3, CPU_MIPS64R3 },
+  { "mips64r5",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS64R5, ISA_MIPS32R5, ISA_MIPS64R5, CPU_MIPS64R5 },
+  { "mips64r6",       MIPS_CPU_IS_ISA, 0,	ISA_MIPS64R6, ISA_MIPS32R6, ISA_MIPS64R6, CPU_MIPS64R6 },
 
   /* MIPS I */
-  { "r3000",          0, 0,			ISA_MIPS1,    CPU_R3000 },
-  { "r2000",          0, 0,			ISA_MIPS1,    CPU_R3000 },
-  { "r3900",          0, 0,			ISA_MIPS1,    CPU_R3900 },
+  { "r3000",          0, 0,			ISA_MIPS1,    0,            0,            CPU_R3000 },
+  { "r2000",          0, 0,			ISA_MIPS1,    0,            0,            CPU_R3000 },
+  { "r3900",          0, 0,			ISA_MIPS1,    0,            0,            CPU_R3900 },
 
   /* MIPS II */
-  { "r6000",          0, 0,			ISA_MIPS2,    CPU_R6000 },
+  { "r6000",          0, 0,			ISA_MIPS2,    0,            0,            CPU_R6000 },
 
   /* MIPS III */
-  { "r4000",          0, 0,			ISA_MIPS3,    CPU_R4000 },
-  { "r4010",          0, 0,			ISA_MIPS2,    CPU_R4010 },
-  { "vr4100",         0, 0,			ISA_MIPS3,    CPU_VR4100 },
-  { "vr4111",         0, 0,			ISA_MIPS3,    CPU_R4111 },
-  { "vr4120",         0, 0,			ISA_MIPS3,    CPU_VR4120 },
-  { "vr4130",         0, 0,			ISA_MIPS3,    CPU_VR4120 },
-  { "vr4181",         0, 0,			ISA_MIPS3,    CPU_R4111 },
-  { "vr4300",         0, 0,			ISA_MIPS3,    CPU_R4300 },
-  { "r4400",          0, 0,			ISA_MIPS3,    CPU_R4400 },
-  { "r4600",          0, 0,			ISA_MIPS3,    CPU_R4600 },
-  { "orion",          0, 0,			ISA_MIPS3,    CPU_R4600 },
-  { "r4650",          0, 0,			ISA_MIPS3,    CPU_R4650 },
-  { "r5900",          0, 0,			ISA_MIPS3,    CPU_R5900 },
+  { "r4000",          0, 0,			ISA_MIPS3,    0,            0,            CPU_R4000 },
+  { "r4010",          0, 0,			ISA_MIPS2,    0,            0,            CPU_R4010 },
+  { "vr4100",         0, 0,			ISA_MIPS3,    0,            0,            CPU_VR4100 },
+  { "vr4111",         0, 0,			ISA_MIPS3,    0,            0,            CPU_R4111 },
+  { "vr4120",         0, 0,			ISA_MIPS3,    0,            0,            CPU_VR4120 },
+  { "vr4130",         0, 0,			ISA_MIPS3,    0,            0,            CPU_VR4120 },
+  { "vr4181",         0, 0,			ISA_MIPS3,    0,            0,            CPU_R4111 },
+  { "vr4300",         0, 0,			ISA_MIPS3,    0,            0,            CPU_R4300 },
+  { "r4400",          0, 0,			ISA_MIPS3,    0,            0,            CPU_R4400 },
+  { "r4600",          0, 0,			ISA_MIPS3,    0,            0,            CPU_R4600 },
+  { "orion",          0, 0,			ISA_MIPS3,    0,            0,            CPU_R4600 },
+  { "r4650",          0, 0,			ISA_MIPS3,    0,            0,            CPU_R4650 },
+  { "r5900",          0, 0,			ISA_MIPS3,    0,            0,            CPU_R5900 },
   /* ST Microelectronics Loongson 2E and 2F cores.  */
-  { "loongson2e",     0, 0,			ISA_MIPS3,    CPU_LOONGSON_2E },
-  { "loongson2f",     0, ASE_LOONGSON_MMI,	ISA_MIPS3,    CPU_LOONGSON_2F },
+  { "loongson2e",     0, 0,			ISA_MIPS3,    0,            0,            CPU_LOONGSON_2E },
+  { "loongson2f",     0, ASE_LOONGSON_MMI,	ISA_MIPS3,    0,            0,            CPU_LOONGSON_2F },
 
   /* MIPS IV */
-  { "r8000",          0, 0,			ISA_MIPS4,    CPU_R8000 },
-  { "r10000",         0, 0,			ISA_MIPS4,    CPU_R10000 },
-  { "r12000",         0, 0,			ISA_MIPS4,    CPU_R12000 },
-  { "r14000",         0, 0,			ISA_MIPS4,    CPU_R14000 },
-  { "r16000",         0, 0,			ISA_MIPS4,    CPU_R16000 },
-  { "vr5000",         0, 0,			ISA_MIPS4,    CPU_R5000 },
-  { "vr5400",         0, 0,			ISA_MIPS4,    CPU_VR5400 },
-  { "vr5500",         0, 0,			ISA_MIPS4,    CPU_VR5500 },
-  { "rm5200",         0, 0,			ISA_MIPS4,    CPU_R5000 },
-  { "rm5230",         0, 0,			ISA_MIPS4,    CPU_R5000 },
-  { "rm5231",         0, 0,			ISA_MIPS4,    CPU_R5000 },
-  { "rm5261",         0, 0,			ISA_MIPS4,    CPU_R5000 },
-  { "rm5721",         0, 0,			ISA_MIPS4,    CPU_R5000 },
-  { "rm7000",         0, 0,			ISA_MIPS4,    CPU_RM7000 },
-  { "rm9000",         0, 0,			ISA_MIPS4,    CPU_RM9000 },
+  { "r8000",          0, 0,			ISA_MIPS4,    0,            0,            CPU_R8000 },
+  { "r10000",         0, 0,			ISA_MIPS4,    0,            0,            CPU_R10000 },
+  { "r12000",         0, 0,			ISA_MIPS4,    0,            0,            CPU_R12000 },
+  { "r14000",         0, 0,			ISA_MIPS4,    0,            0,            CPU_R14000 },
+  { "r16000",         0, 0,			ISA_MIPS4,    0,            0,            CPU_R16000 },
+  { "vr5000",         0, 0,			ISA_MIPS4,    0,            0,            CPU_R5000 },
+  { "vr5400",         0, 0,			ISA_MIPS4,    0,            0,            CPU_VR5400 },
+  { "vr5500",         0, 0,			ISA_MIPS4,    0,            0,            CPU_VR5500 },
+  { "rm5200",         0, 0,			ISA_MIPS4,    0,            0,            CPU_R5000 },
+  { "rm5230",         0, 0,			ISA_MIPS4,    0,            0,            CPU_R5000 },
+  { "rm5231",         0, 0,			ISA_MIPS4,    0,            0,            CPU_R5000 },
+  { "rm5261",         0, 0,			ISA_MIPS4,    0,            0,            CPU_R5000 },
+  { "rm5721",         0, 0,			ISA_MIPS4,    0,            0,            CPU_R5000 },
+  { "rm7000",         0, 0,			ISA_MIPS4,    0,            0,            CPU_RM7000 },
+  { "rm9000",         0, 0,			ISA_MIPS4,    0,            0,            CPU_RM9000 },
 
   /* MIPS 32 */
-  { "4kc",            0, 0,			ISA_MIPS32,   CPU_MIPS32 },
-  { "4km",            0, 0,			ISA_MIPS32,   CPU_MIPS32 },
-  { "4kp",            0, 0,			ISA_MIPS32,   CPU_MIPS32 },
-  { "4ksc",           0, ASE_SMARTMIPS,		ISA_MIPS32,   CPU_MIPS32 },
+  { "4kc",            0, 0,			ISA_MIPS32,   0,            0,            CPU_MIPS32 },
+  { "4km",            0, 0,			ISA_MIPS32,   0,            0,            CPU_MIPS32 },
+  { "4kp",            0, 0,			ISA_MIPS32,   0,            0,            CPU_MIPS32 },
+  { "4ksc",           0, ASE_SMARTMIPS,		ISA_MIPS32,   0,            0,            CPU_MIPS32 },
 
   /* MIPS 32 Release 2 */
-  { "4kec",           0, 0,			ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "4kem",           0, 0,			ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "4kep",           0, 0,			ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "4ksd",           0, ASE_SMARTMIPS,		ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "m4k",            0, 0,			ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "m4kp",           0, 0,			ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "m14k",           0, ASE_MCU,		ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "m14kc",          0, ASE_MCU,		ISA_MIPS32R2, CPU_MIPS32R2 },
+  { "4kec",           0, 0,			ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "4kem",           0, 0,			ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "4kep",           0, 0,			ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "4ksd",           0, ASE_SMARTMIPS,		ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "m4k",            0, 0,			ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "m4kp",           0, 0,			ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "m14k",           0, ASE_MCU,		ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "m14kc",          0, ASE_MCU,		ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   { "m14ke",          0, ASE_DSP | ASE_DSPR2 | ASE_MCU,
-						ISA_MIPS32R2, CPU_MIPS32R2 },
+						ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   { "m14kec",         0, ASE_DSP | ASE_DSPR2 | ASE_MCU,
-						ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "24kc",           0, 0,			ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "24kf2_1",        0, 0,			ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "24kf",           0, 0,			ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "24kf1_1",        0, 0,			ISA_MIPS32R2, CPU_MIPS32R2 },
+						ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "24kc",           0, 0,			ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "24kf2_1",        0, 0,			ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "24kf",           0, 0,			ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "24kf1_1",        0, 0,			ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   /* Deprecated forms of the above.  */
-  { "24kfx",          0, 0,			ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "24kx",           0, 0,			ISA_MIPS32R2, CPU_MIPS32R2 },
+  { "24kfx",          0, 0,			ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "24kx",           0, 0,			ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   /* 24KE is a 24K with DSP ASE, other ASEs are optional.  */
-  { "24kec",          0, ASE_DSP,		ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "24kef2_1",       0, ASE_DSP,		ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "24kef",          0, ASE_DSP,		ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "24kef1_1",       0, ASE_DSP,		ISA_MIPS32R2, CPU_MIPS32R2 },
+  { "24kec",          0, ASE_DSP,		ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "24kef2_1",       0, ASE_DSP,		ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "24kef",          0, ASE_DSP,		ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "24kef1_1",       0, ASE_DSP,		ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   /* Deprecated forms of the above.  */
-  { "24kefx",         0, ASE_DSP,		ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "24kex",          0, ASE_DSP,		ISA_MIPS32R2, CPU_MIPS32R2 },
+  { "24kefx",         0, ASE_DSP,		ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "24kex",          0, ASE_DSP,		ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   /* 34K is a 24K with DSP and MT ASE, other ASEs are optional.  */
-  { "34kc",           0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "34kf2_1",        0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "34kf",           0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "34kf1_1",        0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, CPU_MIPS32R2 },
+  { "34kc",           0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "34kf2_1",        0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "34kf",           0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "34kf1_1",        0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   /* Deprecated forms of the above.  */
-  { "34kfx",          0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "34kx",           0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, CPU_MIPS32R2 },
+  { "34kfx",          0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "34kx",           0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   /* 34Kn is a 34kc without DSP.  */
-  { "34kn",           0, ASE_MT,		ISA_MIPS32R2, CPU_MIPS32R2 },
+  { "34kn",           0, ASE_MT,		ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   /* 74K with DSP and DSPR2 ASE, other ASEs are optional.  */
-  { "74kc",           0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "74kf2_1",        0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "74kf",           0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "74kf1_1",        0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "74kf3_2",        0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, CPU_MIPS32R2 },
+  { "74kc",           0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "74kf2_1",        0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "74kf",           0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "74kf1_1",        0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "74kf3_2",        0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   /* Deprecated forms of the above.  */
-  { "74kfx",          0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "74kx",           0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, CPU_MIPS32R2 },
+  { "74kfx",          0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "74kx",           0, ASE_DSP | ASE_DSPR2,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   /* 1004K cores are multiprocessor versions of the 34K.  */
-  { "1004kc",         0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "1004kf2_1",      0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "1004kf",         0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, CPU_MIPS32R2 },
-  { "1004kf1_1",      0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, CPU_MIPS32R2 },
+  { "1004kc",         0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "1004kf2_1",      0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "1004kf",         0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
+  { "1004kf1_1",      0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   /* interaptiv is the new name for 1004kf.  */
-  { "interaptiv",     0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, CPU_MIPS32R2 },
+  { "interaptiv",     0, ASE_DSP | ASE_MT,	ISA_MIPS32R2, 0,            0,            CPU_MIPS32R2 },
   { "interaptiv-mr2", 0,
     ASE_DSP | ASE_EVA | ASE_MT | ASE_MIPS16E2 | ASE_MIPS16E2_MT,
-    ISA_MIPS32R3, CPU_INTERAPTIV_MR2 },
+						ISA_MIPS32R3, 0,            0,            CPU_INTERAPTIV_MR2 },
   /* M5100 family.  */
-  { "m5100",          0, ASE_MCU,		ISA_MIPS32R5, CPU_MIPS32R5 },
-  { "m5101",          0, ASE_MCU,		ISA_MIPS32R5, CPU_MIPS32R5 },
+  { "m5100",          0, ASE_MCU,		ISA_MIPS32R5, 0,            0,            CPU_MIPS32R5 },
+  { "m5101",          0, ASE_MCU,		ISA_MIPS32R5, 0,            0,            CPU_MIPS32R5 },
   /* P5600 with EVA and Virtualization ASEs, other ASEs are optional.  */
-  { "p5600",          0, ASE_VIRT | ASE_EVA | ASE_XPA,	ISA_MIPS32R5, CPU_MIPS32R5 },
+  { "p5600",          0, ASE_VIRT | ASE_EVA | ASE_XPA,
+						ISA_MIPS32R5, 0,            0,            CPU_MIPS32R5 },
 
   /* MIPS 64 */
-  { "5kc",            0, 0,			ISA_MIPS64,   CPU_MIPS64 },
-  { "5kf",            0, 0,			ISA_MIPS64,   CPU_MIPS64 },
-  { "20kc",           0, ASE_MIPS3D,		ISA_MIPS64,   CPU_MIPS64 },
-  { "25kf",           0, ASE_MIPS3D,		ISA_MIPS64,   CPU_MIPS64 },
+  { "5kc",            0, 0,			ISA_MIPS64,   0,            0,            CPU_MIPS64 },
+  { "5kf",            0, 0,			ISA_MIPS64,   0,            0,            CPU_MIPS64 },
+  { "20kc",           0, ASE_MIPS3D,		ISA_MIPS64,   0,            0,            CPU_MIPS64 },
+  { "25kf",           0, ASE_MIPS3D,		ISA_MIPS64,   0,            0,            CPU_MIPS64 },
 
   /* Broadcom SB-1 CPU core.  */
-  { "sb1",            0, ASE_MIPS3D | ASE_MDMX,	ISA_MIPS64,   CPU_SB1 },
+  { "sb1",            0, ASE_MIPS3D | ASE_MDMX,	ISA_MIPS64,   0,            0,            CPU_SB1 },
   /* Broadcom SB-1A CPU core.  */
-  { "sb1a",           0, ASE_MIPS3D | ASE_MDMX,	ISA_MIPS64,   CPU_SB1 },
+  { "sb1a",           0, ASE_MIPS3D | ASE_MDMX,	ISA_MIPS64,   0,            0,            CPU_SB1 },
 
   /* MIPS 64 Release 2.  */
   /* Loongson CPU core.  */
   /* -march=loongson3a is an alias of -march=gs464 for compatibility.  */
   { "loongson3a",     0, ASE_LOONGSON_MMI | ASE_LOONGSON_CAM | ASE_LOONGSON_EXT,
-     ISA_MIPS64R2,	CPU_GS464 },
+						ISA_MIPS64R2, 0,            0,            CPU_GS464 },
   { "gs464",          0, ASE_LOONGSON_MMI | ASE_LOONGSON_CAM | ASE_LOONGSON_EXT,
-     ISA_MIPS64R2,	CPU_GS464 },
-  { "gs464e",         0, ASE_LOONGSON_MMI | ASE_LOONGSON_CAM | ASE_LOONGSON_EXT
-     | ASE_LOONGSON_EXT2,	ISA_MIPS64R2,	CPU_GS464E },
-  { "gs264e",         0, ASE_LOONGSON_MMI | ASE_LOONGSON_CAM | ASE_LOONGSON_EXT
-     | ASE_LOONGSON_EXT2 | ASE_MSA | ASE_MSA64,	ISA_MIPS64R2,	CPU_GS264E },
+						ISA_MIPS64R2, 0,            0,             CPU_GS464 },
+  { "gs464e",         0, ASE_LOONGSON_MMI | ASE_LOONGSON_CAM | ASE_LOONGSON_EXT  | ASE_LOONGSON_EXT2,
+						ISA_MIPS64R2, 0,            0,            CPU_GS464E },
+  { "gs264e",         0, ASE_LOONGSON_MMI | ASE_LOONGSON_CAM | ASE_LOONGSON_EXT | ASE_LOONGSON_EXT2 | ASE_MSA | ASE_MSA64,
+						ISA_MIPS64R2, 0,            0,            CPU_GS264E },
 
   /* Cavium Networks Octeon CPU core.  */
-  { "octeon",	      0, 0,			ISA_MIPS64R2, CPU_OCTEON },
-  { "octeon+",	      0, 0,			ISA_MIPS64R2, CPU_OCTEONP },
-  { "octeon2",	      0, 0,			ISA_MIPS64R2, CPU_OCTEON2 },
-  { "octeon3",	      0, ASE_VIRT | ASE_VIRT64,	ISA_MIPS64R5, CPU_OCTEON3 },
+  { "octeon",	      0, 0,			ISA_MIPS64R2, 0,            0,            CPU_OCTEON },
+  { "octeon+",	      0, 0,			ISA_MIPS64R2, 0,            0,            CPU_OCTEONP },
+  { "octeon2",	      0, 0,			ISA_MIPS64R2, 0,            0,            CPU_OCTEON2 },
+  { "octeon3",	      0, ASE_VIRT | ASE_VIRT64,	ISA_MIPS64R5, 0,            0,            CPU_OCTEON3 },
 
   /* RMI Xlr */
-  { "xlr",	      0, 0,			ISA_MIPS64,   CPU_XLR },
+  { "xlr",	      0, 0,			ISA_MIPS64,   0,            0,            CPU_XLR },
 
   /* Broadcom XLP.
      XLP is mostly like XLR, with the prominent exception that it is
      MIPS64R2 rather than MIPS64.  */
-  { "xlp",	      0, 0,			ISA_MIPS64R2, CPU_XLR },
+  { "xlp",	      0, 0,			ISA_MIPS64R2, 0,            0,            CPU_XLR },
 
   /* MIPS 64 Release 6.  */
-  { "i6400",	      0, ASE_VIRT | ASE_MSA,	ISA_MIPS64R6, CPU_MIPS64R6},
+  { "i6400",	      0, ASE_VIRT | ASE_MSA,	ISA_MIPS64R6, 0,            0,            CPU_MIPS64R6},
   { "i6500",	      0, ASE_VIRT | ASE_MSA | ASE_CRC | ASE_GINV,
-						ISA_MIPS64R6, CPU_MIPS64R6},
-  { "p6600",	      0, ASE_VIRT | ASE_MSA,	ISA_MIPS64R6, CPU_MIPS64R6},
+						ISA_MIPS64R6, 0,            0,            CPU_MIPS64R6},
+  { "p6600",	      0, ASE_VIRT | ASE_MSA,	ISA_MIPS64R6, 0,            0,            CPU_MIPS64R6},
 
   /* End marker.  */
-  { NULL, 0, 0, 0, 0 }
+  { NULL, 0, 0, 0, 0, 0, 0 }
 };
 
 
@@ -20247,6 +20251,29 @@ mips_parse_cpu (const char *option, const char *cpu_string)
 				     : ISA_MIPS1);
     }
 
+  /* mipsisa32rN-linux-gnu refuses -n32/-64 swtiches:
+	-march=mips32r6 is not compatible with the selected ABI
+     mipsisa64rN-linux-gnu -o32 generates objects with 64bit CPU:
+	ELF 32-bit LSB relocatable, MIPS, MIPS64 rel2 version 1 (SYSV), not stripped
+     They are not good default behaviors: Let's alter the CPU info
+     We treat it some like -march=from-abi */
+  if (strcasecmp (option, "default CPU") == 0)
+    {
+      p = mips_cpu_info_from_name (cpu_string);
+      if (p != NULL && (p->flags & MIPS_CPU_IS_ISA))
+	{
+	  if (ABI_NEEDS_32BIT_REGS (mips_abi))
+	    return mips_cpu_info_from_isa (p->isa_32);
+
+	  if (ABI_NEEDS_64BIT_REGS (mips_abi))
+	    return mips_cpu_info_from_isa (p->isa_64);
+
+	  if (file_mips_opts.gp >= 0)
+	    return mips_cpu_info_from_isa (file_mips_opts.gp == 32
+						? p->isa_32 : p->isa_64);
+	}
+    }
+
   /* 'default' has traditionally been a no-op.  Probably not very useful.  */
   if (strcasecmp (cpu_string, "default") == 0)
     return 0;
@@ -20286,6 +20313,19 @@ mips_cpu_info_from_arch (int arch)
 
   return NULL;
 }
+
+static const struct mips_cpu_info *
+mips_cpu_info_from_name (const char* name)
+{
+  int i;
+
+  for (i = 0; mips_cpu_info_table[i].name != NULL; i++)
+    if (strcasecmp (mips_cpu_info_table[i].name, name) == 0)
+      return (&mips_cpu_info_table[i]);
+
+  return NULL;
+}
+
 \f
 static void
 show (FILE *stream, const char *string, int *col_p, int *first_p)
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index e358c9716a6..17eb95f4aa4 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -556,7 +556,7 @@ if { [istarget mips*-*-vxworks*] } {
 	"MIPS invalid switch to SVR4 PIC from VxWorks PIC"
 } elseif { [istarget mips*-*-*] } {
     set addr32 [expr [istarget mipstx39*-*-*] || [istarget mips-*-linux*] || [istarget mipsel-*-linux*] \
-		     || [istarget mipsisa32-*-linux*] || [istarget mipsisa32el-*-linux*]]
+		     || [istarget mipsisa32*-*-linux*] || [istarget mipsisa32*el-*-linux*]]
     set has_newabi [expr [istarget *-*-irix6*] || [istarget mips*-*-linux*] \
                          || [istarget mips*-sde-elf*] || [istarget mips*-mti-elf*] \
                          || [istarget mips*-img-elf*]]
@@ -2045,7 +2045,7 @@ if { [istarget mips*-*-vxworks*] } {
 
     run_dump_test "module-override"
     run_dump_test "module-defer-warn1"
-    run_list_test "module-defer-warn2" "-32"
+    run_list_test "module-defer-warn2" "-32 -mips1"
 
     foreach testopt [list -mfp32 -mfpxx -mfp64 "-mfp64-noodd" \
 			  -msingle-float -msoft-float] {
-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/4] MIPS: default r6 if vendor is img
  2023-05-12  7:17 [PATCH 0/4] Some MIPS changes and testsuite fixes YunQiang Su
  2023-05-12  7:17 ` [PATCH 1/4] MIPS: gas: alter 64 or 32 for mipsisa triples if march is implicit YunQiang Su
@ 2023-05-12  7:17 ` YunQiang Su
  2023-05-12  7:17 ` [PATCH 3/4] MIPS: fix r6 testsuites YunQiang Su
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: YunQiang Su @ 2023-05-12  7:17 UTC (permalink / raw)
  To: binutils
  Cc: syq, macro, xry111, richard.sandiford, jiaxun.yang, amodra, YunQiang Su

This behavior is used by downstream toolchain since 2014.
We also set the default ABI for mips*-img-elf to O32.
The previous value is NO_ABI, which is not good default ABI.

We don't support mips64*-img* due to GCC doesn't support it,
and We believe that the multilib should be used for this case.
---
 bfd/config.bfd   | 2 +-
 gas/configure    | 8 +++++++-
 gas/configure.ac | 8 +++++++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/bfd/config.bfd b/bfd/config.bfd
index 954837033c8..78752994456 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -1537,7 +1537,7 @@ case "${targ_defvec} ${targ_selvecs}" in
 esac
 
 case "${targ}" in
-  mipsisa32r6* | mipsisa64r6*)
+  mipsisa32r6* | mipsisa64r6* | mips*-img-*)
     targ_cflags="$targ_cflags -DMIPS_DEFAULT_R6=1"
     ;;
 esac
diff --git a/gas/configure b/gas/configure
index 868f4a911a9..580022d858d 100755
--- a/gas/configure
+++ b/gas/configure
@@ -12211,6 +12211,12 @@ _ACEOF
 	    use_e_mips_abi_o32=1
 	    ;;
 	esac
+	# If Vendor is IMG, then MIPSr6 is used
+	case ${target} in
+	  mips*-img-*)
+	    mips_cpu=mips32r6
+	    ;;
+	esac
 	# Decide whether to generate 32-bit or 64-bit code by default.
 	# Used to resolve -march=from-abi when an embedded ABI is selected.
 	case ${target} in
@@ -12230,7 +12236,7 @@ _ACEOF
 	  | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
 	    mips_default_abi=N32_ABI
 	    ;;
-	  mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu)
+	  mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu | mips*-img-elf)
 	    mips_default_abi=O32_ABI
 	    ;;
 	  mips64*-openbsd*)
diff --git a/gas/configure.ac b/gas/configure.ac
index 03728ffce4d..c1571a49fbb 100644
--- a/gas/configure.ac
+++ b/gas/configure.ac
@@ -380,6 +380,12 @@ changequote([,])dnl
 	    use_e_mips_abi_o32=1
 	    ;;
 	esac
+	# If Vendor is IMG, then MIPSr6 is used
+	case ${target} in
+	  mips*-img-*)
+	    mips_cpu=mips32r6
+	    ;;
+	esac
 	# Decide whether to generate 32-bit or 64-bit code by default.
 	# Used to resolve -march=from-abi when an embedded ABI is selected.
 	case ${target} in
@@ -399,7 +405,7 @@ changequote([,])dnl
 	  | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
 	    mips_default_abi=N32_ABI
 	    ;;
-	  mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu)
+	  mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu | mips*-img-elf)
 	    mips_default_abi=O32_ABI
 	    ;;
 	  mips64*-openbsd*)
-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/4] MIPS: fix r6 testsuites
  2023-05-12  7:17 [PATCH 0/4] Some MIPS changes and testsuite fixes YunQiang Su
  2023-05-12  7:17 ` [PATCH 1/4] MIPS: gas: alter 64 or 32 for mipsisa triples if march is implicit YunQiang Su
  2023-05-12  7:17 ` [PATCH 2/4] MIPS: default r6 if vendor is img YunQiang Su
@ 2023-05-12  7:17 ` YunQiang Su
  2023-05-12  7:17 ` [PATCH 4/4] MIPS: fix -gnuabi64 testsuite YunQiang Su
  2023-05-13 11:57 ` [PATCH 0/4] Some MIPS changes and testsuite fixes Alan Modra
  4 siblings, 0 replies; 6+ messages in thread
From: YunQiang Su @ 2023-05-12  7:17 UTC (permalink / raw)
  To: binutils
  Cc: syq, macro, xry111, richard.sandiford, jiaxun.yang, amodra, YunQiang Su

Introduce
	run_dump_test_o32l
	run_dump_test_n32l
	run_dump_test_n64l
Which use `-march=from-abi` for pre-R6 testcases,
like micromips/mips16e etc.

For cases doesn't use run_dump_test_*, we use
	-mips32r2 for micromips32
	-mips1 for mips16-32
	-march=from-abi for testcases to o32/n32/n64 both/all.

Replace `addi` with `addiu` for some cases for both r6 and pre-R6.

Introduce some new testcases for r6 with FPXX/FP64.
Introduce new testcase: comdat-reloc-r6.

Skip `default` in mips_arch_list_matching if triple is mipsisa*, due to:
  1)it will cannot match mipsr6@*.d: since mips32rN/mips64rN
    will always be used, it won't be a problem.
  2)some test think -march=mips64rN will alway true for mipsisa64rN,
    which is not true now.

This patch fix testsuite for all r6-default gnu triples:
  mipsisa32r6-linux-gnu
  mipsisa32r6el-linux-gnu
  mips-img-linux-gnu
  mipsel-img-linux-gnu
  mipsisa64r6-linux-gnu
  mipsisa64r6el-linux-gnu
---
 binutils/testsuite/binutils-all/mips/mips.exp |  75 ++++-
 gas/testsuite/gas/mips/align2-el.d            |   2 +-
 gas/testsuite/gas/mips/align2.d               |   2 +-
 gas/testsuite/gas/mips/attr-gnu-abi-fp-1.d    |   2 +-
 gas/testsuite/gas/mips/attr-gnu-abi-fp-5.d    |  21 ++
 gas/testsuite/gas/mips/attr-gnu-abi-fp-5.s    |   1 +
 gas/testsuite/gas/mips/attr-gnu-abi-fp-6.d    |  21 ++
 gas/testsuite/gas/mips/attr-gnu-abi-fp-6.s    |   1 +
 gas/testsuite/gas/mips/attr-gnu-abi-msa-1.d   |   2 +-
 .../gas/mips/branch-absolute-addend.d         |   2 +-
 gas/testsuite/gas/mips/branch-absolute.d      |   2 +-
 .../gas/mips/branch-addend-micromips.d        |   2 +-
 gas/testsuite/gas/mips/branch-addend.d        |   2 +-
 gas/testsuite/gas/mips/branch-extern-2.d      |   2 +-
 gas/testsuite/gas/mips/branch-extern-4.d      |   2 +-
 gas/testsuite/gas/mips/branch-local-1.d       |   2 +-
 gas/testsuite/gas/mips/branch-local-2.d       |   2 +-
 gas/testsuite/gas/mips/branch-local-3.d       |   2 +-
 gas/testsuite/gas/mips/branch-local-4.d       |   2 +-
 gas/testsuite/gas/mips/branch-local-5.d       |   2 +-
 gas/testsuite/gas/mips/branch-local-6.d       |   2 +-
 gas/testsuite/gas/mips/branch-local-7.d       |   2 +-
 .../gas/mips/branch-local-ignore-2.d          |   2 +-
 .../gas/mips/branch-local-ignore-3.d          |   2 +-
 .../gas/mips/branch-local-ignore-5.d          |   2 +-
 .../gas/mips/branch-local-ignore-6.d          |   2 +-
 gas/testsuite/gas/mips/branch-section-1.d     |   2 +-
 gas/testsuite/gas/mips/branch-section-2.d     |   2 +-
 gas/testsuite/gas/mips/branch-section-3.d     |   2 +-
 gas/testsuite/gas/mips/branch-section-4.d     |   2 +-
 gas/testsuite/gas/mips/branch-weak-1.d        |   2 +-
 gas/testsuite/gas/mips/branch-weak-2.d        |   2 +-
 gas/testsuite/gas/mips/branch-weak-3.d        |   2 +-
 gas/testsuite/gas/mips/branch-weak-4.d        |   2 +-
 gas/testsuite/gas/mips/branch-weak-5.d        |   2 +-
 gas/testsuite/gas/mips/branch-weak-6.d        |   2 +-
 gas/testsuite/gas/mips/branch-weak-7.d        |   2 +-
 gas/testsuite/gas/mips/comdat-reloc-r6.d      |  34 ++
 gas/testsuite/gas/mips/comdat-reloc.d         |   2 +-
 gas/testsuite/gas/mips/compact-eh-eb-1.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-eb-2.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-eb-3.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-eb-4.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-eb-5.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-eb-6.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-eb-7.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-el-1.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-el-2.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-el-3.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-el-4.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-el-5.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-el-6.d      |   2 +-
 gas/testsuite/gas/mips/compact-eh-el-7.d      |   2 +-
 gas/testsuite/gas/mips/elf-rel.d              |  12 +-
 gas/testsuite/gas/mips/elf-rel.s              |  36 +-
 gas/testsuite/gas/mips/elf-rel6.d             |   2 +-
 gas/testsuite/gas/mips/elf_ase_micromips-2.d  |   2 +-
 gas/testsuite/gas/mips/elf_ase_micromips.d    |   2 +-
 gas/testsuite/gas/mips/elf_ase_mips16-2.d     |   2 +-
 gas/testsuite/gas/mips/elf_ase_mips16.d       |   2 +-
 gas/testsuite/gas/mips/elfel-rel.d            |  12 +-
 gas/testsuite/gas/mips/insn-isa-mode.d        |   2 +-
 gas/testsuite/gas/mips/insn-opts.d            |   1 +
 gas/testsuite/gas/mips/jalx-addend.d          |   2 +-
 gas/testsuite/gas/mips/jalx-imm.d             |   2 +-
 gas/testsuite/gas/mips/jalx-local.d           |   2 +-
 gas/testsuite/gas/mips/loongson-2f-3.d        |   2 +-
 gas/testsuite/gas/mips/micromips-b16.d        |   2 +-
 .../mips/micromips-branch-absolute-addend.d   |   2 +-
 .../gas/mips/micromips-branch-absolute.d      |   2 +-
 .../gas/mips/micromips-warn-branch-delay-1.d  |   2 +-
 .../gas/mips/micromips-warn-branch-delay.d    |   2 +-
 gas/testsuite/gas/mips/mips-jalx-2.d          |   2 +-
 gas/testsuite/gas/mips/mips.exp               |  58 ++--
 .../gas/mips/mips16-absolute-reloc-0.d        |   2 +-
 .../gas/mips/mips16-absolute-reloc-2.d        |   2 +-
 .../gas/mips/mips16-branch-absolute-1.d       |   2 +-
 .../gas/mips/mips16-branch-absolute-2.d       |   2 +-
 .../mips/mips16-branch-absolute-addend-1.d    |   2 +-
 .../gas/mips/mips16-branch-absolute-addend.d  |   2 +-
 .../gas/mips/mips16-branch-absolute.d         |   2 +-
 .../gas/mips/mips16-branch-addend-0.d         |   2 +-
 .../gas/mips/mips16-branch-addend-1.d         |   2 +-
 .../gas/mips/mips16-branch-addend-2.d         |   2 +-
 .../gas/mips/mips16-branch-addend-3.d         |   2 +-
 .../gas/mips/mips16-branch-addend-4.d         |   2 +-
 .../gas/mips/mips16-branch-addend-5.d         |   2 +-
 .../gas/mips/mips16-branch-reloc-0.d          |   2 +-
 .../gas/mips/mips16-branch-reloc-1.d          |   2 +-
 .../gas/mips/mips16-branch-reloc-2.d          |   2 +-
 .../gas/mips/mips16-branch-reloc-3.d          |   2 +-
 .../gas/mips/mips16-branch-reloc-4.d          |   2 +-
 .../gas/mips/mips16-branch-reloc-5.d          |   2 +-
 .../gas/mips/mips16-branch-unextended-1.d     |   2 +-
 .../gas/mips/mips16-branch-unextended-2.d     |   2 +-
 gas/testsuite/gas/mips/mips16-dwarf2.d        |   2 +-
 gas/testsuite/gas/mips/mips16-e.d             |   2 +-
 gas/testsuite/gas/mips/mips16-extend.d        |   2 +-
 gas/testsuite/gas/mips/mips16-f.d             |   2 +-
 gas/testsuite/gas/mips/mips16-hilo.d          |   2 +-
 .../gas/mips/mips16-insn-length-noargs.d      |   2 +-
 gas/testsuite/gas/mips/mips16-jal-e.d         |   2 +-
 gas/testsuite/gas/mips/mips16-jal-t.d         |   2 +-
 gas/testsuite/gas/mips/mips16-pcrel-relax-0.d |   2 +-
 gas/testsuite/gas/mips/mips16-pcrel-relax-1.d |   2 +-
 gas/testsuite/gas/mips/mips16-pcrel-relax-2.d |   2 +-
 gas/testsuite/gas/mips/mips16-pcrel-relax-3.d |   2 +-
 gas/testsuite/gas/mips/mips16-vis-1.d         |   1 +
 gas/testsuite/gas/mips/mipsel16-e.d           |   2 +-
 gas/testsuite/gas/mips/mipsel16-f.d           |   2 +-
 gas/testsuite/gas/mips/module-mfp32.d         |   2 +-
 gas/testsuite/gas/mips/module-mfp64r6-noodd.d |  21 ++
 gas/testsuite/gas/mips/module-mfp64r6.d       |  21 ++
 .../gas/mips/module-msoft-float-r6.d          |  20 ++
 .../gas/mips/module-msoft-float-r6.s          |   3 +
 gas/testsuite/gas/mips/module-msoft-float.d   |   2 +-
 gas/testsuite/gas/mips/nan-2008-3.d           |   1 +
 gas/testsuite/gas/mips/nan-legacy-1.d         |   1 +
 gas/testsuite/gas/mips/nan-legacy-2.d         |   2 +-
 gas/testsuite/gas/mips/nan-legacy-3.d         |   1 +
 gas/testsuite/gas/mips/nan-legacy-4.d         |   2 +-
 gas/testsuite/gas/mips/nan-legacy-5.d         |   1 +
 gas/testsuite/gas/mips/option-pic-1.d         |   2 +-
 gas/testsuite/gas/mips/option-pic-relax-0.d   |   2 +-
 gas/testsuite/gas/mips/option-pic-relax-1.d   |   2 +-
 gas/testsuite/gas/mips/option-pic-relax-3.d   |   4 +-
 gas/testsuite/gas/mips/option-pic-relax-3a.d  |   2 +-
 gas/testsuite/gas/mips/option-pic-relax-4.d   |   2 +-
 gas/testsuite/gas/mips/option-pic-relax-5.d   |   2 +-
 gas/testsuite/gas/mips/org-1.d                |   2 +-
 gas/testsuite/gas/mips/org-10.d               |   2 +-
 gas/testsuite/gas/mips/org-11.d               |   2 +-
 gas/testsuite/gas/mips/org-12.d               |   1 +
 gas/testsuite/gas/mips/org-2.d                |   2 +-
 gas/testsuite/gas/mips/org-3.d                |   1 +
 gas/testsuite/gas/mips/org-4.d                |   2 +-
 gas/testsuite/gas/mips/org-5.d                |   2 +-
 gas/testsuite/gas/mips/org-6.d                |   1 +
 gas/testsuite/gas/mips/org-7.d                |   2 +-
 gas/testsuite/gas/mips/org-8.d                |   2 +-
 gas/testsuite/gas/mips/org-9.d                |   1 +
 gas/testsuite/gas/mips/pcrel-reloc-1.d        |   2 +-
 gas/testsuite/gas/mips/pcrel-reloc-2.d        |   2 +-
 gas/testsuite/gas/mips/pcrel-reloc-3.d        |   2 +-
 gas/testsuite/gas/mips/pcrel-reloc-4.d        |   2 +-
 gas/testsuite/gas/mips/pcrel-reloc-5.d        |   2 +-
 gas/testsuite/gas/mips/pcrel-reloc-6.d        |   2 +-
 gas/testsuite/gas/mips/set-arch.d             |   4 +
 gas/testsuite/gas/mips/tmips16-e.d            |   2 +-
 gas/testsuite/gas/mips/tmips16-f.d            |   2 +-
 gas/testsuite/gas/mips/tmipsel16-e.d          |   2 +-
 gas/testsuite/gas/mips/tmipsel16-f.d          |   2 +-
 .../gas/mips/unaligned-branch-r6-1.s          |   1 +
 .../gas/mips/unaligned-branch-r6-3.s          |   1 +
 .../gas/mips/unaligned-branch-r6-5.d          |   2 +-
 .../gas/mips/unaligned-jump-mips16-3.d        |   2 +-
 ld/testsuite/ld-mips-elf/attr-gnu-4-01.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-4-11.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-4-40.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-4-41.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-00.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-01.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-02.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-10.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-11.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-20.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-22.d      |   1 +
 ld/testsuite/ld-mips-elf/emit-relocs-1.d      |   2 +-
 ld/testsuite/ld-mips-elf/gp-disp-sym.s        |   2 +-
 ld/testsuite/ld-mips-elf/jalr3.dd             |   2 +-
 ld/testsuite/ld-mips-elf/jalx-1.d             |   2 +-
 ld/testsuite/ld-mips-elf/mips-elf.exp         | 316 ++++++++++--------
 ld/testsuite/ld-mips-elf/mips16-1.d           |   4 +-
 .../ld-mips-elf/mips16-and-micromips.d        |   4 +-
 .../ld-mips-elf/mode-change-error-1.d         |   4 +-
 ld/testsuite/ld-mips-elf/n64-plt-1.dd         |   2 +-
 ld/testsuite/ld-mips-elf/n64-plt-4.dd         |   2 +-
 ld/testsuite/ld-mips-elf/nan-legacy.d         |   1 +
 ld/testsuite/ld-mips-elf/nan-mixed-1.d        |   1 +
 ld/testsuite/ld-mips-elf/nan-mixed-2.d        |   1 +
 ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d   |   2 +-
 ld/testsuite/ld-mips-elf/reloc-3.d            |   2 +-
 182 files changed, 621 insertions(+), 349 deletions(-)
 create mode 100644 gas/testsuite/gas/mips/attr-gnu-abi-fp-5.d
 create mode 100644 gas/testsuite/gas/mips/attr-gnu-abi-fp-5.s
 create mode 100644 gas/testsuite/gas/mips/attr-gnu-abi-fp-6.d
 create mode 100644 gas/testsuite/gas/mips/attr-gnu-abi-fp-6.s
 create mode 100644 gas/testsuite/gas/mips/comdat-reloc-r6.d
 create mode 100644 gas/testsuite/gas/mips/module-mfp64r6-noodd.d
 create mode 100644 gas/testsuite/gas/mips/module-mfp64r6.d
 create mode 100644 gas/testsuite/gas/mips/module-msoft-float-r6.d
 create mode 100644 gas/testsuite/gas/mips/module-msoft-float-r6.s

diff --git a/binutils/testsuite/binutils-all/mips/mips.exp b/binutils/testsuite/binutils-all/mips/mips.exp
index 91bf3274592..3b7bc29056a 100644
--- a/binutils/testsuite/binutils-all/mips/mips.exp
+++ b/binutils/testsuite/binutils-all/mips/mips.exp
@@ -52,7 +52,8 @@ proc run_dump_test_abi { abi name args } {
 	set ldflags $abi_ldflags($abi)
 	set args [lreplace $args 0 0]
     }
-    if !$has_abi($abi) {
+    set abi_r [regsub "l$" $abi {}]
+    if !$has_abi($abi_r) {
 	lappend args {notarget *-*-*}
     }
 
@@ -74,6 +75,13 @@ proc run_dump_test_abi { abi name args } {
 proc run_dump_test_o32 { name args } {
     run_dump_test_abi o32 $name [lindex $args 0]
 }
+proc run_dump_test_o32l { name args } {
+    if {[istarget *-linux*] || [istarget *-img-elf]} {
+      run_dump_test_abi o32l $name [lindex $args 0]
+    } else {
+      run_dump_test_abi o32 $name [lindex $args 0]
+    }
+}
 
 # run_dump_test_n32 NAME ARGS
 #
@@ -82,6 +90,13 @@ proc run_dump_test_o32 { name args } {
 proc run_dump_test_n32 { name args } {
     run_dump_test_abi n32 $name [lindex $args 0]
 }
+proc run_dump_test_n32l { name args } {
+    if {[istarget *-linux*] || [istarget *-img-elf]} {
+      run_dump_test_abi n32l $name [lindex $args 0]
+    } else {
+      run_dump_test_abi n32 $name [lindex $args 0]
+    }
+}
 
 # run_dump_test_n64 NAME ARGS
 #
@@ -90,6 +105,13 @@ proc run_dump_test_n32 { name args } {
 proc run_dump_test_n64 { name args } {
     run_dump_test_abi n64 $name [lindex $args 0]
 }
+proc run_dump_test_n64l { name args } {
+    if {[istarget *-linux*] || [istarget *-img-elf]} {
+      run_dump_test_abi n64l $name [lindex $args 0]
+    } else {
+      run_dump_test_abi n64 $name [lindex $args 0]
+    }
+}
 
 set has_abi(o32) [expr ![istarget *-*-openbsd*] \
 		     && ![istarget mips64*el-ps2-elf*]]
@@ -109,49 +131,68 @@ set has_abi(n64) [expr [istarget *-*-freebsd*] \
 		     || [istarget *-*-openbsd*]]
 
 # Set defaults.
+# ABI with l tail means legacy, aka pre-R6.
+# Please use them, if the test only suite for pre-R6,
+# such as mips16/micromips tests.
 set abi_asflags(o32) ""
+set abi_asflags(o32l) ""
 set abi_asflags(n32) ""
+set abi_asflags(n32l) ""
 set abi_asflags(n64) ""
+set abi_asflags(n64l) ""
 set abi_asflags(eabi) ""
 set abi_ldflags(o32) ""
+set abi_ldflags(o32l) ""
 set abi_ldflags(n32) ""
+set abi_ldflags(n32l) ""
 set abi_ldflags(n64) ""
+set abi_ldflags(n64l) ""
 set abi_ldflags(eabi) ""
 
 # Override as needed.
 if {[istarget *-*-openbsd*] } {
     set irixemul 0
-} elseif { [istarget mips64*-*-linux*] } {
+} elseif { [istarget mips*64*-*-linux*] } {
+    set abi_asflags(o32) -32
+    set abi_asflags(o32l) "-32 -march=from-abi"
+    set abi_asflags(n32) ""
+    set abi_asflags(n32l) "-n32 -march=from-abi"
+    set abi_asflags(n64) "-64"
+    set abi_asflags(n64l) "-march=from-abi -64"
     if [istarget *el-*-*] {
-	set abi_asflags(o32) -32
 	set abi_ldflags(o32) -melf32ltsmip
-	set abi_asflags(n64) "-march=from-abi -64"
+	set abi_ldflags(o32l) -melf32ltsmip
 	set abi_ldflags(n64) -melf64ltsmip
+	set abi_ldflags(n64l) -melf64ltsmip
     } else {
-	set abi_asflags(o32) -32
 	set abi_ldflags(o32) -melf32btsmip
-	set abi_asflags(n64) "-march=from-abi -64"
+	set abi_ldflags(o32l) -melf32btsmip
 	set abi_ldflags(n64) -melf64btsmip
+	set abi_ldflags(n64l) -melf64btsmip
     }
     set irixemul 0
-} elseif {[istarget *-*-linux*] } {
+} elseif {[istarget *-*-linux*] || [istarget *-img-elf] } {
+    set abi_asflags(o32) ""
+    set abi_asflags(o32l) "-march=from-abi"
+    set abi_asflags(n32) "-n32"
+    set abi_asflags(n32l) "-n32 -march=from-abi"
+    set abi_asflags(n64) "-64"
+    set abi_asflags(n64l) "-64 -march=from-abi"
     if [istarget *el-*-*] {
-	set abi_asflags(n32) "-march=from-abi -n32"
 	set abi_ldflags(n32) -melf32ltsmipn32
-	set abi_asflags(n64) "-march=from-abi -64"
+	set abi_ldflags(n32l) -melf32ltsmipn32
 	set abi_ldflags(n64) -melf64ltsmip
+	set abi_ldflags(n64l) -melf64ltsmip
     } else {
-	set abi_asflags(n32) "-march=from-abi -n32"
 	set abi_ldflags(n32) -melf32btsmipn32
-	set abi_asflags(n64) "-march=from-abi -64"
+	set abi_ldflags(n32l) -melf32btsmipn32
 	set abi_ldflags(n64) -melf64btsmip
+	set abi_ldflags(n64l) -melf64btsmip
     }
     set irixemul 0
-} elseif {[istarget *-img-elf*] \
-     || [istarget *-mti-elf*] \
+} elseif {[istarget *-mti-elf*] \
      || [istarget *-sde-elf*] \
      || [istarget *-*-netbsd*] \
-     || [istarget *-*-linux*] \
      || [istarget *-*-sysv4*] } {
     if [istarget *el-*-*] {
 	set abi_asflags(o32) -32
@@ -229,11 +270,13 @@ run_dump_test "mips-xpa-virt-3"
 run_dump_test "mips-xpa-virt-4"
 run_dump_test_o32 "mixed-mips16" noarch
 run_dump_test_o32 "mixed-micromips" noarch
-run_dump_test "mixed-mips16-micromips"
+run_dump_test_o32l "mixed-mips16-micromips"
+run_dump_test_n32l "mixed-mips16-micromips"
+run_dump_test_n64l "mixed-mips16-micromips"
 run_dump_test_o32 "mips16-undecoded" noarch
 run_dump_test_o32 "mips16e2-undecoded" noarch
 run_dump_test_o32 "mips16-pcrel"
-run_dump_test_o32 "mips16-extend-noinsn"
+run_dump_test_o32l "mips16-extend-noinsn"
 run_dump_test_o32 "mips16-extend-insn" noarch
 run_dump_test_o32 "mips16e2-extend-insn" noarch
 run_dump_test_o32 "mips16-alias" noarch
diff --git a/gas/testsuite/gas/mips/align2-el.d b/gas/testsuite/gas/mips/align2-el.d
index 1f50774f4d0..8072c528282 100644
--- a/gas/testsuite/gas/mips/align2-el.d
+++ b/gas/testsuite/gas/mips/align2-el.d
@@ -1,5 +1,5 @@
 # source: align2.s
-# as: -EL
+# as: -EL -march=from-abi
 # objdump: -dr
 
 .* file format .*
diff --git a/gas/testsuite/gas/mips/align2.d b/gas/testsuite/gas/mips/align2.d
index 7090ceeb5c6..d14fa2ce7c4 100644
--- a/gas/testsuite/gas/mips/align2.d
+++ b/gas/testsuite/gas/mips/align2.d
@@ -1,4 +1,4 @@
-# as: -EB
+# as: -EB -march=from-abi
 # objdump: -dr
 
 .* file format .*
diff --git a/gas/testsuite/gas/mips/attr-gnu-abi-fp-1.d b/gas/testsuite/gas/mips/attr-gnu-abi-fp-1.d
index 17218d31a11..9009c704bb6 100644
--- a/gas/testsuite/gas/mips/attr-gnu-abi-fp-1.d
+++ b/gas/testsuite/gas/mips/attr-gnu-abi-fp-1.d
@@ -1,4 +1,4 @@
-#as: -32
+#as: -32 -mips1
 #source: attr-gnu-abi-fp-1.s
 #readelf: -A
 #name: MIPS gnu_attribute Tag_GNU_MIPS_ABI_FP,1
diff --git a/gas/testsuite/gas/mips/attr-gnu-abi-fp-5.d b/gas/testsuite/gas/mips/attr-gnu-abi-fp-5.d
new file mode 100644
index 00000000000..2550241b925
--- /dev/null
+++ b/gas/testsuite/gas/mips/attr-gnu-abi-fp-5.d
@@ -0,0 +1,21 @@
+#as: -32 -mips2 -mfpxx
+#source: attr-gnu-abi-fp-5.s
+#readelf: -A
+#name: MIPS gnu_attribute Tag_GNU_MIPS_ABI_FP,5
+
+Attribute Section: gnu
+File Attributes
+  Tag_GNU_MIPS_ABI_FP: Hard float \(32-bit CPU, Any FPU\)
+
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: 32
+CPR1 size: 32
+CPR2 size: 0
+FP ABI: Hard float \(32-bit CPU, Any FPU\)
+ISA Extension: .*
+ASEs:
+	None
+FLAGS 1: 0000000.
+FLAGS 2: 00000000
diff --git a/gas/testsuite/gas/mips/attr-gnu-abi-fp-5.s b/gas/testsuite/gas/mips/attr-gnu-abi-fp-5.s
new file mode 100644
index 00000000000..8d861309768
--- /dev/null
+++ b/gas/testsuite/gas/mips/attr-gnu-abi-fp-5.s
@@ -0,0 +1 @@
+.gnu_attribute Tag_GNU_MIPS_ABI_FP,5
diff --git a/gas/testsuite/gas/mips/attr-gnu-abi-fp-6.d b/gas/testsuite/gas/mips/attr-gnu-abi-fp-6.d
new file mode 100644
index 00000000000..ecb6fcd42a8
--- /dev/null
+++ b/gas/testsuite/gas/mips/attr-gnu-abi-fp-6.d
@@ -0,0 +1,21 @@
+#as: -32 -mips32r2 -mfp64
+#source: attr-gnu-abi-fp-6.s
+#readelf: -A
+#name: MIPS gnu_attribute Tag_GNU_MIPS_ABI_FP,6
+
+Attribute Section: gnu
+File Attributes
+  Tag_GNU_MIPS_ABI_FP: Hard float \(32-bit CPU, 64-bit FPU\)
+
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: 32
+CPR1 size: 64
+CPR2 size: 0
+FP ABI: Hard float \(32-bit CPU, 64-bit FPU\)
+ISA Extension: .*
+ASEs:
+	None
+FLAGS 1: 0000000.
+FLAGS 2: 00000000
diff --git a/gas/testsuite/gas/mips/attr-gnu-abi-fp-6.s b/gas/testsuite/gas/mips/attr-gnu-abi-fp-6.s
new file mode 100644
index 00000000000..d0eefe4e50a
--- /dev/null
+++ b/gas/testsuite/gas/mips/attr-gnu-abi-fp-6.s
@@ -0,0 +1 @@
+.gnu_attribute Tag_GNU_MIPS_ABI_FP,6
diff --git a/gas/testsuite/gas/mips/attr-gnu-abi-msa-1.d b/gas/testsuite/gas/mips/attr-gnu-abi-msa-1.d
index 97fc8bf3f46..a4868af9c86 100644
--- a/gas/testsuite/gas/mips/attr-gnu-abi-msa-1.d
+++ b/gas/testsuite/gas/mips/attr-gnu-abi-msa-1.d
@@ -4,7 +4,7 @@
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_MIPS_ABI_FP: Hard float \(double precision\)
+  Tag_GNU_MIPS_ABI_FP: Hard float \(.*\)
   Tag_GNU_MIPS_ABI_MSA: 128-bit MSA
 
 #...
diff --git a/gas/testsuite/gas/mips/branch-absolute-addend.d b/gas/testsuite/gas/mips/branch-absolute-addend.d
index df868468ff1..8760db07fe6 100644
--- a/gas/testsuite/gas/mips/branch-absolute-addend.d
+++ b/gas/testsuite/gas/mips/branch-absolute-addend.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS branch to absolute expression with addend
-#as: -32
+#as: -32 -mips2
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/branch-absolute.d b/gas/testsuite/gas/mips/branch-absolute.d
index 816c139e778..6199f17af5c 100644
--- a/gas/testsuite/gas/mips/branch-absolute.d
+++ b/gas/testsuite/gas/mips/branch-absolute.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS branch to absolute expression
-#as: -32
+#as: -32 -mips2
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/branch-addend-micromips.d b/gas/testsuite/gas/mips/branch-addend-micromips.d
index 345d9df9bfd..9b3313fe456 100644
--- a/gas/testsuite/gas/mips/branch-addend-micromips.d
+++ b/gas/testsuite/gas/mips/branch-addend-micromips.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: microMIPS BAL addend encoding
-#as: -32
+#as: -32 -mips32r2
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/branch-addend.d b/gas/testsuite/gas/mips/branch-addend.d
index ecee734abd4..4f12717ddfb 100644
--- a/gas/testsuite/gas/mips/branch-addend.d
+++ b/gas/testsuite/gas/mips/branch-addend.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS BAL addend encoding
-#as: -32
+#as: -32 -mips32r2
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/branch-extern-2.d b/gas/testsuite/gas/mips/branch-extern-2.d
index 4c0078fb04b..e12d3cabb50 100644
--- a/gas/testsuite/gas/mips/branch-extern-2.d
+++ b/gas/testsuite/gas/mips/branch-extern-2.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: microMIPS branch to an external symbol
-#as: -32 -KPIC -mmicromips
+#as: -32 -KPIC -mips32r2 -mmicromips
 #source: branch-extern.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/branch-extern-4.d b/gas/testsuite/gas/mips/branch-extern-4.d
index 7aa73566e07..f76278dae44 100644
--- a/gas/testsuite/gas/mips/branch-extern-4.d
+++ b/gas/testsuite/gas/mips/branch-extern-4.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: microMIPS relaxed branch to an external symbol
-#as: -32 -KPIC -mmicromips --relax-branch
+#as: -32 -KPIC -mips32r2 -mmicromips --relax-branch
 #source: branch-extern.s
 #warning_output: branch-extern.l
 
diff --git a/gas/testsuite/gas/mips/branch-local-1.d b/gas/testsuite/gas/mips/branch-local-1.d
index f85bb8da5ff..f4d2f955654 100644
--- a/gas/testsuite/gas/mips/branch-local-1.d
+++ b/gas/testsuite/gas/mips/branch-local-1.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS branch local symbol relocation 1
-#as: -32
+#as: -32 -mips32r2
 #source: branch-local-1.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/branch-local-2.d b/gas/testsuite/gas/mips/branch-local-2.d
index e11569610a6..b8d34f72f66 100644
--- a/gas/testsuite/gas/mips/branch-local-2.d
+++ b/gas/testsuite/gas/mips/branch-local-2.d
@@ -1,3 +1,3 @@
 #name: MIPS branch local symbol relocation 2
-#as: -32
+#as: -32 -mips32r2
 #error_output: branch-local-2.l
diff --git a/gas/testsuite/gas/mips/branch-local-3.d b/gas/testsuite/gas/mips/branch-local-3.d
index 4dc3a59059b..06f9a769f01 100644
--- a/gas/testsuite/gas/mips/branch-local-3.d
+++ b/gas/testsuite/gas/mips/branch-local-3.d
@@ -1,3 +1,3 @@
 #name: MIPS branch local symbol relocation 3
-#as: -32
+#as: -32 -mips32r2
 #error_output: branch-local-3.l
diff --git a/gas/testsuite/gas/mips/branch-local-4.d b/gas/testsuite/gas/mips/branch-local-4.d
index cf5f8b3cc3f..7675dacb737 100644
--- a/gas/testsuite/gas/mips/branch-local-4.d
+++ b/gas/testsuite/gas/mips/branch-local-4.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS branch local symbol relocation 4
-#as: -32
+#as: -32 -mips32r2
 #source: branch-local-4.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/branch-local-5.d b/gas/testsuite/gas/mips/branch-local-5.d
index 252defb8917..1c43885f83e 100644
--- a/gas/testsuite/gas/mips/branch-local-5.d
+++ b/gas/testsuite/gas/mips/branch-local-5.d
@@ -1,3 +1,3 @@
 #name: MIPS branch local symbol relocation 5
-#as: -32
+#as: -32 -mips1
 #error_output: branch-local-5.l
diff --git a/gas/testsuite/gas/mips/branch-local-6.d b/gas/testsuite/gas/mips/branch-local-6.d
index dd7c9809871..276ed3eddc6 100644
--- a/gas/testsuite/gas/mips/branch-local-6.d
+++ b/gas/testsuite/gas/mips/branch-local-6.d
@@ -1,3 +1,3 @@
 #name: MIPS branch local symbol relocation 6
-#as: -32
+#as: -32 -mips32r2
 #error_output: branch-local-6.l
diff --git a/gas/testsuite/gas/mips/branch-local-7.d b/gas/testsuite/gas/mips/branch-local-7.d
index 0cc2a1140bb..d490a7bfebe 100644
--- a/gas/testsuite/gas/mips/branch-local-7.d
+++ b/gas/testsuite/gas/mips/branch-local-7.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS branch local symbol relocation 7
-#as: -32
+#as: -32 -mips32r2
 #source: branch-local-7.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/branch-local-ignore-2.d b/gas/testsuite/gas/mips/branch-local-ignore-2.d
index ddac741f65d..6674a2d4043 100644
--- a/gas/testsuite/gas/mips/branch-local-ignore-2.d
+++ b/gas/testsuite/gas/mips/branch-local-ignore-2.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS branch local symbol relocation 2 (ignore branch ISA)
-#as: -32 -mignore-branch-isa
+#as: -32 -mips32r2 -mignore-branch-isa
 #source: branch-local-2.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/branch-local-ignore-3.d b/gas/testsuite/gas/mips/branch-local-ignore-3.d
index 918a2cedfda..433fc414a14 100644
--- a/gas/testsuite/gas/mips/branch-local-ignore-3.d
+++ b/gas/testsuite/gas/mips/branch-local-ignore-3.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn -mmips:isa32r6
 #name: MIPS branch local symbol relocation 3 (ignore branch ISA)
-#as: -32 -mignore-branch-isa
+#as: -32 -mips32r2 -mignore-branch-isa
 #source: branch-local-3.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/branch-local-ignore-5.d b/gas/testsuite/gas/mips/branch-local-ignore-5.d
index 94ffe196900..3102ee5c6aa 100644
--- a/gas/testsuite/gas/mips/branch-local-ignore-5.d
+++ b/gas/testsuite/gas/mips/branch-local-ignore-5.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS branch local symbol relocation 5 (ignore branch ISA)
-#as: -32 -mignore-branch-isa
+#as: -32 -mips1 -mignore-branch-isa
 #source: branch-local-5.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/branch-local-ignore-6.d b/gas/testsuite/gas/mips/branch-local-ignore-6.d
index 156568822e3..71d110d1856 100644
--- a/gas/testsuite/gas/mips/branch-local-ignore-6.d
+++ b/gas/testsuite/gas/mips/branch-local-ignore-6.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS branch local symbol relocation 6 (ignore branch ISA)
-#as: -32 -mignore-branch-isa
+#as: -32 -mips32r2 -mignore-branch-isa
 #source: branch-local-6.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/branch-section-1.d b/gas/testsuite/gas/mips/branch-section-1.d
index 7782d0c0754..08c678d27ed 100644
--- a/gas/testsuite/gas/mips/branch-section-1.d
+++ b/gas/testsuite/gas/mips/branch-section-1.d
@@ -12,6 +12,6 @@ Disassembly of section \.text:
 	\.\.\.
 
 Disassembly of section \.init:
-[0-9a-f]+ <[^>]*> 03e00008 	jr	ra
+[0-9a-f]+ <[^>]*> 03e0000[89] 	jr	ra
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
diff --git a/gas/testsuite/gas/mips/branch-section-2.d b/gas/testsuite/gas/mips/branch-section-2.d
index 6009fe5b120..caf092c932a 100644
--- a/gas/testsuite/gas/mips/branch-section-2.d
+++ b/gas/testsuite/gas/mips/branch-section-2.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: microMIPS branch to a different section
-#as: -32 -mmicromips
+#as: -32 -mips32r2 -mmicromips
 #source: branch-section.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/branch-section-3.d b/gas/testsuite/gas/mips/branch-section-3.d
index b10fcde731d..d9072cbe5ac 100644
--- a/gas/testsuite/gas/mips/branch-section-3.d
+++ b/gas/testsuite/gas/mips/branch-section-3.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS relaxed branch to a different section
-#as: -32 --relax-branch
+#as: -32 -mips32r2 --relax-branch
 #source: branch-section.s
 #warning_output: branch-section.l
 
diff --git a/gas/testsuite/gas/mips/branch-section-4.d b/gas/testsuite/gas/mips/branch-section-4.d
index b6ad0bba6b2..a831b6d06f0 100644
--- a/gas/testsuite/gas/mips/branch-section-4.d
+++ b/gas/testsuite/gas/mips/branch-section-4.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: microMIPS relaxed branch to a different section
-#as: -32 -mmicromips --relax-branch
+#as: -32 -mips32r2 -mmicromips --relax-branch
 #source: branch-section.s
 #warning_output: branch-section.l
 
diff --git a/gas/testsuite/gas/mips/branch-weak-1.d b/gas/testsuite/gas/mips/branch-weak-1.d
index 859a2ca69fb..349b5d96c8d 100644
--- a/gas/testsuite/gas/mips/branch-weak-1.d
+++ b/gas/testsuite/gas/mips/branch-weak-1.d
@@ -10,6 +10,6 @@ Disassembly of section \.text:
 [ 	]*[0-9a-f]+: R_MIPS_PC16	bar
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
-[0-9a-f]+ <[^>]*> 03e00008 	jr	ra
+[0-9a-f]+ <[^>]*> 03e0000[89] 	jr	ra
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
diff --git a/gas/testsuite/gas/mips/branch-weak-2.d b/gas/testsuite/gas/mips/branch-weak-2.d
index 61a10e00e6e..a7fbcabb2db 100644
--- a/gas/testsuite/gas/mips/branch-weak-2.d
+++ b/gas/testsuite/gas/mips/branch-weak-2.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: microMIPS branch to a weak symbol
-#as: -32 -mmicromips --defsym align=12
+#as: -32 -mips32r2 -mmicromips --defsym align=12
 #source: branch-weak.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/branch-weak-3.d b/gas/testsuite/gas/mips/branch-weak-3.d
index 8e6e8cfe4fe..11ceade64e0 100644
--- a/gas/testsuite/gas/mips/branch-weak-3.d
+++ b/gas/testsuite/gas/mips/branch-weak-3.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS relaxed branch to a weak symbol
-#as: -32 --relax-branch --defsym align=12
+#as: -32 -mips1 --relax-branch --defsym align=12
 #source: branch-weak.s
 #warning_output: branch-weak.l
 
diff --git a/gas/testsuite/gas/mips/branch-weak-4.d b/gas/testsuite/gas/mips/branch-weak-4.d
index d21e1477b06..8cc1f51ad32 100644
--- a/gas/testsuite/gas/mips/branch-weak-4.d
+++ b/gas/testsuite/gas/mips/branch-weak-4.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: microMIPS relaxed branch to a weak symbol
-#as: -32 -mmicromips --relax-branch --defsym align=12
+#as: -32 -mips32r2 -mmicromips --relax-branch --defsym align=12
 #source: branch-weak.s
 #warning_output: branch-weak.l
 
diff --git a/gas/testsuite/gas/mips/branch-weak-5.d b/gas/testsuite/gas/mips/branch-weak-5.d
index 13d8bdf13fc..67cd02ba8f5 100644
--- a/gas/testsuite/gas/mips/branch-weak-5.d
+++ b/gas/testsuite/gas/mips/branch-weak-5.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: microMIPS short branch to a weak symbol
-#as: -32 -mmicromips --defsym align=4
+#as: -32 -mips32r2 -mmicromips --defsym align=4
 #source: branch-weak.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/branch-weak-6.d b/gas/testsuite/gas/mips/branch-weak-6.d
index e16b1b89c16..f7076a79cc5 100644
--- a/gas/testsuite/gas/mips/branch-weak-6.d
+++ b/gas/testsuite/gas/mips/branch-weak-6.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch to a weak symbol
-#as: -32 -mips16 --defsym align=12
+#as: -32 -mips1 -mips16 --defsym align=12
 #source: branch-weak.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/branch-weak-7.d b/gas/testsuite/gas/mips/branch-weak-7.d
index b291289fbfb..90743d43216 100644
--- a/gas/testsuite/gas/mips/branch-weak-7.d
+++ b/gas/testsuite/gas/mips/branch-weak-7.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 short branch to a weak symbol
-#as: -32 -mips16 --defsym align=4
+#as: -32 -mips1 -mips16 --defsym align=4
 #source: branch-weak.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/comdat-reloc-r6.d b/gas/testsuite/gas/mips/comdat-reloc-r6.d
new file mode 100644
index 00000000000..513589e73d3
--- /dev/null
+++ b/gas/testsuite/gas/mips/comdat-reloc-r6.d
@@ -0,0 +1,34 @@
+#readelf: -gr
+#name: MIPS ELF o32 PIC comdat GOT16/LO16 relocation pairing
+#as: -32 -mno-pdr -mips32r6
+#source: comdat-reloc.s
+
+# Make sure the orphan GOT16 relocation is paired with LO16 for a local
+# symbol in a comdat section, i.e. rather than this:
+#
+# 00000014  00000509 R_MIPS_GOT16      00000000   foo
+# 00000020  00000506 R_MIPS_LO16       00000000   foo
+# 0000001c  00000509 R_MIPS_GOT16      00000000   foo
+#
+# we have this:
+#
+# 00000014  00000509 R_MIPS_GOT16      00000000   foo
+# 00000024  00000509 R_MIPS_GOT16      00000000   foo
+# 0000001c  00000506 R_MIPS_LO16       00000000   foo
+
+#...
+COMDAT group section \[.....\] `\.group' \[bar\] contains .+ sections:
+   \[Index\]    Name
+   \[.....\]   \.text\.foo
+   \[.....\]   \.text\.bar
+#...
+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
+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
+#pass
diff --git a/gas/testsuite/gas/mips/comdat-reloc.d b/gas/testsuite/gas/mips/comdat-reloc.d
index 12d092a5bb1..f9bc12fdac9 100644
--- a/gas/testsuite/gas/mips/comdat-reloc.d
+++ b/gas/testsuite/gas/mips/comdat-reloc.d
@@ -1,6 +1,6 @@
 #readelf: -gr
 #name: MIPS ELF o32 PIC comdat GOT16/LO16 relocation pairing
-#as: -32 -mno-pdr
+#as: -32 -mno-pdr -mips1
 
 # Make sure the orphan GOT16 relocation is paired with LO16 for a local
 # symbol in a comdat section, i.e. rather than this:
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-1.d b/gas/testsuite/gas/mips/compact-eh-eb-1.d
index c4121629f46..de88882296d 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-1.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-1.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EB #1 with personality ID and FDE data
 #source: compact-eh-1.s
-#as: -EB -mno-pdr
+#as: -march=from-abi -EB -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-2.d b/gas/testsuite/gas/mips/compact-eh-eb-2.d
index e0885864bc5..e8d9f489d92 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-2.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-2.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EB #2 with personality routine and FDE data
 #source: compact-eh-2.s
-#as: -EB -mno-pdr
+#as: -march=from-abi -EB -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-3.d b/gas/testsuite/gas/mips/compact-eh-eb-3.d
index 2f0e8447fc2..3a5345c79c6 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-3.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-3.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EB #3 with personality id and large FDE data
 #source: compact-eh-3.s
-#as: -EB -mno-pdr
+#as: -march=from-abi -EB -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-4.d b/gas/testsuite/gas/mips/compact-eh-eb-4.d
index 4ca4a24bc19..a39ab45455c 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-4.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-4.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EB #4 with personality id, FDE data and LSDA
 #source: compact-eh-4.s
-#as: -EB -mno-pdr
+#as: -march=from-abi -EB -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-5.d b/gas/testsuite/gas/mips/compact-eh-eb-5.d
index 298d2831a9d..bc568353605 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-5.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-5.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EB #5 with personality routine, FDE data and LSDA
 #source: compact-eh-5.s
-#as: -EB -mno-pdr
+#as: -march=from-abi -EB -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-6.d b/gas/testsuite/gas/mips/compact-eh-eb-6.d
index 3766ecb7432..a3d13c50035 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-6.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-6.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EB #6 with personality id, LSDA and large FDE data
 #source: compact-eh-6.s
-#as: -EB -mno-pdr
+#as: -march=from-abi -EB -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-7.d b/gas/testsuite/gas/mips/compact-eh-eb-7.d
index 8c891237fee..82da65ca286 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-7.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-7.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EB #7 with personality id and fallback FDE
 #source: compact-eh-7.s
-#as: -EB -mno-pdr
+#as: -march=from-abi -EB -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-el-1.d b/gas/testsuite/gas/mips/compact-eh-el-1.d
index 7046dd4cfde..d88871242aa 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-1.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-1.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EL #1 with personality ID and FDE data
 #source: compact-eh-1.s
-#as: -EL -mno-pdr
+#as: -march=from-abi -EL -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-el-2.d b/gas/testsuite/gas/mips/compact-eh-el-2.d
index 3573670880c..b589122af59 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-2.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-2.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EL #2 with personality routine and FDE data
 #source: compact-eh-2.s
-#as: -EL -mno-pdr
+#as: -march=from-abi -EL -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-el-3.d b/gas/testsuite/gas/mips/compact-eh-el-3.d
index b426ec96566..bffe5772343 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-3.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-3.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EL #3 with personality id and large FDE data
 #source: compact-eh-3.s
-#as: -EL -mno-pdr
+#as: -march=from-abi -EL -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-el-4.d b/gas/testsuite/gas/mips/compact-eh-el-4.d
index 67d85926331..85bc6d10e1d 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-4.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-4.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EL #4 with personality id, FDE data and LSDA
 #source: compact-eh-4.s
-#as: -EL -mno-pdr
+#as: -march=from-abi -EL -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-el-5.d b/gas/testsuite/gas/mips/compact-eh-el-5.d
index 623cc067dbd..ffa93b6e7e8 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-5.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-5.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EL #5 with personality routine, FDE data and LSDA
 #source: compact-eh-5.s
-#as: -EL -mno-pdr
+#as: -march=from-abi -EL -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-el-6.d b/gas/testsuite/gas/mips/compact-eh-el-6.d
index 7d5e2dd15c3..3dc8fb9ac57 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-6.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-6.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EL #6 with personality id, LSDA and large FDE data
 #source: compact-eh-6.s
-#as: -EL -mno-pdr
+#as: -march=from-abi -EL -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-el-7.d b/gas/testsuite/gas/mips/compact-eh-el-7.d
index 7296c606e01..626f84c0202 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-7.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-7.d
@@ -1,7 +1,7 @@
 #objdump: -sr
 #name: Compact EH EL #7 with personality id and fallback FDE
 #source: compact-eh-7.s
-#as: -EL -mno-pdr
+#as: -march=from-abi -EL -mno-pdr
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/elf-rel.d b/gas/testsuite/gas/mips/elf-rel.d
index bb7077eb771..27d3d8848d4 100644
--- a/gas/testsuite/gas/mips/elf-rel.d
+++ b/gas/testsuite/gas/mips/elf-rel.d
@@ -48,12 +48,12 @@ OFFSET +TYPE +VALUE
 
 Contents of section \.text:
  0000 3c010000 3c010000 3c010001 3c010001  .*
- 0010 3c010000 3c010001 20210018 2021001c  .*
- 0020 20210018 2021001c 20218018 2021fffc  .*
+ 0010 3c010000 3c010001 24210018 2421001c  .*
+ 0020 24210018 2421001c 24218018 2421fffc  .*
  0030 3c010001 3c010001 3c010002 3c010002  .*
- 0040 3c010001 3c010001 2021bffe 2021c002  .*
- 0050 2021bffe 2021c002 20213ffe 2021bffa  .*
+ 0040 3c010001 3c010001 2421bffe 2421c002  .*
+ 0050 2421bffe 2421c002 24213ffe 2421bffa  .*
  0060 3c010001 3c010001 3c010002 3c010002  .*
- 0070 3c010001 3c010001 2021bffe 2021c002  .*
- 0080 2021bffe 2021c002 20213ffe 2021bffa  .*
+ 0070 3c010001 3c010001 2421bffe 2421c002  .*
+ 0080 2421bffe 2421c002 24213ffe 2421bffa  .*
 #pass
diff --git a/gas/testsuite/gas/mips/elf-rel.s b/gas/testsuite/gas/mips/elf-rel.s
index 873bc5fd86a..06c67a659bf 100644
--- a/gas/testsuite/gas/mips/elf-rel.s
+++ b/gas/testsuite/gas/mips/elf-rel.s
@@ -12,12 +12,12 @@ l2	= l0+49150
 	lui	$at,%hi(l0-4)
 	lui	$at,%hi(l1+0x8000)
 l1:		
-	addi	$at,$at,%lo(l1)
-	addi	$at,$at,%lo(l1+0x10004)
-	addi	$at,$at,%lo(l1+0x10000)
-	addi	$at,$at,%lo(l1+4)
-	addi	$at,$at,%lo(l1+0x8000)
-	addi	$at,$at,%lo(l0-4)
+	addiu	$at,$at,%lo(l1)
+	addiu	$at,$at,%lo(l1+0x10004)
+	addiu	$at,$at,%lo(l1+0x10000)
+	addiu	$at,$at,%lo(l1+4)
+	addiu	$at,$at,%lo(l1+0x8000)
+	addiu	$at,$at,%lo(l0-4)
 
 	lui	$at,%hi(l2)
 	lui	$at,%hi(l2+4)
@@ -25,12 +25,12 @@ l1:
 	lui	$at,%hi(l2+0x10004)
 	lui	$at,%hi(l2-4)
 	lui	$at,%hi(l2+0x8000)
-	addi	$at,$at,%lo(l2)
-	addi	$at,$at,%lo(l2+4)
-	addi	$at,$at,%lo(l2+0x10000)
-	addi	$at,$at,%lo(l2+0x10004)
-	addi	$at,$at,%lo(l2+0x8000)
-	addi	$at,$at,%lo(l2-4)
+	addiu	$at,$at,%lo(l2)
+	addiu	$at,$at,%lo(l2+4)
+	addiu	$at,$at,%lo(l2+0x10000)
+	addiu	$at,$at,%lo(l2+0x10004)
+	addiu	$at,$at,%lo(l2+0x8000)
+	addiu	$at,$at,%lo(l2-4)
 
 	lui	$at,%hi((l2))
 	lui	$at,%hi(((l2+4)))
@@ -38,9 +38,9 @@ l1:
 	lui	$at,%hi(((((l2+0x10004)))))
 	lui	$at,%hi((((((l2-4))))))
 	lui	$at,%hi(((((((l2+0x8000)))))))
-	addi	$at,$at,%lo((l2))
-	addi	$at,$at,%lo(((l2+4)))
-	addi	$at,$at,%lo((((l2+0x10000))))
-	addi	$at,$at,%lo(((((l2+0x10004)))))
-	addi	$at,$at,%lo((((((l2+0x8000))))))
-	addi	$at,$at,%lo(((((((l2-4)))))))
+	addiu	$at,$at,%lo((l2))
+	addiu	$at,$at,%lo(((l2+4)))
+	addiu	$at,$at,%lo((((l2+0x10000))))
+	addiu	$at,$at,%lo(((((l2+0x10004)))))
+	addiu	$at,$at,%lo((((((l2+0x8000))))))
+	addiu	$at,$at,%lo(((((((l2-4)))))))
diff --git a/gas/testsuite/gas/mips/elf-rel6.d b/gas/testsuite/gas/mips/elf-rel6.d
index cea8d7fd81b..4918344b54e 100644
--- a/gas/testsuite/gas/mips/elf-rel6.d
+++ b/gas/testsuite/gas/mips/elf-rel6.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses
 #name: MIPS ELF reloc 6
-#as: -32
+#as: -32 -mips1
 
 .*: +file format elf.*mips.*
 
diff --git a/gas/testsuite/gas/mips/elf_ase_micromips-2.d b/gas/testsuite/gas/mips/elf_ase_micromips-2.d
index 0eab856bd53..b7c38374853 100644
--- a/gas/testsuite/gas/mips/elf_ase_micromips-2.d
+++ b/gas/testsuite/gas/mips/elf_ase_micromips-2.d
@@ -1,7 +1,7 @@
 # name: ELF microMIPS ASE markings 2
 # source: nop.s
 # objdump: -p
-# as: -32 -mmicromips
+# as: -32 -mips32r2 -mmicromips
 
 .*:.*file format.*mips.*
 private flags = [0-9a-f]*[2367abef]......: .*[[,]micromips[],].*
diff --git a/gas/testsuite/gas/mips/elf_ase_micromips.d b/gas/testsuite/gas/mips/elf_ase_micromips.d
index 507e2708cc0..9afc1f3e6c5 100644
--- a/gas/testsuite/gas/mips/elf_ase_micromips.d
+++ b/gas/testsuite/gas/mips/elf_ase_micromips.d
@@ -1,7 +1,7 @@
 # name: ELF microMIPS ASE markings
 # source: empty.s
 # objdump: -p
-# as: -32 -mmicromips
+# as: -32 -mips32r2 -mmicromips
 
 .*:.*file format.*mips.*
 !private flags = .*micromips.*
diff --git a/gas/testsuite/gas/mips/elf_ase_mips16-2.d b/gas/testsuite/gas/mips/elf_ase_mips16-2.d
index d19a07d4912..bedf56c2127 100644
--- a/gas/testsuite/gas/mips/elf_ase_mips16-2.d
+++ b/gas/testsuite/gas/mips/elf_ase_mips16-2.d
@@ -1,7 +1,7 @@
 # name: ELF MIPS16 ASE markings 2
 # source: nop.s
 # objdump: -p
-# as: -32 -mips16
+# as: -32 -mips1 -mips16
 
 .*:.*file format.*mips.*
 private flags = [0-9a-f]*[4-7c-f]......: .*[[,]mips16[],].*
diff --git a/gas/testsuite/gas/mips/elf_ase_mips16.d b/gas/testsuite/gas/mips/elf_ase_mips16.d
index 20e0d8a5ba4..1b9c24ae959 100644
--- a/gas/testsuite/gas/mips/elf_ase_mips16.d
+++ b/gas/testsuite/gas/mips/elf_ase_mips16.d
@@ -1,7 +1,7 @@
 # name: ELF MIPS16 ASE markings
 # source: empty.s
 # objdump: -p
-# as: -32 -mips16
+# as: -32 -mips1 -mips16
 
 .*:.*file format.*mips.*
 !private flags = .*mips16.*
diff --git a/gas/testsuite/gas/mips/elfel-rel.d b/gas/testsuite/gas/mips/elfel-rel.d
index 7a9a3b92bfb..11fc7ad2157 100644
--- a/gas/testsuite/gas/mips/elfel-rel.d
+++ b/gas/testsuite/gas/mips/elfel-rel.d
@@ -49,12 +49,12 @@ OFFSET +TYPE +VALUE
 
 Contents of section \.text:
  0000 0000013c 0000013c 0100013c 0100013c  .*
- 0010 0000013c 0100013c 18002120 1c002120  .*
- 0020 18002120 1c002120 18802120 fcff2120  .*
+ 0010 0000013c 0100013c 18002124 1c002124  .*
+ 0020 18002124 1c002124 18802124 fcff2124  .*
  0030 0100013c 0100013c 0200013c 0200013c  .*
- 0040 0100013c 0100013c febf2120 02c02120  .*
- 0050 febf2120 02c02120 fe3f2120 fabf2120  .*
+ 0040 0100013c 0100013c febf2124 02c02124  .*
+ 0050 febf2124 02c02124 fe3f2124 fabf2124  .*
  0060 0100013c 0100013c 0200013c 0200013c  .*
- 0070 0100013c 0100013c febf2120 02c02120  .*
- 0080 febf2120 02c02120 fe3f2120 fabf2120  .*
+ 0070 0100013c 0100013c febf2124 02c02124  .*
+ 0080 febf2124 02c02124 fe3f2124 fabf2124  .*
 #pass
diff --git a/gas/testsuite/gas/mips/insn-isa-mode.d b/gas/testsuite/gas/mips/insn-isa-mode.d
index 9d2c61b96c1..6307ae57266 100644
--- a/gas/testsuite/gas/mips/insn-isa-mode.d
+++ b/gas/testsuite/gas/mips/insn-isa-mode.d
@@ -1,6 +1,6 @@
 #objdump: -dr --show-raw-insn
 #name: microMIPS ISA mode for .insn label references
-#as: -32
+#as: -32 -mips32r2
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/insn-opts.d b/gas/testsuite/gas/mips/insn-opts.d
index a61c95e12b6..2466397fd07 100644
--- a/gas/testsuite/gas/mips/insn-opts.d
+++ b/gas/testsuite/gas/mips/insn-opts.d
@@ -1,5 +1,6 @@
 #objdump: -dtz -j .text --prefix-addresses --show-raw-insn
 #name: MIPS .insn default file options
+#as: -march=from-abi
 
 # Check that .insn at the beginning of assembly sees default file options
 # such as the ISA mode right.
diff --git a/gas/testsuite/gas/mips/jalx-addend.d b/gas/testsuite/gas/mips/jalx-addend.d
index 442bc69741b..a022eafe861 100644
--- a/gas/testsuite/gas/mips/jalx-addend.d
+++ b/gas/testsuite/gas/mips/jalx-addend.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS JAL/JALX addend encoding
-#as: -32
+#as: -32 -mips32r2
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/jalx-imm.d b/gas/testsuite/gas/mips/jalx-imm.d
index aa487ffc176..4d265b59425 100644
--- a/gas/testsuite/gas/mips/jalx-imm.d
+++ b/gas/testsuite/gas/mips/jalx-imm.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS JAL/JALX immediate operand encoding
-#as: -32
+#as: -32 -mips32r2
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/jalx-local.d b/gas/testsuite/gas/mips/jalx-local.d
index e380160ff38..65bb9f8a2e5 100644
--- a/gas/testsuite/gas/mips/jalx-local.d
+++ b/gas/testsuite/gas/mips/jalx-local.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS JALX local symbol relocation
-#as: -32
+#as: -32 -mips32r2
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/loongson-2f-3.d b/gas/testsuite/gas/mips/loongson-2f-3.d
index 9063df1a856..5269bcc33bc 100644
--- a/gas/testsuite/gas/mips/loongson-2f-3.d
+++ b/gas/testsuite/gas/mips/loongson-2f-3.d
@@ -1,4 +1,4 @@
-#as: -mfix-loongson2f-jump
+#as: -march=loongson2f -mfix-loongson2f-jump
 #objdump: -M reg-names=numeric -dr
 #name: ST Microelectronics Loongson-2F workarounds of Jump Instruction issue
 
diff --git a/gas/testsuite/gas/mips/micromips-b16.d b/gas/testsuite/gas/mips/micromips-b16.d
index 16e8a7a9e67..e0661892e8c 100644
--- a/gas/testsuite/gas/mips/micromips-b16.d
+++ b/gas/testsuite/gas/mips/micromips-b16.d
@@ -1,6 +1,6 @@
 #objdump: -dr --show-raw-insn
 #name: microMIPS b16, bnez16, beqz16
-#as: -32 -mmicromips
+#as: -32 -mmicromips -mips32r2
 #source: micromips-b16.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/micromips-branch-absolute-addend.d b/gas/testsuite/gas/mips/micromips-branch-absolute-addend.d
index fd224b56caa..3f6e3369856 100644
--- a/gas/testsuite/gas/mips/micromips-branch-absolute-addend.d
+++ b/gas/testsuite/gas/mips/micromips-branch-absolute-addend.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: microMIPS branch to absolute expression with addend
-#as: -32
+#as: -32 -mips32r2
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/micromips-branch-absolute.d b/gas/testsuite/gas/mips/micromips-branch-absolute.d
index 7fc6b9a7832..73328726013 100644
--- a/gas/testsuite/gas/mips/micromips-branch-absolute.d
+++ b/gas/testsuite/gas/mips/micromips-branch-absolute.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: microMIPS branch to absolute expression
-#as: -32
+#as: -32 -mips32r2
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/micromips-warn-branch-delay-1.d b/gas/testsuite/gas/mips/micromips-warn-branch-delay-1.d
index b2d820ec106..43a5cca20f2 100644
--- a/gas/testsuite/gas/mips/micromips-warn-branch-delay-1.d
+++ b/gas/testsuite/gas/mips/micromips-warn-branch-delay-1.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: microMIPS fixed-size branch delay slots 1
-#as: -32 -mmicromips
+#as: -32 -mmicromips -mips32r2
 #source: micromips-warn-branch-delay-1.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/micromips-warn-branch-delay.d b/gas/testsuite/gas/mips/micromips-warn-branch-delay.d
index c30edc62d77..44fffdaaa71 100644
--- a/gas/testsuite/gas/mips/micromips-warn-branch-delay.d
+++ b/gas/testsuite/gas/mips/micromips-warn-branch-delay.d
@@ -1,6 +1,6 @@
 #objdump: -dr --show-raw-insn -M gpr-names=numeric
 #name: microMIPS fixed-size branch delay slots
-#as: -mmicromips
+#as: -mmicromips -march=from-abi
 #source: micromips-warn-branch-delay.s
 #warning_output: micromips-warn-branch-delay.l
 
diff --git a/gas/testsuite/gas/mips/mips-jalx-2.d b/gas/testsuite/gas/mips/mips-jalx-2.d
index fa8bfaceb53..2cc1323adc5 100644
--- a/gas/testsuite/gas/mips/mips-jalx-2.d
+++ b/gas/testsuite/gas/mips/mips-jalx-2.d
@@ -1,5 +1,5 @@
 #objdump: -d
-#as:
+#as: -march=from-abi
 #name: mips jalx-2
 
 .*:     file format .*
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 17eb95f4aa4..7f964ed775f 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -296,7 +296,15 @@ proc mips_arch_list_matching {args} {
 	    continue
 	}
 	if { [mips_arch_matches $arch $args] } {
-	    lappend l $arch
+	    # If the triple is mipsisa32*/mipsisa64*, we skip the 'default'
+	    # Since it will always run.
+	    if { [string compare $arch default] == 0 && [istarget mipsisa32*-*] } {
+	      continue
+	    } elseif { [string compare $arch default] == 0 && [istarget mipsisa64*-*] } {
+	      continue
+	    } else {
+	      lappend l $arch
+	    }
 	}
     }
     return $l
@@ -556,7 +564,8 @@ if { [istarget mips*-*-vxworks*] } {
 	"MIPS invalid switch to SVR4 PIC from VxWorks PIC"
 } elseif { [istarget mips*-*-*] } {
     set addr32 [expr [istarget mipstx39*-*-*] || [istarget mips-*-linux*] || [istarget mipsel-*-linux*] \
-		     || [istarget mipsisa32*-*-linux*] || [istarget mipsisa32*el-*-linux*]]
+		     || [istarget mipsisa32*-*-linux*] || [istarget mipsisa32*el-*-linux*] \
+		     || [istarget mips-*-elf] || [istarget mipsel-*-elf]]
     set has_newabi [expr [istarget *-*-irix6*] || [istarget mips*-*-linux*] \
                          || [istarget mips*-sde-elf*] || [istarget mips*-mti-elf*] \
                          || [istarget mips*-img-elf*]]
@@ -621,7 +630,7 @@ if { [istarget mips*-*-vxworks*] } {
     # we use and some space will have been already consumed.  The exact
     # amount depends on the host's programming model.
     for { set count 960 } { $count <= 1024 } { incr count } {
-	run_list_test "branch-swap-2" "--defsym count=$count" \
+	run_list_test "branch-swap-2" "-march=from-abi --defsym count=$count" \
 	    "MIPS branch swapping ($count)"
     }
 
@@ -712,8 +721,8 @@ if { [istarget mips*-*-vxworks*] } {
     run_dump_test "compact-eh-el-5"
     run_dump_test "compact-eh-el-6"
     run_dump_test "compact-eh-el-7"
-    run_list_test "compact-eh-err1"
-    run_list_test "compact-eh-err2"
+    run_list_test "compact-eh-err1" "-march=from-abi"
+    run_list_test "compact-eh-err2" "-march=from-abi"
 
     run_dump_test "div"
 
@@ -950,30 +959,30 @@ if { [istarget mips*-*-vxworks*] } {
 	run_dump_test "jalx-local-n64"
     }
 
-    run_list_test "unaligned-jump-1" "-32" \
+    run_list_test "unaligned-jump-1" "-32 -mips32r2" \
 				"MIPS jump to unaligned symbol 1"
-    run_list_test "unaligned-jump-2" "-32" \
+    run_list_test "unaligned-jump-2" "-32 -mips32r2" \
 				"MIPS jump to unaligned symbol 2"
     if $has_newabi {
 	run_dump_test "unaligned-jump-3"
     }
-    run_list_test "unaligned-jump-mips16-1" "-32" \
+    run_list_test "unaligned-jump-mips16-1" "-32 -mips1" \
 				"MIPS16 jump to unaligned symbol 1"
-    run_list_test "unaligned-jump-mips16-2" "-32" \
+    run_list_test "unaligned-jump-mips16-2" "-32 -mips1" \
 				"MIPS16 jump to unaligned symbol 2"
     if $has_newabi {
 	run_dump_test "unaligned-jump-mips16-3"
     }
-    run_list_test "unaligned-jump-micromips-1" "-32" \
+    run_list_test "unaligned-jump-micromips-1" "-32 -mips32r2" \
 				"microMIPS jump to unaligned symbol 1"
-    run_list_test "unaligned-jump-micromips-2" "-32" \
+    run_list_test "unaligned-jump-micromips-2" "-32 -mips32r2" \
 				"microMIPS jump to unaligned symbol 2"
     if $has_newabi {
 	run_dump_test "unaligned-jump-micromips-3"
     }
-    run_list_test "unaligned-branch-1" "-32" \
+    run_list_test "unaligned-branch-1" "-32 -mips32r2" \
 				"MIPS branch to unaligned symbol 1"
-    run_list_test "unaligned-branch-2" "-32" \
+    run_list_test "unaligned-branch-2" "-32 -mips32r2" \
 				"MIPS branch to unaligned symbol 2"
     if $has_newabi {
 	run_dump_test "unaligned-branch-3"
@@ -990,16 +999,16 @@ if { [istarget mips*-*-vxworks*] } {
 	run_dump_test "unaligned-branch-r6-5"
 	run_dump_test "unaligned-branch-r6-6"
     }
-    run_list_test "unaligned-branch-mips16-1" "-32" \
+    run_list_test "unaligned-branch-mips16-1" "-32 -mips1" \
 				"MIPS16 branch to unaligned symbol 1"
-    run_list_test "unaligned-branch-mips16-2" "-32" \
+    run_list_test "unaligned-branch-mips16-2" "-32 -mips1" \
 				"MIPS16 branch to unaligned symbol 2"
     if $has_newabi {
 	run_dump_test "unaligned-branch-mips16-3"
     }
-    run_list_test "unaligned-branch-micromips-1" "-32" \
+    run_list_test "unaligned-branch-micromips-1" "-32 -mips32r2" \
 				"microMIPS branch to unaligned symbol 1"
-    run_list_test "unaligned-branch-micromips-2" "-32" \
+    run_list_test "unaligned-branch-micromips-2" "-32 -mips32r2" \
 				"microMIPS branch to unaligned symbol 2"
     if $has_newabi {
 	run_dump_test "unaligned-branch-micromips-3"
@@ -1104,7 +1113,7 @@ if { [istarget mips*-*-vxworks*] } {
 
     run_dump_test_arches "eva"		[mips_arch_list_matching mips32r2 !octeon]
 
-    run_list_test "illegal" "-32"
+    run_list_test "illegal" "-32 -mips1"
     run_list_test "baddata1" "-32"
     run_list_test "jalr" ""
 
@@ -1238,6 +1247,7 @@ if { [istarget mips*-*-vxworks*] } {
     run_list_test_arches "elf-rel30" "-32" [mips_arch_list_all]
 
     run_dump_test "comdat-reloc"
+    run_dump_test "comdat-reloc-r6"
 
     run_dump_test "${tmips}mips${el}16-e"
     run_dump_test "${tmips}mips${el}16-f"
@@ -1592,7 +1602,7 @@ if { [istarget mips*-*-vxworks*] } {
 	run_dump_test "micromips-branch-absolute-addend-n64"
     }
     run_dump_test "micromips-b16"
-    run_list_test "micromips-ill"
+    run_list_test "micromips-ill" "-march=from-abi"
 
     run_dump_test_arches "mcu"		[mips_arch_list_matching mips32r2 \
 					    !octeon]
@@ -1646,7 +1656,7 @@ if { [istarget mips*-*-vxworks*] } {
     run_dump_test_arches "ulh-reloc"	[mips_arch_list_matching mips2 !mips32r6]
 
     run_dump_test "l_d-reloc"
-    run_list_test "bltzal"
+    run_list_test "bltzal" "-march=from-abi"
 
     run_dump_test_arches "msa"		[mips_arch_list_matching mips32r2]
     if { $has_newabi } {
@@ -1680,7 +1690,7 @@ if { [istarget mips*-*-vxworks*] } {
     run_dump_test "pcrel-reloc-5"
     run_dump_test "pcrel-reloc-5-r6"
     run_dump_test "pcrel-reloc-6"
-    run_list_test "pcrel-reloc-6" "-32 --defsym offset=4" \
+    run_list_test "pcrel-reloc-6" "-32 --defsym offset=4 -mips1" \
 	"MIPS local PC-relative relocations 6b"
 
     run_dump_test_arches "mips16-pcrel-0" [mips_arch_list_matching mips16-32]
@@ -2041,14 +2051,16 @@ if { [istarget mips*-*-vxworks*] } {
 				    [mips_arch_list_matching mips32r2]
 
     run_dump_test "attr-gnu-abi-fp-1"
+    run_dump_test "attr-gnu-abi-fp-5"
+    run_dump_test "attr-gnu-abi-fp-6"
     run_dump_test "attr-gnu-abi-msa-1"
 
     run_dump_test "module-override"
     run_dump_test "module-defer-warn1"
     run_list_test "module-defer-warn2" "-32 -mips1"
 
-    foreach testopt [list -mfp32 -mfpxx -mfp64 "-mfp64-noodd" \
-			  -msingle-float -msoft-float] {
+    foreach testopt [list -mfp32 -mfpxx -mfp64 "-mfp64-noodd" -mfp64r6 "-mfp64r6-noodd" \
+			  -msingle-float -msoft-float -msoft-float-r6] {
       foreach cmdopt [list -mfp32 -mfpxx -mfp64 "-mfp64 -mno-odd-spreg" \
 			   -msingle-float -msoft-float] {
         run_dump_test "module${testopt}" \
diff --git a/gas/testsuite/gas/mips/mips16-absolute-reloc-0.d b/gas/testsuite/gas/mips/mips16-absolute-reloc-0.d
index d352a79376a..9859f126449 100644
--- a/gas/testsuite/gas/mips/mips16-absolute-reloc-0.d
+++ b/gas/testsuite/gas/mips/mips16-absolute-reloc-0.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 absolute relocation 0
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-absolute-reloc-2.d b/gas/testsuite/gas/mips/mips16-absolute-reloc-2.d
index 4f00861a8d1..45d3a1b0363 100644
--- a/gas/testsuite/gas/mips/mips16-absolute-reloc-2.d
+++ b/gas/testsuite/gas/mips/mips16-absolute-reloc-2.d
@@ -1,3 +1,3 @@
 #name: MIPS16 absolute relocation 2
-#as: -32
+#as: -32 -mips1
 #error_output: mips16-absolute-reloc-2.l
diff --git a/gas/testsuite/gas/mips/mips16-branch-absolute-1.d b/gas/testsuite/gas/mips/mips16-branch-absolute-1.d
index ed0b9f9118e..023c4fe51f1 100644
--- a/gas/testsuite/gas/mips/mips16-branch-absolute-1.d
+++ b/gas/testsuite/gas/mips/mips16-branch-absolute-1.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch to absolute expression 1
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-absolute-2.d b/gas/testsuite/gas/mips/mips16-branch-absolute-2.d
index 49a331fd694..be0d7c085ce 100644
--- a/gas/testsuite/gas/mips/mips16-branch-absolute-2.d
+++ b/gas/testsuite/gas/mips/mips16-branch-absolute-2.d
@@ -1,4 +1,4 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch to absolute expression 2
-#as: -32
+#as: -32 -mips1
 #dump: mips16-branch-absolute-1.d
diff --git a/gas/testsuite/gas/mips/mips16-branch-absolute-addend-1.d b/gas/testsuite/gas/mips/mips16-branch-absolute-addend-1.d
index 66841c392b6..74e97825656 100644
--- a/gas/testsuite/gas/mips/mips16-branch-absolute-addend-1.d
+++ b/gas/testsuite/gas/mips/mips16-branch-absolute-addend-1.d
@@ -1,4 +1,4 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch to absolute expression with addend 1
-#as: -32
+#as: -32 -mips1
 #dump: mips16-branch-absolute-1.d
diff --git a/gas/testsuite/gas/mips/mips16-branch-absolute-addend.d b/gas/testsuite/gas/mips/mips16-branch-absolute-addend.d
index de64afb97e4..3aa1e26f204 100644
--- a/gas/testsuite/gas/mips/mips16-branch-absolute-addend.d
+++ b/gas/testsuite/gas/mips/mips16-branch-absolute-addend.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch to absolute expression with addend
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-absolute.d b/gas/testsuite/gas/mips/mips16-branch-absolute.d
index 68b3fb4e8d0..bad4676a654 100644
--- a/gas/testsuite/gas/mips/mips16-branch-absolute.d
+++ b/gas/testsuite/gas/mips/mips16-branch-absolute.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch to absolute expression
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-addend-0.d b/gas/testsuite/gas/mips/mips16-branch-addend-0.d
index 9fe83e46a51..aef3b306a61 100644
--- a/gas/testsuite/gas/mips/mips16-branch-addend-0.d
+++ b/gas/testsuite/gas/mips/mips16-branch-addend-0.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch relocation with addend 0
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-addend-1.d b/gas/testsuite/gas/mips/mips16-branch-addend-1.d
index b7b305429fe..884593c01f2 100644
--- a/gas/testsuite/gas/mips/mips16-branch-addend-1.d
+++ b/gas/testsuite/gas/mips/mips16-branch-addend-1.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch relocation with addend 1
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-addend-2.d b/gas/testsuite/gas/mips/mips16-branch-addend-2.d
index 3e61c24e5ea..0b9f5c758c5 100644
--- a/gas/testsuite/gas/mips/mips16-branch-addend-2.d
+++ b/gas/testsuite/gas/mips/mips16-branch-addend-2.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch relocation with addend 2
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-addend-3.d b/gas/testsuite/gas/mips/mips16-branch-addend-3.d
index f3ecb7516d6..aacaf413dde 100644
--- a/gas/testsuite/gas/mips/mips16-branch-addend-3.d
+++ b/gas/testsuite/gas/mips/mips16-branch-addend-3.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch relocation with addend 3
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-addend-4.d b/gas/testsuite/gas/mips/mips16-branch-addend-4.d
index 273a6e1f543..cee2aa035a3 100644
--- a/gas/testsuite/gas/mips/mips16-branch-addend-4.d
+++ b/gas/testsuite/gas/mips/mips16-branch-addend-4.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch relocation with addend 4
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-addend-5.d b/gas/testsuite/gas/mips/mips16-branch-addend-5.d
index 6b922350f9f..e3c79a49f69 100644
--- a/gas/testsuite/gas/mips/mips16-branch-addend-5.d
+++ b/gas/testsuite/gas/mips/mips16-branch-addend-5.d
@@ -1,4 +1,4 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch relocation with addend 5
-#as: -32
+#as: -32 -mips1
 #error_output: mips16-branch-addend-5.l
diff --git a/gas/testsuite/gas/mips/mips16-branch-reloc-0.d b/gas/testsuite/gas/mips/mips16-branch-reloc-0.d
index 80ad83bf7b1..79685d0a2f6 100644
--- a/gas/testsuite/gas/mips/mips16-branch-reloc-0.d
+++ b/gas/testsuite/gas/mips/mips16-branch-reloc-0.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch relocation 0
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-reloc-1.d b/gas/testsuite/gas/mips/mips16-branch-reloc-1.d
index d2ae8a7c980..e4eb5d62e4d 100644
--- a/gas/testsuite/gas/mips/mips16-branch-reloc-1.d
+++ b/gas/testsuite/gas/mips/mips16-branch-reloc-1.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch relocation 1
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-reloc-2.d b/gas/testsuite/gas/mips/mips16-branch-reloc-2.d
index 4f920d203c4..ada2644b8eb 100644
--- a/gas/testsuite/gas/mips/mips16-branch-reloc-2.d
+++ b/gas/testsuite/gas/mips/mips16-branch-reloc-2.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch relocation 2
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-reloc-3.d b/gas/testsuite/gas/mips/mips16-branch-reloc-3.d
index c8e75fba223..9b54bb77038 100644
--- a/gas/testsuite/gas/mips/mips16-branch-reloc-3.d
+++ b/gas/testsuite/gas/mips/mips16-branch-reloc-3.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch relocation 3
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-reloc-4.d b/gas/testsuite/gas/mips/mips16-branch-reloc-4.d
index a2705f09a3b..5d17b2656d9 100644
--- a/gas/testsuite/gas/mips/mips16-branch-reloc-4.d
+++ b/gas/testsuite/gas/mips/mips16-branch-reloc-4.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch relocation 4
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-reloc-5.d b/gas/testsuite/gas/mips/mips16-branch-reloc-5.d
index 6cd7ebb42e1..bd02ac2597c 100644
--- a/gas/testsuite/gas/mips/mips16-branch-reloc-5.d
+++ b/gas/testsuite/gas/mips/mips16-branch-reloc-5.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 branch relocation 5
-#as: -32
+#as: -32 -mips1
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-branch-unextended-1.d b/gas/testsuite/gas/mips/mips16-branch-unextended-1.d
index a3981560164..a77ed159a24 100644
--- a/gas/testsuite/gas/mips/mips16-branch-unextended-1.d
+++ b/gas/testsuite/gas/mips/mips16-branch-unextended-1.d
@@ -1,3 +1,3 @@
 #name: MIPS16 unextended branch instructions with relocation 1
-#as: -32
+#as: -32 -mips32
 #error_output: mips16-branch-unextended.l
diff --git a/gas/testsuite/gas/mips/mips16-branch-unextended-2.d b/gas/testsuite/gas/mips/mips16-branch-unextended-2.d
index 008bfb137d6..8d760bca8cb 100644
--- a/gas/testsuite/gas/mips/mips16-branch-unextended-2.d
+++ b/gas/testsuite/gas/mips/mips16-branch-unextended-2.d
@@ -1,3 +1,3 @@
 #name: MIPS16 unextended branch instructions with relocation 2
-#as: -32
+#as: -32 -mips32
 #error_output: mips16-branch-unextended.l
diff --git a/gas/testsuite/gas/mips/mips16-dwarf2.d b/gas/testsuite/gas/mips/mips16-dwarf2.d
index 6b79dac577d..eb609fa775f 100644
--- a/gas/testsuite/gas/mips/mips16-dwarf2.d
+++ b/gas/testsuite/gas/mips/mips16-dwarf2.d
@@ -1,6 +1,6 @@
 #readelf: -r -wl
 #name: MIPS16 DWARF2
-#as: -mabi=32 -mips16 -no-mdebug -g0
+#as: -mabi=32 -mips16 -no-mdebug -g0 -mips32
 #source: mips16-dwarf2.s
 
 Relocation section '\.rel\.debug_info' at offset .* contains 4 entries:
diff --git a/gas/testsuite/gas/mips/mips16-e.d b/gas/testsuite/gas/mips/mips16-e.d
index d64b882c81c..d4522d6e7c8 100644
--- a/gas/testsuite/gas/mips/mips16-e.d
+++ b/gas/testsuite/gas/mips/mips16-e.d
@@ -1,6 +1,6 @@
 #objdump: -rst --special-syms -mips16
 #name: MIPS16 reloc
-#as: -32 -mips16
+#as: -32 -mips16 -mips32
 
 # Check MIPS16 reloc processing
 
diff --git a/gas/testsuite/gas/mips/mips16-extend.d b/gas/testsuite/gas/mips/mips16-extend.d
index eec0b1906fb..def16c92e44 100644
--- a/gas/testsuite/gas/mips/mips16-extend.d
+++ b/gas/testsuite/gas/mips/mips16-extend.d
@@ -1,6 +1,6 @@
 #objdump: -d --prefix-addresses --show-raw-insn
 #name: MIPS16 explicit EXTEND encoding
-#as: -32
+#as: -32 -mips32
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-f.d b/gas/testsuite/gas/mips/mips16-f.d
index 9605b6f183e..62e30a31840 100644
--- a/gas/testsuite/gas/mips/mips16-f.d
+++ b/gas/testsuite/gas/mips/mips16-f.d
@@ -1,6 +1,6 @@
 #objdump: -rst -mips16
 #name: MIPS16 reloc 2
-#as: -32 -mips16
+#as: -32 -mips16 -mips32
 
 # Check MIPS16 reloc processing
 
diff --git a/gas/testsuite/gas/mips/mips16-hilo.d b/gas/testsuite/gas/mips/mips16-hilo.d
index 081993a94e5..2eabee73ba4 100644
--- a/gas/testsuite/gas/mips/mips16-hilo.d
+++ b/gas/testsuite/gas/mips/mips16-hilo.d
@@ -1,6 +1,6 @@
 #objdump: -dr
 #name: MIPS16 lui/addi
-#as: -mips16 -mabi=32
+#as: -mips16 -mabi=32 -mips32
 #source: mips16-hilo.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/mips16-insn-length-noargs.d b/gas/testsuite/gas/mips/mips16-insn-length-noargs.d
index 18047957472..6f550f45f45 100644
--- a/gas/testsuite/gas/mips/mips16-insn-length-noargs.d
+++ b/gas/testsuite/gas/mips/mips16-insn-length-noargs.d
@@ -1,6 +1,6 @@
 #objdump: -d --prefix-addresses --show-raw-insn
 #name: MIPS16 argumentless instruction size override
-#as: -32
+#as: -32 -mips32
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-jal-e.d b/gas/testsuite/gas/mips/mips16-jal-e.d
index bbccb7c1d88..0819742c2a1 100644
--- a/gas/testsuite/gas/mips/mips16-jal-e.d
+++ b/gas/testsuite/gas/mips/mips16-jal-e.d
@@ -1,6 +1,6 @@
 #objdump: -d --prefix-addresses --show-raw-insn
 #name: MIPS16 explicit extended JAL instructions
-#as: -32
+#as: -32 -mips32
 
 .*: +file format .*mips.*
 
diff --git a/gas/testsuite/gas/mips/mips16-jal-t.d b/gas/testsuite/gas/mips/mips16-jal-t.d
index adb9856c620..d5b71def4c6 100644
--- a/gas/testsuite/gas/mips/mips16-jal-t.d
+++ b/gas/testsuite/gas/mips/mips16-jal-t.d
@@ -1,3 +1,3 @@
 #name: MIPS16 explicit unextended JAL instructions
-#as: -32
+#as: -32 -mips32
 #error_output: mips16-jal-t.l
diff --git a/gas/testsuite/gas/mips/mips16-pcrel-relax-0.d b/gas/testsuite/gas/mips/mips16-pcrel-relax-0.d
index 55d15e1e624..a4cd8ca350c 100644
--- a/gas/testsuite/gas/mips/mips16-pcrel-relax-0.d
+++ b/gas/testsuite/gas/mips/mips16-pcrel-relax-0.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 PC-relative relaxation 0
-#as: -32
+#as: -32 -mips1
 
 # Check that PC-relative relaxation does not go into oscillation
 # where the address referred depends on the size of the instruction;
diff --git a/gas/testsuite/gas/mips/mips16-pcrel-relax-1.d b/gas/testsuite/gas/mips/mips16-pcrel-relax-1.d
index 1b19d45422c..9b263da261b 100644
--- a/gas/testsuite/gas/mips/mips16-pcrel-relax-1.d
+++ b/gas/testsuite/gas/mips/mips16-pcrel-relax-1.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 PC-relative relaxation 1
-#as: -32 --defsym align=1
+#as: -32 -mips1 --defsym align=1
 #source: mips16-pcrel-relax-0.s
 
 # Check that PC-relative relaxation chooses the short encoding
diff --git a/gas/testsuite/gas/mips/mips16-pcrel-relax-2.d b/gas/testsuite/gas/mips/mips16-pcrel-relax-2.d
index 6c3b4fe7ffa..0b3b5c18efc 100644
--- a/gas/testsuite/gas/mips/mips16-pcrel-relax-2.d
+++ b/gas/testsuite/gas/mips/mips16-pcrel-relax-2.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 PC-relative relaxation 2
-#as: -32
+#as: -32 -mips1
 
 # Check that PC-relative relaxation does not go into oscillation
 # where the address referred depends on the size of the instruction;
diff --git a/gas/testsuite/gas/mips/mips16-pcrel-relax-3.d b/gas/testsuite/gas/mips/mips16-pcrel-relax-3.d
index 2d0c6ca614b..337a886b113 100644
--- a/gas/testsuite/gas/mips/mips16-pcrel-relax-3.d
+++ b/gas/testsuite/gas/mips/mips16-pcrel-relax-3.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 PC-relative relaxation 3
-#as: -32 --defsym align=1
+#as: -32 -mips1 --defsym align=1
 #source: mips16-pcrel-relax-2.s
 
 # Check that PC-relative relaxation chooses the short encoding
diff --git a/gas/testsuite/gas/mips/mips16-vis-1.d b/gas/testsuite/gas/mips/mips16-vis-1.d
index 90a190afc0e..594305cd6a7 100644
--- a/gas/testsuite/gas/mips/mips16-vis-1.d
+++ b/gas/testsuite/gas/mips/mips16-vis-1.d
@@ -1,3 +1,4 @@
 # readelf: --symbols
+# as: -march=from-abi
 #...
 .*: 0+0 +2 +FUNC +GLOBAL +HIDDEN +\[MIPS16\] +[0-9]+ foo
diff --git a/gas/testsuite/gas/mips/mipsel16-e.d b/gas/testsuite/gas/mips/mipsel16-e.d
index 2e4e8417dfb..266b2218c8d 100644
--- a/gas/testsuite/gas/mips/mipsel16-e.d
+++ b/gas/testsuite/gas/mips/mipsel16-e.d
@@ -1,6 +1,6 @@
 #objdump: -rst --special-syms -mips16
 #name: MIPS16 reloc
-#as: -32 -mips16
+#as: -32 -mips1 -mips16
 #source: mips16-e.s
 
 # Check MIPS16 reloc processing
diff --git a/gas/testsuite/gas/mips/mipsel16-f.d b/gas/testsuite/gas/mips/mipsel16-f.d
index 57db1a7955b..dbce3b03e74 100644
--- a/gas/testsuite/gas/mips/mipsel16-f.d
+++ b/gas/testsuite/gas/mips/mipsel16-f.d
@@ -1,6 +1,6 @@
 #objdump: -rst -mips16
 #name: MIPS16 reloc 2
-#as: -32 -mips16
+#as: -32 -mips1 -mips16
 #source: mips16-f.s
 
 # Check MIPS16 reloc processing
diff --git a/gas/testsuite/gas/mips/module-mfp32.d b/gas/testsuite/gas/mips/module-mfp32.d
index 28b47f63517..7cc38c5ca1c 100644
--- a/gas/testsuite/gas/mips/module-mfp32.d
+++ b/gas/testsuite/gas/mips/module-mfp32.d
@@ -1,4 +1,4 @@
-#as: -32
+#as: -32 -mips1
 #readelf: -A
 #name: MIPS module fp=32
 
diff --git a/gas/testsuite/gas/mips/module-mfp64r6-noodd.d b/gas/testsuite/gas/mips/module-mfp64r6-noodd.d
new file mode 100644
index 00000000000..a97e94daf06
--- /dev/null
+++ b/gas/testsuite/gas/mips/module-mfp64r6-noodd.d
@@ -0,0 +1,21 @@
+#as: -mips32r6 -32
+#readelf: -A
+#name: MIPS module fp=64 nooddspreg
+#source: module-mfp64-noodd.s
+
+Attribute Section: gnu
+File Attributes
+  Tag_GNU_MIPS_ABI_FP: Hard float compat \(32-bit CPU, 64-bit FPU\)
+
+MIPS ABI Flags Version: 0
+
+ISA: MIPS32r6
+GPR size: 32
+CPR1 size: 64
+CPR2 size: 0
+FP ABI: Hard float compat \(32-bit CPU, 64-bit FPU\)
+ISA Extension: None
+ASEs:
+	None
+FLAGS 1: 0000000.
+FLAGS 2: 00000000
diff --git a/gas/testsuite/gas/mips/module-mfp64r6.d b/gas/testsuite/gas/mips/module-mfp64r6.d
new file mode 100644
index 00000000000..38bc1bdc2dd
--- /dev/null
+++ b/gas/testsuite/gas/mips/module-mfp64r6.d
@@ -0,0 +1,21 @@
+#as: -mips32r6 -32
+#readelf: -A
+#name: MIPS module fp=64
+#source: module-mfp64.s
+
+Attribute Section: gnu
+File Attributes
+  Tag_GNU_MIPS_ABI_FP: Hard float \(32-bit CPU, 64-bit FPU\)
+
+MIPS ABI Flags Version: 0
+
+ISA: MIPS32r6
+GPR size: 32
+CPR1 size: 64
+CPR2 size: 0
+FP ABI: Hard float \(32-bit CPU, 64-bit FPU\)
+ISA Extension: None
+ASEs:
+	None
+FLAGS 1: 0000000.
+FLAGS 2: 00000000
diff --git a/gas/testsuite/gas/mips/module-msoft-float-r6.d b/gas/testsuite/gas/mips/module-msoft-float-r6.d
new file mode 100644
index 00000000000..18ba3b2f654
--- /dev/null
+++ b/gas/testsuite/gas/mips/module-msoft-float-r6.d
@@ -0,0 +1,20 @@
+#as: -32 -march=mips32r6
+#readelf: -A
+#name: MIPS module softfloat
+
+Attribute Section: gnu
+File Attributes
+  Tag_GNU_MIPS_ABI_FP: Soft float
+
+MIPS ABI Flags Version: 0
+
+ISA: MIPS.*
+GPR size: 32
+CPR1 size: 0
+CPR2 size: 0
+FP ABI: Soft float
+ISA Extension: .*
+ASEs:
+	None
+FLAGS 1: 0000000.
+FLAGS 2: 00000000
diff --git a/gas/testsuite/gas/mips/module-msoft-float-r6.s b/gas/testsuite/gas/mips/module-msoft-float-r6.s
new file mode 100644
index 00000000000..12aea5907c5
--- /dev/null
+++ b/gas/testsuite/gas/mips/module-msoft-float-r6.s
@@ -0,0 +1,3 @@
+.module fp=64
+.module doublefloat
+.module softfloat
diff --git a/gas/testsuite/gas/mips/module-msoft-float.d b/gas/testsuite/gas/mips/module-msoft-float.d
index e081e519dc3..bf2e2ebbb5e 100644
--- a/gas/testsuite/gas/mips/module-msoft-float.d
+++ b/gas/testsuite/gas/mips/module-msoft-float.d
@@ -1,4 +1,4 @@
-#as: -32
+#as: -32 -mips1
 #readelf: -A
 #name: MIPS module softfloat
 
diff --git a/gas/testsuite/gas/mips/nan-2008-3.d b/gas/testsuite/gas/mips/nan-2008-3.d
index 8f179fb4aed..50075678292 100644
--- a/gas/testsuite/gas/mips/nan-2008-3.d
+++ b/gas/testsuite/gas/mips/nan-2008-3.d
@@ -1,6 +1,7 @@
 #name: MIPS 2008 NaN setting 3
 #source: nan-2008-override.s
 #objdump: -p
+#as: -march=from-abi
 
 .*:.*file format.*mips.*
 private flags = [0-9a-f]*[4-7c-f]..: .*[[,]nan2008[],].*
diff --git a/gas/testsuite/gas/mips/nan-legacy-1.d b/gas/testsuite/gas/mips/nan-legacy-1.d
index c13d634b486..5534f04c837 100644
--- a/gas/testsuite/gas/mips/nan-legacy-1.d
+++ b/gas/testsuite/gas/mips/nan-legacy-1.d
@@ -1,6 +1,7 @@
 #name: MIPS legacy NaN setting 1
 #source: nan-legacy.s
 #objdump: -p
+#as: -march=from-abi
 
 .*:.*file format.*mips.*
 #failif
diff --git a/gas/testsuite/gas/mips/nan-legacy-2.d b/gas/testsuite/gas/mips/nan-legacy-2.d
index 4a4af6155cc..d541fffa406 100644
--- a/gas/testsuite/gas/mips/nan-legacy-2.d
+++ b/gas/testsuite/gas/mips/nan-legacy-2.d
@@ -1,7 +1,7 @@
 #name: MIPS legacy NaN setting 2
 #source: nan-legacy.s
 #objdump: -p
-#as: -mnan=2008
+#as: -mnan=2008 -march=from-abi
 
 .*:.*file format.*mips.*
 #failif
diff --git a/gas/testsuite/gas/mips/nan-legacy-3.d b/gas/testsuite/gas/mips/nan-legacy-3.d
index c463f2b2d38..167945ae23f 100644
--- a/gas/testsuite/gas/mips/nan-legacy-3.d
+++ b/gas/testsuite/gas/mips/nan-legacy-3.d
@@ -1,6 +1,7 @@
 #name: MIPS legacy NaN setting 3
 #source: nan-legacy-override.s
 #objdump: -p
+#as: -march=from-abi
 
 .*:.*file format.*mips.*
 #failif
diff --git a/gas/testsuite/gas/mips/nan-legacy-4.d b/gas/testsuite/gas/mips/nan-legacy-4.d
index 99c5de750c6..b0d6b06d810 100644
--- a/gas/testsuite/gas/mips/nan-legacy-4.d
+++ b/gas/testsuite/gas/mips/nan-legacy-4.d
@@ -1,7 +1,7 @@
 #name: MIPS legacy NaN setting 4
 #source: empty.s
 #objdump: -p
-#as: -mnan=legacy
+#as: -mnan=legacy -march=from-abi
 
 .*:.*file format.*mips.*
 #failif
diff --git a/gas/testsuite/gas/mips/nan-legacy-5.d b/gas/testsuite/gas/mips/nan-legacy-5.d
index b0ccb31ff58..12481543327 100644
--- a/gas/testsuite/gas/mips/nan-legacy-5.d
+++ b/gas/testsuite/gas/mips/nan-legacy-5.d
@@ -1,6 +1,7 @@
 #name: MIPS legacy NaN setting 5
 #source: empty.s
 #objdump: -p
+#as: -march=from-abi
 
 .*:.*file format.*mips.*
 #failif
diff --git a/gas/testsuite/gas/mips/option-pic-1.d b/gas/testsuite/gas/mips/option-pic-1.d
index da32af6a6ce..612414ae752 100644
--- a/gas/testsuite/gas/mips/option-pic-1.d
+++ b/gas/testsuite/gas/mips/option-pic-1.d
@@ -13,6 +13,6 @@ Disassembly of section \.text:
 [ 	]*[0-9a-f]+: R_MIPS_LO16	bar
 [0-9a-f]+ <[^>]*> 8f820000 	lw	v0,0\(gp\)
 [ 	]*[0-9a-f]+: R_MIPS_GOT16	bar
-[0-9a-f]+ <[^>]*> 03e00008 	jr	ra
+[0-9a-f]+ <[^>]*> 03e0000[89] 	jr	ra
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
diff --git a/gas/testsuite/gas/mips/option-pic-relax-0.d b/gas/testsuite/gas/mips/option-pic-relax-0.d
index 141cc5dc8ee..5e14b289c2d 100644
--- a/gas/testsuite/gas/mips/option-pic-relax-0.d
+++ b/gas/testsuite/gas/mips/option-pic-relax-0.d
@@ -16,6 +16,6 @@ Disassembly of section \.text:
 [0-9a-f]+ <[^>]*> 0399e021 	addu	gp,gp,t9
 [0-9a-f]+ <[^>]*> 8f820000 	lw	v0,0\(gp\)
 [ 	]*[0-9a-f]+: R_MIPS_GOT16	bar
-[0-9a-f]+ <[^>]*> 03e00008 	jr	ra
+[0-9a-f]+ <[^>]*> 03e0000[89] 	jr	ra
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
diff --git a/gas/testsuite/gas/mips/option-pic-relax-1.d b/gas/testsuite/gas/mips/option-pic-relax-1.d
index dd68fc8c96b..717a0990e2a 100644
--- a/gas/testsuite/gas/mips/option-pic-relax-1.d
+++ b/gas/testsuite/gas/mips/option-pic-relax-1.d
@@ -13,6 +13,6 @@ Disassembly of section \.text:
 [ 	]*[0-9a-f]+: R_MIPS_HI16	bar
 [0-9a-f]+ <[^>]*> 24420000 	addiu	v0,v0,0
 [ 	]*[0-9a-f]+: R_MIPS_LO16	bar
-[0-9a-f]+ <[^>]*> 03e00008 	jr	ra
+[0-9a-f]+ <[^>]*> 03e0000[89] 	jr	ra
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
diff --git a/gas/testsuite/gas/mips/option-pic-relax-3.d b/gas/testsuite/gas/mips/option-pic-relax-3.d
index 30f9c5fae4a..f917ab0d6c5 100644
--- a/gas/testsuite/gas/mips/option-pic-relax-3.d
+++ b/gas/testsuite/gas/mips/option-pic-relax-3.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS `.option picX' with relaxation 3
-#as: -32 --relax-branch
+#as: -32 -mips1 --relax-branch
 #warning_output: option-pic-relax-3.l
 
 # Verify that relaxation is done according to the `.option picX' setting
@@ -15,6 +15,6 @@ Disassembly of section \.text:
 [ 	]*[0-9a-f]+: R_MIPS_26	\.text
 [0-9a-f]+ <[^>]*> 00a01825 	move	v1,a1
 	\.\.\.
-[0-9a-f]+ <[^>]*> 03e00008 	jr	ra
+[0-9a-f]+ <[^>]*> 03e0000[89] 	jr	ra
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
diff --git a/gas/testsuite/gas/mips/option-pic-relax-3a.d b/gas/testsuite/gas/mips/option-pic-relax-3a.d
index d6d4088d791..3c557d37a9d 100644
--- a/gas/testsuite/gas/mips/option-pic-relax-3a.d
+++ b/gas/testsuite/gas/mips/option-pic-relax-3a.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS `.option picX' with relaxation 3a
-#as: -32
+#as: -32 -mips1
 #source: option-pic-relax-3.s
 #dump: option-pic-relax-3.d
 
diff --git a/gas/testsuite/gas/mips/option-pic-relax-4.d b/gas/testsuite/gas/mips/option-pic-relax-4.d
index 15adf1155c2..a891b2b45ac 100644
--- a/gas/testsuite/gas/mips/option-pic-relax-4.d
+++ b/gas/testsuite/gas/mips/option-pic-relax-4.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS `.option picX' with relaxation 4
-#as: -32 -mmicromips --relax-branch
+#as: -32 -mips32r2 -mmicromips --relax-branch
 #warning_output: option-pic-relax-4.l
 
 # Verify that relaxation is done according to the `.option picX' setting
diff --git a/gas/testsuite/gas/mips/option-pic-relax-5.d b/gas/testsuite/gas/mips/option-pic-relax-5.d
index 948f3299abc..827c303a02c 100644
--- a/gas/testsuite/gas/mips/option-pic-relax-5.d
+++ b/gas/testsuite/gas/mips/option-pic-relax-5.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS `.option picX' with relaxation 5
-#as: -32 -mmicromips --relax-branch
+#as: -32 -mips32r2 -mmicromips --relax-branch
 #warning_output: option-pic-relax-5.l
 
 # Verify that relaxation is done according to the `.option picX' setting
diff --git a/gas/testsuite/gas/mips/org-1.d b/gas/testsuite/gas/mips/org-1.d
index b21951f8c1c..da1fad094ef 100644
--- a/gas/testsuite/gas/mips/org-1.d
+++ b/gas/testsuite/gas/mips/org-1.d
@@ -1,5 +1,5 @@
 #nm: -g --defined-only
-#as: --relax-branch
+#as: --relax-branch -march=from-abi
 #name: MIPS .org test 1
 #warning_output: org-1.l
 
diff --git a/gas/testsuite/gas/mips/org-10.d b/gas/testsuite/gas/mips/org-10.d
index 0670988eadb..1ec11e37242 100644
--- a/gas/testsuite/gas/mips/org-10.d
+++ b/gas/testsuite/gas/mips/org-10.d
@@ -1,5 +1,5 @@
 #nm: -g --defined-only
-#as: --relax-branch
+#as: --relax-branch -march=from-abi
 #name: MIPS .org test 10
 #warning_output: org-10.l
 
diff --git a/gas/testsuite/gas/mips/org-11.d b/gas/testsuite/gas/mips/org-11.d
index b464230cd77..47c6e96c02b 100644
--- a/gas/testsuite/gas/mips/org-11.d
+++ b/gas/testsuite/gas/mips/org-11.d
@@ -1,5 +1,5 @@
 #nm: -g --defined-only
-#as: -32
+#as: -32 -mips1
 #name: MIPS .org test 11
 
 0+001000 . bar
diff --git a/gas/testsuite/gas/mips/org-12.d b/gas/testsuite/gas/mips/org-12.d
index 323c3010456..d634baa7afe 100644
--- a/gas/testsuite/gas/mips/org-12.d
+++ b/gas/testsuite/gas/mips/org-12.d
@@ -1,5 +1,6 @@
 #nm: -g --defined-only
 #name: MIPS .org test 12
+#as: -march=from-abi
 
 0+001000 . bar
 0+000000 . foo
diff --git a/gas/testsuite/gas/mips/org-2.d b/gas/testsuite/gas/mips/org-2.d
index abdd5638a0d..b5c7c9b499d 100644
--- a/gas/testsuite/gas/mips/org-2.d
+++ b/gas/testsuite/gas/mips/org-2.d
@@ -1,5 +1,5 @@
 #nm: -g --defined-only
-#as: -32
+#as: -32 -mips1
 #name: MIPS .org test 2
 
 0+001000 . bar
diff --git a/gas/testsuite/gas/mips/org-3.d b/gas/testsuite/gas/mips/org-3.d
index 04d520874db..31fa39d7a24 100644
--- a/gas/testsuite/gas/mips/org-3.d
+++ b/gas/testsuite/gas/mips/org-3.d
@@ -1,5 +1,6 @@
 #nm: -g --defined-only
 #name: MIPS .org test 3
+#as: -march=from-abi
 
 0+001000 . bar
 0+000000 . foo
diff --git a/gas/testsuite/gas/mips/org-4.d b/gas/testsuite/gas/mips/org-4.d
index a1603ebb81c..cd038cc5307 100644
--- a/gas/testsuite/gas/mips/org-4.d
+++ b/gas/testsuite/gas/mips/org-4.d
@@ -1,3 +1,3 @@
-#as: --relax-branch
+#as: --relax-branch -march=from-abi
 #name: MIPS .org test 4
 #error_output: org-4.l
diff --git a/gas/testsuite/gas/mips/org-5.d b/gas/testsuite/gas/mips/org-5.d
index b63fcca0979..5638496db34 100644
--- a/gas/testsuite/gas/mips/org-5.d
+++ b/gas/testsuite/gas/mips/org-5.d
@@ -1,3 +1,3 @@
-#as: -32
+#as: -32 -mips1
 #name: MIPS .org test 5
 #error_output: org-5.l
diff --git a/gas/testsuite/gas/mips/org-6.d b/gas/testsuite/gas/mips/org-6.d
index 887cb326665..bbf0f5006be 100644
--- a/gas/testsuite/gas/mips/org-6.d
+++ b/gas/testsuite/gas/mips/org-6.d
@@ -1,2 +1,3 @@
 #name: MIPS .org test 6
 #error_output: org-6.l
+#as: -march=from-abi
diff --git a/gas/testsuite/gas/mips/org-7.d b/gas/testsuite/gas/mips/org-7.d
index 71f545db14e..228f2c9fab9 100644
--- a/gas/testsuite/gas/mips/org-7.d
+++ b/gas/testsuite/gas/mips/org-7.d
@@ -1,5 +1,5 @@
 #nm: -g --defined-only
-#as: --relax-branch
+#as: --relax-branch -march=from-abi
 #name: MIPS .org test 7
 
 0+010000 . bar
diff --git a/gas/testsuite/gas/mips/org-8.d b/gas/testsuite/gas/mips/org-8.d
index 0d1acf934e0..d44f5475a50 100644
--- a/gas/testsuite/gas/mips/org-8.d
+++ b/gas/testsuite/gas/mips/org-8.d
@@ -1,5 +1,5 @@
 #nm: -g --defined-only
-#as: -32
+#as: -32 -mips1
 #name: MIPS .org test 8
 
 0+000100 . bar
diff --git a/gas/testsuite/gas/mips/org-9.d b/gas/testsuite/gas/mips/org-9.d
index fe9e3f313c3..e2bcb98ecd9 100644
--- a/gas/testsuite/gas/mips/org-9.d
+++ b/gas/testsuite/gas/mips/org-9.d
@@ -1,5 +1,6 @@
 #nm: -g --defined-only
 #name: MIPS .org test 9
+#as: -march=from-abi
 
 0+000080 . bar
 0+000000 . foo
diff --git a/gas/testsuite/gas/mips/pcrel-reloc-1.d b/gas/testsuite/gas/mips/pcrel-reloc-1.d
index 4d4d21f4d4f..1851e7478f7 100644
--- a/gas/testsuite/gas/mips/pcrel-reloc-1.d
+++ b/gas/testsuite/gas/mips/pcrel-reloc-1.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS local PC-relative relocations 1
-#as: -32
+#as: -32 -mips1
 #source: pcrel-reloc-1.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/pcrel-reloc-2.d b/gas/testsuite/gas/mips/pcrel-reloc-2.d
index 25f7f7bc0d8..d4d55d1ea3d 100644
--- a/gas/testsuite/gas/mips/pcrel-reloc-2.d
+++ b/gas/testsuite/gas/mips/pcrel-reloc-2.d
@@ -1,5 +1,5 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS local PC-relative relocations 2
-#as: -32 --defsym setmips3=1
+#as: -32 -mips1 --defsym setmips3=1
 #source: pcrel-reloc-1.s
 #dump: pcrel-reloc-1.d
diff --git a/gas/testsuite/gas/mips/pcrel-reloc-3.d b/gas/testsuite/gas/mips/pcrel-reloc-3.d
index cb587b9b201..399ce104078 100644
--- a/gas/testsuite/gas/mips/pcrel-reloc-3.d
+++ b/gas/testsuite/gas/mips/pcrel-reloc-3.d
@@ -1,5 +1,5 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS local PC-relative relocations 3
-#as: -32 --defsym setmips64r6=1
+#as: -32 -mips1 --defsym setmips64r6=1
 #source: pcrel-reloc-1.s
 #dump: pcrel-reloc-1.d
diff --git a/gas/testsuite/gas/mips/pcrel-reloc-4.d b/gas/testsuite/gas/mips/pcrel-reloc-4.d
index faeb6a5f3de..2322524fd77 100644
--- a/gas/testsuite/gas/mips/pcrel-reloc-4.d
+++ b/gas/testsuite/gas/mips/pcrel-reloc-4.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn -mmips:isa64r6
 #name: MIPS local PC-relative relocations 4
-#as: -32
+#as: -32 -mips1
 #source: pcrel-reloc-4.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/pcrel-reloc-5.d b/gas/testsuite/gas/mips/pcrel-reloc-5.d
index 227b3fc45ba..6b52c573c38 100644
--- a/gas/testsuite/gas/mips/pcrel-reloc-5.d
+++ b/gas/testsuite/gas/mips/pcrel-reloc-5.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn -mmips:isa64r6
 #name: MIPS local PC-relative relocations 5
-#as: -32 --defsym reverse=1
+#as: -32 -mips1 --defsym reverse=1
 #source: pcrel-reloc-4.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/pcrel-reloc-6.d b/gas/testsuite/gas/mips/pcrel-reloc-6.d
index 03e65f62fb9..01e5bd734f7 100644
--- a/gas/testsuite/gas/mips/pcrel-reloc-6.d
+++ b/gas/testsuite/gas/mips/pcrel-reloc-6.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn -mmips:isa64r6
 #name: MIPS local PC-relative relocations 6a
-#as: -32 --defsym offset=0
+#as: -32 -mips1 --defsym offset=0
 #source: pcrel-reloc-6.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/set-arch.d b/gas/testsuite/gas/mips/set-arch.d
index d1799dc793d..49f6c19aad5 100644
--- a/gas/testsuite/gas/mips/set-arch.d
+++ b/gas/testsuite/gas/mips/set-arch.d
@@ -1,6 +1,10 @@
 #objdump: -dr --prefix-addresses --show-raw-insn -mmips:sb1 -M gpr-names=32
 #name: .set arch=FOO
 #warning_output: set-arch.l
+#as: -march=from-abi
+
+#FIXME: -march=mips32r6 will break this test: which is a problem
+#FIXME: We should find the real problem, and drop -march=from-abi
 
 .*:     file format .*
 
diff --git a/gas/testsuite/gas/mips/tmips16-e.d b/gas/testsuite/gas/mips/tmips16-e.d
index bcf3de0cab2..75ed1b15f7b 100644
--- a/gas/testsuite/gas/mips/tmips16-e.d
+++ b/gas/testsuite/gas/mips/tmips16-e.d
@@ -1,6 +1,6 @@
 #objdump: -rst --special-syms -mips16
 #name: MIPS16 reloc
-#as: -32 -mips16
+#as: -32 -mips1 -mips16
 #source: mips16-e.s
 
 # Check MIPS16 reloc processing
diff --git a/gas/testsuite/gas/mips/tmips16-f.d b/gas/testsuite/gas/mips/tmips16-f.d
index 95bb5647a09..7cec0b96ac7 100644
--- a/gas/testsuite/gas/mips/tmips16-f.d
+++ b/gas/testsuite/gas/mips/tmips16-f.d
@@ -1,6 +1,6 @@
 #objdump: -rst -mips16
 #name: MIPS16 reloc 2
-#as: -32 -mips16
+#as: -32 -mips1 -mips16
 #source: mips16-f.s
 
 # Check MIPS16 reloc processing
diff --git a/gas/testsuite/gas/mips/tmipsel16-e.d b/gas/testsuite/gas/mips/tmipsel16-e.d
index 95d473c054c..161ee2fa586 100644
--- a/gas/testsuite/gas/mips/tmipsel16-e.d
+++ b/gas/testsuite/gas/mips/tmipsel16-e.d
@@ -1,6 +1,6 @@
 #objdump: -rst --special-syms -mips16
 #name: MIPS16 reloc
-#as: -32 -mips16
+#as: -32 -mips1 -mips16
 #source: mips16-e.s
 
 # Check MIPS16 reloc processing
diff --git a/gas/testsuite/gas/mips/tmipsel16-f.d b/gas/testsuite/gas/mips/tmipsel16-f.d
index 5639bb0b16d..ced710bc08c 100644
--- a/gas/testsuite/gas/mips/tmipsel16-f.d
+++ b/gas/testsuite/gas/mips/tmipsel16-f.d
@@ -1,6 +1,6 @@
 #objdump: -rst -mips16
 #name: MIPS16 reloc 2
-#as: -32 -mips16
+#as: -32 -mips1 -mips16
 #source: mips16-f.s
 
 # Check MIPS16 reloc processing
diff --git a/gas/testsuite/gas/mips/unaligned-branch-r6-1.s b/gas/testsuite/gas/mips/unaligned-branch-r6-1.s
index 1e5960cbe09..b5995e877ed 100644
--- a/gas/testsuite/gas/mips/unaligned-branch-r6-1.s
+++ b/gas/testsuite/gas/mips/unaligned-branch-r6-1.s
@@ -134,6 +134,7 @@ bar\@ :
 	.endm
 
 	.align	4
+	.set	mips32r2
 	.set	micromips
 	obj	16
 	fun	8
diff --git a/gas/testsuite/gas/mips/unaligned-branch-r6-3.s b/gas/testsuite/gas/mips/unaligned-branch-r6-3.s
index beb59128d03..354e5bce7ad 100644
--- a/gas/testsuite/gas/mips/unaligned-branch-r6-3.s
+++ b/gas/testsuite/gas/mips/unaligned-branch-r6-3.s
@@ -136,6 +136,7 @@ bar\@ :
 	.endm
 
 	.align	4
+	.set	mips32r2
 	.set	micromips
 	obj	16
 	fun	8
diff --git a/gas/testsuite/gas/mips/unaligned-branch-r6-5.d b/gas/testsuite/gas/mips/unaligned-branch-r6-5.d
index eed864a46a2..b5b7e2bb4f8 100644
--- a/gas/testsuite/gas/mips/unaligned-branch-r6-5.d
+++ b/gas/testsuite/gas/mips/unaligned-branch-r6-5.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn -m mips:isa64r6
 #name: MIPSr6 branch to unaligned symbol 5
-#as: -n32 -march=from-abi
+#as: -n32 -march=mips64r6
 #source: unaligned-branch-r6-3.s
 
 .*: +file format .*mips.*
diff --git a/gas/testsuite/gas/mips/unaligned-jump-mips16-3.d b/gas/testsuite/gas/mips/unaligned-jump-mips16-3.d
index a3427a8ba28..f9ca353b11b 100644
--- a/gas/testsuite/gas/mips/unaligned-jump-mips16-3.d
+++ b/gas/testsuite/gas/mips/unaligned-jump-mips16-3.d
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS16 jump to unaligned symbol 3
-#as: -n32 -march=from-abi
+#as: -n32 -march=from-abi --defsym n32=1
 #source: unaligned-jump-mips16-2.s
 
 .*: +file format .*mips.*
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d
index 24d051d5c42..71bce95ea53 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d
@@ -1,5 +1,6 @@
 #source: attr-gnu-4-0.s
 #source: attr-gnu-4-1.s
+#as: -march=from-abi
 #ld: -r
 #readelf: -A
 
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d
index ce94a818eb6..12268fb6f5c 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d
@@ -1,5 +1,6 @@
 #source: attr-gnu-4-1.s
 #source: attr-gnu-4-1.s
+#as: -march=from-abi
 #ld: -r
 #readelf: -A
 
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-40.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-40.d
index 6aa22b9901c..67f2bdf0db9 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-40.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-40.d
@@ -1,5 +1,6 @@
 #source: attr-gnu-4-4.s -W
 #source: attr-gnu-4-0.s
+#as: -march=from-abi
 #ld: -r
 #error: \A[^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n
 #error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d
index 49f2137e0e2..029d0ed3784 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d
@@ -1,5 +1,6 @@
 #source: attr-gnu-4-4.s -W
 #source: attr-gnu-4-1.s
+#as: -march=from-abi
 #ld: -r
 #error: \A[^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n
 #error:   [^\n]*: warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses -mdouble-float\n
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-00.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-00.d
index 2f8e5f09253..a8a2aaa2420 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-00.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-00.d
@@ -1,5 +1,6 @@
 #source: attr-gnu-8-0.s
 #source: attr-gnu-8-0.s
+#as: -march=from-abi
 #ld: -r
 #readelf: -A
 
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-01.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-01.d
index e2cda3341e7..82006ff4b76 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-01.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-01.d
@@ -1,5 +1,6 @@
 #source: attr-gnu-8-0.s
 #source: attr-gnu-8-1.s
+#as: -march=from-abi
 #ld: -r
 #readelf: -A
 
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-02.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-02.d
index 54b196fa38b..9f08a438bb2 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-02.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-02.d
@@ -1,5 +1,6 @@
 #source: attr-gnu-8-0.s
 #source: attr-gnu-8-2.s
+#as: -march=from-abi
 #ld: -r
 #readelf: -A
 
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-10.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-10.d
index f7c512beeb4..97962829120 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-10.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-10.d
@@ -1,5 +1,6 @@
 #source: attr-gnu-8-1.s
 #source: attr-gnu-8-0.s
+#as: -march=from-abi
 #ld: -r
 #readelf: -A
 
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-11.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-11.d
index be87af4bd18..8d3cf40c834 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-11.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-11.d
@@ -1,5 +1,6 @@
 #source: attr-gnu-8-1.s
 #source: attr-gnu-8-1.s
+#as: -march=from-abi
 #ld: -r
 #readelf: -A
 
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-20.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-20.d
index 05f4da064a9..02abcc7583a 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-20.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-20.d
@@ -1,5 +1,6 @@
 #source: attr-gnu-8-2.s
 #source: attr-gnu-8-0.s
+#as: -march=from-abi
 #ld: -r
 #readelf: -A
 
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-22.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-22.d
index 908ce4f00a2..164bc25b326 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-22.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-22.d
@@ -1,5 +1,6 @@
 #source: attr-gnu-8-2.s
 #source: attr-gnu-8-2.s
+#as: -march=from-abi
 #ld: -r
 #readelf: -A
 
diff --git a/ld/testsuite/ld-mips-elf/emit-relocs-1.d b/ld/testsuite/ld-mips-elf/emit-relocs-1.d
index 0de07297323..32e15a2541e 100644
--- a/ld/testsuite/ld-mips-elf/emit-relocs-1.d
+++ b/ld/testsuite/ld-mips-elf/emit-relocs-1.d
@@ -23,7 +23,7 @@ OFFSET +TYPE +VALUE
 
 
 Contents of section \.text:
- 80000 03e00008 00000000 00000000 00000000  .*
+ 80000 03e0000[89] 00000000 00000000 00000000  .*
 Contents of section \.merge1:
  80400 666c7574 74657200                    flutter.*
 Contents of section \.merge2:
diff --git a/ld/testsuite/ld-mips-elf/gp-disp-sym.s b/ld/testsuite/ld-mips-elf/gp-disp-sym.s
index c6380ba1fb0..3b06e717f5f 100644
--- a/ld/testsuite/ld-mips-elf/gp-disp-sym.s
+++ b/ld/testsuite/ld-mips-elf/gp-disp-sym.s
@@ -2,4 +2,4 @@
   .text
 foo:
   lui    $t0, %hi(_gp_disp)
-  addi   $t0, $t0, %lo(_gp_disp)
+  addiu   $t0, $t0, %lo(_gp_disp)
diff --git a/ld/testsuite/ld-mips-elf/jalr3.dd b/ld/testsuite/ld-mips-elf/jalr3.dd
index 6b6d4841208..5c9d83fdfd4 100644
--- a/ld/testsuite/ld-mips-elf/jalr3.dd
+++ b/ld/testsuite/ld-mips-elf/jalr3.dd
@@ -9,6 +9,6 @@ Disassembly of section \.text:
    c:	00000000 	nop
 
 0+000010 <\$bar>:
-  10:	03e00008 	jr	ra
+  10:	03e0000[89] 	jr	ra
   14:	00000000 	nop
 	\.\.\.
diff --git a/ld/testsuite/ld-mips-elf/jalx-1.d b/ld/testsuite/ld-mips-elf/jalx-1.d
index f0826288ecb..80c3be229a4 100644
--- a/ld/testsuite/ld-mips-elf/jalx-1.d
+++ b/ld/testsuite/ld-mips-elf/jalx-1.d
@@ -1,5 +1,5 @@
 #name: MIPS jalx-1
-#source: jalx-1.s
+#source: jalx-1.s -march=from-abi
 #ld: -T jalx-1.ld
 #objdump: -d
 
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index 920bb121a67..ff9635ec9d1 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -72,7 +72,8 @@ proc run_dump_test_abi { abi name args } {
 	set asflags [regsub -- {-march=[^[:blank:]]*} $asflags {}]
 	set args [lreplace $args 0 0]
     }
-    if !$has_abi($abi) {
+    set abi_r [regsub "l$" $abi {}]
+    if !$has_abi($abi_r) {
 	lappend args {notarget *-*-*}
     }
     if { [llength $args] > 0 } {
@@ -91,6 +92,13 @@ proc run_dump_test_abi { abi name args } {
 proc run_dump_test_o32 { name args } {
     run_dump_test_abi o32 $name [lindex $args 0]
 }
+proc run_dump_test_o32l { name args } {
+    if {[istarget *-linux*] || [istarget *-img-elf]} {
+      run_dump_test_abi o32l $name [lindex $args 0]
+    } else {
+      run_dump_test_abi o32 $name [lindex $args 0]
+    }
+}
 
 # run_dump_test_n32 NAME ARGS
 #
@@ -99,6 +107,13 @@ proc run_dump_test_o32 { name args } {
 proc run_dump_test_n32 { name args } {
     run_dump_test_abi n32 $name [lindex $args 0]
 }
+proc run_dump_test_n32l { name args } {
+    if {[istarget *-linux*] || [istarget *-img-elf]} {
+      run_dump_test_abi n32l $name [lindex $args 0]
+    } else {
+      run_dump_test_abi n32 $name [lindex $args 0]
+    }
+}
 
 # run_dump_test_n64 NAME ARGS
 #
@@ -107,6 +122,13 @@ proc run_dump_test_n32 { name args } {
 proc run_dump_test_n64 { name args } {
     run_dump_test_abi n64 $name [lindex $args 0]
 }
+proc run_dump_test_n64l { name args } {
+    if {[istarget *-linux*] || [istarget *-img-elf]} {
+      run_dump_test_abi n64l $name [lindex $args 0]
+    } else {
+      run_dump_test_abi n64 $name [lindex $args 0]
+    }
+}
 
 # run_dump_test_eabi NAME ARGS
 #
@@ -139,49 +161,69 @@ set linux_gnu [expr [istarget mips*-*-linux*]]
 set embedded_elf [expr [istarget mips*-*-elf]]
 
 # Set defaults.
+# ABI with l tail means legacy, aka pre-R6.
+# Please use them, if the test only suite for pre-R6,
+# such as mips16/micromips tests.
 set abi_asflags(o32) ""
+set abi_asflags(o32l) ""
 set abi_asflags(n32) ""
+set abi_asflags(n32l) ""
 set abi_asflags(n64) ""
+set abi_asflags(n64l) ""
 set abi_asflags(eabi) ""
 set abi_ldflags(o32) ""
+set abi_ldflags(o32l) ""
 set abi_ldflags(n32) ""
+set abi_ldflags(n32l) ""
 set abi_ldflags(n64) ""
+set abi_ldflags(n64l) ""
 set abi_ldflags(eabi) ""
 
 # Override as needed.
 if {[istarget *-*-openbsd*] } {
     set irixemul 0
-} elseif { [istarget mips64*-*-linux*] } {
+} elseif { [istarget mips*64*-*-linux*] } {
+    set abi_asflags(o32) -32
+    set abi_asflags(o32l) "-32 -march=from-abi"
+    set abi_asflags(n32) ""
+    set abi_asflags(n32l) "-n32 -march=from-abi"
+    set abi_asflags(n64) "-64"
+    set abi_asflags(n64l) "-march=from-abi -64"
     if [istarget *el-*-*] {
-	set abi_asflags(o32) -32
 	set abi_ldflags(o32) -melf32ltsmip
-	set abi_asflags(n64) "-march=from-abi -64"
+	set abi_ldflags(o32l) -melf32ltsmip
 	set abi_ldflags(n64) -melf64ltsmip
+	set abi_ldflags(n64l) -melf64ltsmip
     } else {
-	set abi_asflags(o32) -32
 	set abi_ldflags(o32) -melf32btsmip
-	set abi_asflags(n64) "-march=from-abi -64"
+	set abi_ldflags(o32l) -melf32btsmip
 	set abi_ldflags(n64) -melf64btsmip
+	set abi_ldflags(n64l) -melf64btsmip
     }
     set irixemul 0
-} elseif {[istarget *-*-linux*] } {
+} elseif {[istarget *-*-linux*] || [istarget *-img-elf] } {
+    set abi_asflags(o32) ""
+    set abi_asflags(o32l) "-march=from-abi"
+    set abi_asflags(n32) "-n32"
+    set abi_asflags(n32l) "-n32 -march=from-abi"
+    set abi_asflags(n64) "-64"
+    set abi_asflags(n64l) "-64 -march=from-abi"
     if [istarget *el-*-*] {
-	set abi_asflags(n32) "-march=from-abi -n32"
 	set abi_ldflags(n32) -melf32ltsmipn32
-	set abi_asflags(n64) "-march=from-abi -64"
+	set abi_ldflags(n32l) -melf32ltsmipn32
 	set abi_ldflags(n64) -melf64ltsmip
+	set abi_ldflags(n64l) -melf64ltsmip
     } else {
-	set abi_asflags(n32) "-march=from-abi -n32"
 	set abi_ldflags(n32) -melf32btsmipn32
-	set abi_asflags(n64) "-march=from-abi -64"
+	set abi_ldflags(n32l) -melf32btsmipn32
 	set abi_ldflags(n64) -melf64btsmip
+	set abi_ldflags(n64l) -melf64btsmip
     }
     set irixemul 0
 } elseif {[istarget *-img-elf*] \
      || [istarget *-mti-elf*] \
      || [istarget *-sde-elf*] \
      || [istarget *-*-netbsd*] \
-     || [istarget *-*-linux*] \
      || [istarget *-*-sysv4*] } {
     if [istarget *el-*-*] {
 	set abi_asflags(o32) -32
@@ -305,56 +347,56 @@ run_dump_test "mips16-1"
 # MIPS branch offset final link checking.
 run_dump_test "branch-misc-1"
 run_dump_test "branch-misc-2"
-run_dump_test_o32 "branch-absolute"
-run_dump_test_o32 "branch-absolute-addend"
-run_dump_test_n32 "branch-absolute-n32"
-run_dump_test_n32 "branch-absolute-addend-n32"
-run_dump_test_n64 "branch-absolute-n64"
-run_dump_test_n64 "branch-absolute-addend-n64"
-
-run_dump_test_o32 "mips16-pcrel-0"
-run_dump_test_o32 "mips16-pcrel-1" noarch
-run_dump_test_o32 "mips16e2-pcrel-0" noarch
-run_dump_test_o32 "mips16e2-pcrel-1" noarch
-run_dump_test_o32 "mips16-pcrel-addend-2"
-run_dump_test_o32 "mips16-pcrel-addend-6"
-run_dump_test_o32 "mips16e2-pcrel-addend-2" noarch
-run_dump_test_o32 "mips16e2-pcrel-addend-6" noarch
-run_dump_test_n32 "mips16-pcrel-n32-0"
-run_dump_test_n32 "mips16-pcrel-n32-1"
-run_dump_test_n64 "mips16-pcrel-n64-sym32-0"
-run_dump_test_n64 "mips16-pcrel-n64-sym32-1"
-run_dump_test_n32 "mips16e2-pcrel-n32-0" noarch
-run_dump_test_n32 "mips16e2-pcrel-n32-1" noarch
-run_dump_test_n64 "mips16e2-pcrel-n64-sym32-0" noarch
-run_dump_test_n64 "mips16e2-pcrel-n64-sym32-1" noarch
-
-run_dump_test_o32 "mips16-branch-2"
-run_dump_test_o32 "mips16-branch-3"
-run_dump_test_o32 "mips16-branch-addend-2"
-run_dump_test_o32 "mips16-branch-addend-3"
-run_dump_test_o32 "mips16-branch-absolute"
-run_dump_test_o32 "mips16-branch-absolute-1"
-run_dump_test_o32 "mips16-branch-absolute-2"
-run_dump_test_o32 "mips16-branch-absolute-addend"
-run_dump_test_o32 "mips16-branch-absolute-addend-1"
-run_dump_test_n32 "mips16-branch-absolute-n32"
-run_dump_test_n32 "mips16-branch-absolute-n32-1"
-run_dump_test_n32 "mips16-branch-absolute-n32-2"
-run_dump_test_n32 "mips16-branch-absolute-addend-n32"
-run_dump_test_n32 "mips16-branch-absolute-addend-n32-1"
-run_dump_test_n64 "mips16-branch-absolute-n64"
-run_dump_test_n64 "mips16-branch-absolute-n64-1"
-run_dump_test_n64 "mips16-branch-absolute-n64-2"
-run_dump_test_n64 "mips16-branch-absolute-addend-n64"
-run_dump_test_n64 "mips16-branch-absolute-addend-n64-1"
-
-run_dump_test_o32 "micromips-branch-absolute"
-run_dump_test_o32 "micromips-branch-absolute-addend"
-run_dump_test_n32 "micromips-branch-absolute-n32"
-run_dump_test_n32 "micromips-branch-absolute-addend-n32"
-run_dump_test_n64 "micromips-branch-absolute-n64"
-run_dump_test_n64 "micromips-branch-absolute-addend-n64"
+run_dump_test_o32l "branch-absolute"
+run_dump_test_o32l "branch-absolute-addend"
+run_dump_test_n32l "branch-absolute-n32"
+run_dump_test_n32l "branch-absolute-addend-n32"
+run_dump_test_n64l "branch-absolute-n64"
+run_dump_test_n64l "branch-absolute-addend-n64"
+
+run_dump_test_o32l "mips16-pcrel-0"
+run_dump_test_o32l "mips16-pcrel-1" noarch
+run_dump_test_o32l "mips16e2-pcrel-0" noarch
+run_dump_test_o32l "mips16e2-pcrel-1" noarch
+run_dump_test_o32l "mips16-pcrel-addend-2"
+run_dump_test_o32l "mips16-pcrel-addend-6" noarch
+run_dump_test_o32l "mips16e2-pcrel-addend-2" noarch
+run_dump_test_o32l "mips16e2-pcrel-addend-6" noarch
+run_dump_test_n32l "mips16-pcrel-n32-0"
+run_dump_test_n32l "mips16-pcrel-n32-1"
+run_dump_test_n64l "mips16-pcrel-n64-sym32-0"
+run_dump_test_n64l "mips16-pcrel-n64-sym32-1"
+run_dump_test_n32l "mips16e2-pcrel-n32-0" noarch
+run_dump_test_n32l "mips16e2-pcrel-n32-1" noarch
+run_dump_test_n64l "mips16e2-pcrel-n64-sym32-0" noarch
+run_dump_test_n64l "mips16e2-pcrel-n64-sym32-1" noarch
+
+run_dump_test_o32l "mips16-branch-2"
+run_dump_test_o32l "mips16-branch-3"
+run_dump_test_o32l "mips16-branch-addend-2"
+run_dump_test_o32l "mips16-branch-addend-3"
+run_dump_test_o32l "mips16-branch-absolute"
+run_dump_test_o32l "mips16-branch-absolute-1"
+run_dump_test_o32l "mips16-branch-absolute-2"
+run_dump_test_o32l "mips16-branch-absolute-addend"
+run_dump_test_o32l "mips16-branch-absolute-addend-1"
+run_dump_test_n32l "mips16-branch-absolute-n32"
+run_dump_test_n32l "mips16-branch-absolute-n32-1"
+run_dump_test_n32l "mips16-branch-absolute-n32-2"
+run_dump_test_n32l "mips16-branch-absolute-addend-n32"
+run_dump_test_n32l "mips16-branch-absolute-addend-n32-1"
+run_dump_test_n64l "mips16-branch-absolute-n64"
+run_dump_test_n64l "mips16-branch-absolute-n64-1"
+run_dump_test_n64l "mips16-branch-absolute-n64-2"
+run_dump_test_n64l "mips16-branch-absolute-addend-n64"
+run_dump_test_n64l "mips16-branch-absolute-addend-n64-1"
+
+run_dump_test_o32l "micromips-branch-absolute"
+run_dump_test_o32l "micromips-branch-absolute-addend"
+run_dump_test_n32l "micromips-branch-absolute-n32"
+run_dump_test_n32l "micromips-branch-absolute-addend-n32"
+run_dump_test_n64l "micromips-branch-absolute-n64"
+run_dump_test_n64l "micromips-branch-absolute-addend-n64"
 
 # Jalx test
 run_dump_test "jalx-1"
@@ -381,69 +423,69 @@ if { $linux_gnu } {
 	      "jalx-2"]]
 }
 
-run_dump_test_o32 "jalx-addend"
-run_dump_test_o32 "jalx-local"
-run_dump_test_o32 "bal-jalx-addend"
-run_dump_test_o32 "bal-jalx-addend-micromips"
-run_dump_test_o32 "bal-jalx-local"
-run_dump_test_o32 "bal-jalx-local-micromips"
-run_dump_test_o32 "bal-jalx-pic"
-run_dump_test_o32 "bal-jalx-pic-micromips"
-run_dump_test_o32 "bal-jalx-pic-ignore"
-run_dump_test_o32 "bal-jalx-pic-ignore-micromips"
-run_dump_test_n32 "jalx-addend-n32"
-run_dump_test_n32 "jalx-local-n32"
-run_dump_test_n32 "bal-jalx-addend-n32"
-run_dump_test_n32 "bal-jalx-addend-micromips-n32"
-run_dump_test_n32 "bal-jalx-local-n32"
-run_dump_test_n32 "bal-jalx-local-micromips-n32"
-run_dump_test_n32 "bal-jalx-pic-n32"
-run_dump_test_n32 "bal-jalx-pic-micromips-n32"
-run_dump_test_n32 "bal-jalx-pic-ignore-n32"
-run_dump_test_n32 "bal-jalx-pic-ignore-micromips-n32"
-run_dump_test_n64 "jalx-addend-n64"
-run_dump_test_n64 "jalx-local-n64"
-run_dump_test_n64 "bal-jalx-addend-n64"
-run_dump_test_n64 "bal-jalx-addend-micromips-n64"
-run_dump_test_n64 "bal-jalx-local-n64"
-run_dump_test_n64 "bal-jalx-local-micromips-n64"
-run_dump_test_n64 "bal-jalx-pic-n64"
-run_dump_test_n64 "bal-jalx-pic-micromips-n64"
-run_dump_test_n64 "bal-jalx-pic-ignore-n64"
-run_dump_test_n64 "bal-jalx-pic-ignore-micromips-n64"
-
-run_dump_test "unaligned-jalx-0" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-1" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-2" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-3" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-mips16-0" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-mips16-1" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-micromips-0" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-micromips-1" [list [list ld $abi_ldflags(o32)]]
-
-run_dump_test_n32 "unaligned-jalx-addend-0"
-run_dump_test_n32 "unaligned-jalx-addend-1"
-run_dump_test_n32 "unaligned-jalx-addend-2"
-run_dump_test_n32 "unaligned-jalx-addend-3"
-run_dump_test_n32 "unaligned-jalx-addend-mips16-0"
-run_dump_test_n32 "unaligned-jalx-addend-mips16-1"
-run_dump_test_n32 "unaligned-jalx-addend-micromips-0"
-run_dump_test_n32 "unaligned-jalx-addend-micromips-1"
+run_dump_test_o32l "jalx-addend"
+run_dump_test_o32l "jalx-local"
+run_dump_test_o32l "bal-jalx-addend"
+run_dump_test_o32l "bal-jalx-addend-micromips"
+run_dump_test_o32l "bal-jalx-local"
+run_dump_test_o32l "bal-jalx-local-micromips"
+run_dump_test_o32l "bal-jalx-pic"
+run_dump_test_o32l "bal-jalx-pic-micromips"
+run_dump_test_o32l "bal-jalx-pic-ignore"
+run_dump_test_o32l "bal-jalx-pic-ignore-micromips"
+run_dump_test_n32l "jalx-addend-n32"
+run_dump_test_n32l "jalx-local-n32"
+run_dump_test_n32l "bal-jalx-addend-n32"
+run_dump_test_n32l "bal-jalx-addend-micromips-n32"
+run_dump_test_n32l "bal-jalx-local-n32"
+run_dump_test_n32l "bal-jalx-local-micromips-n32"
+run_dump_test_n32l "bal-jalx-pic-n32"
+run_dump_test_n32l "bal-jalx-pic-micromips-n32"
+run_dump_test_n32l "bal-jalx-pic-ignore-n32"
+run_dump_test_n32l "bal-jalx-pic-ignore-micromips-n32"
+run_dump_test_n64l "jalx-addend-n64"
+run_dump_test_n64l "jalx-local-n64"
+run_dump_test_n64l "bal-jalx-addend-n64"
+run_dump_test_n64l "bal-jalx-addend-micromips-n64"
+run_dump_test_n64l "bal-jalx-local-n64"
+run_dump_test_n64l "bal-jalx-local-micromips-n64"
+run_dump_test_n64l "bal-jalx-pic-n64"
+run_dump_test_n64l "bal-jalx-pic-micromips-n64"
+run_dump_test_n64l "bal-jalx-pic-ignore-n64"
+run_dump_test_n64l "bal-jalx-pic-ignore-micromips-n64"
+
+run_dump_test_o32l "unaligned-jalx-0" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-1" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-2" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-3" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-mips16-0" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-mips16-1" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-micromips-0" [list [list ld $abi_ldflags(o32)]]
+run_dump_test_o32l "unaligned-jalx-micromips-1" [list [list ld $abi_ldflags(o32)]]
+
+run_dump_test_n32l "unaligned-jalx-addend-0"
+run_dump_test_n32l "unaligned-jalx-addend-1"
+run_dump_test_n32l "unaligned-jalx-addend-2"
+run_dump_test_n32l "unaligned-jalx-addend-3"
+run_dump_test_n32l "unaligned-jalx-addend-mips16-0"
+run_dump_test_n32l "unaligned-jalx-addend-mips16-1"
+run_dump_test_n32l "unaligned-jalx-addend-micromips-0"
+run_dump_test_n32l "unaligned-jalx-addend-micromips-1"
 
 run_dump_test_o32 "unaligned-branch" noarch
 
-run_dump_test_n32 "unaligned-branch-2"
-run_dump_test_n32 "unaligned-branch-ignore-2"
+run_dump_test_n32l "unaligned-branch-2"
+run_dump_test_n32l "unaligned-branch-ignore-2"
 run_dump_test_n32 "unaligned-branch-r6-1"
 run_dump_test_n32 "unaligned-branch-ignore-r6-1"
 run_dump_test_n32 "unaligned-branch-r6-2" noarch
-run_dump_test_n32 "unaligned-branch-mips16"
-run_dump_test_n32 "unaligned-branch-ignore-mips16"
-run_dump_test_n32 "unaligned-branch-micromips"
-run_dump_test_n32 "unaligned-branch-ignore-micromips"
-run_dump_test_n32 "unaligned-jump"
-run_dump_test_n32 "unaligned-jump-mips16"
-run_dump_test_n32 "unaligned-jump-micromips"
+run_dump_test_n32l "unaligned-branch-mips16"
+run_dump_test_n32l "unaligned-branch-ignore-mips16"
+run_dump_test_n32l "unaligned-branch-micromips"
+run_dump_test_n32l "unaligned-branch-ignore-micromips"
+run_dump_test_n32l "unaligned-jump"
+run_dump_test_n32l "unaligned-jump-mips16"
+run_dump_test_n32l "unaligned-jump-micromips"
 
 run_dump_test_o32 "unaligned-lwpc-0" noarch
 run_dump_test_o32 "unaligned-lwpc-1" noarch
@@ -474,11 +516,11 @@ if { $linux_gnu } {
 }
 
 if { $embedded_elf } {
-    run_dump_test_n32 "elf-rel-got-n32-embed" {{as -EB} {ld -EB}}
-    run_dump_test_n32 "elf-rel-xgot-n32-embed" {{as -EB} {ld -EB}}
+    run_dump_test_n32l "elf-rel-got-n32-embed" {{as -EB} {ld -EB}}
+    run_dump_test_n32l "elf-rel-xgot-n32-embed" {{as -EB} {ld -EB}}
 } else {
-    run_dump_test_n32 "elf-rel-got-n32" {{as -EB} {ld -EB}}
-    run_dump_test_n32 "elf-rel-xgot-n32" {{as -EB} {ld -EB}}
+    run_dump_test_n32l "elf-rel-got-n32" {{as -EB} {ld -EB}}
+    run_dump_test_n32l "elf-rel-xgot-n32" {{as -EB} {ld -EB}}
 }
 if { $irix } {
     run_dump_test_n64 "elf-rel-got-n64-irix"
@@ -487,8 +529,8 @@ if { $irix } {
     run_dump_test_n64 "elf-rel-got-n64-embed" {{as -EB} {ld -EB}}
     run_dump_test_n64 "elf-rel-xgot-n64-embed" {{as -EB} {ld -EB}}
 } else {
-    run_dump_test_n64 "elf-rel-got-n64" {{as -EB} {ld -EB}}
-    run_dump_test_n64 "elf-rel-xgot-n64" {{as -EB} {ld -EB}}
+    run_dump_test_n64l "elf-rel-got-n64" {{as -EB} {ld -EB}}
+    run_dump_test_n64l "elf-rel-xgot-n64" {{as -EB} {ld -EB}}
 }
 
 run_dump_test_n32 "relax-jalr-n32" {{as -EB} {ld -EB}}
@@ -795,8 +837,8 @@ run_dump_test_n32 "jalbal" noarch
 
 run_dump_test "mode-change-error-1"
 
-run_dump_test_o32 "mips16-hilo"
-run_dump_test_n32 "mips16-hilo-n32"
+run_dump_test_o32l "mips16-hilo"
+run_dump_test_n32l "mips16-hilo-n32"
 
 if { $linux_gnu } {
     run_dump_test_n32 "textrel-1"
@@ -865,8 +907,8 @@ if { $linux_gnu && $has_abi(o32) } {
     set base_syms 1
     foreach { isa aflag lflag suffix } \
 	{ MIPS -march=mips1 "" "" \
-	  microMIPS -mmicromips "" -micromips \
-	  "microMIPS insn32" "-mmicromips -minsn32" --insn32 \
+	  microMIPS "-mips32r2 -mmicromips" "" -micromips \
+	  "microMIPS insn32" "-mips32r2 -mmicromips -minsn32" --insn32 \
 	      -micromips-insn32 } {
 	foreach dynsym { 7fff 8000 fff0 10000 2fe80 } {
 	    run_ld_link_tests \
@@ -1206,7 +1248,7 @@ foreach { abi } $abis {
 	[list \
 	    "MIPS JALR reloc unaligned/cross-mode link test ($abi)" \
 	    "$abi_ldflags($abi) -T jalr3.ld" "" \
-	    "$abi_asflags($abi)" \
+	    "$abi_asflags($abi) -march=from-abi" \
 	    [list ../../../gas/testsuite/gas/mips/jalr4.s] \
 	    [list "objdump {-d --prefix-addresses --show-raw-insn} jalr4.dd"] \
 	    "jalr4-${abi}"] \
@@ -1244,6 +1286,8 @@ proc run_mips_plt_test { name abi filter micromips suffix {extra {}} } {
     append as_flags " --defsym micromips=$micromips --defsym $abi=1"
     if {[string equal $abi o32]} {
 	append as_flags " -march=mips2"
+    } else {
+	append as_flags " -march=mips3"
     }
     set ld_flags "$abi_ldflags($abi) -T compressed-plt-1.ld"
     set dynobj "tmpdir/compressed-plt-1-${abi}-dyn.so"
@@ -1383,7 +1427,7 @@ if { $has_abi(o32) } {
     run_ld_link_tests [list \
 	[list \
 	    "PR ld/21334 MIPS GOT16 relocation in static binary" \
-	    "$abi_ldflags(o32) -e foo -T pr21334.ld" "" "$abi_asflags(o32)" \
+	    "$abi_ldflags(o32) -e foo -T pr21334.ld" "" "$abi_asflags(o32) -march=from-abi" \
 	    {pr21334.s} \
 	    {{objdump {-d --prefix-addresses} pr21334.dd} \
 	     {readelf -A pr21334.gd}} \
@@ -1418,7 +1462,7 @@ if { $has_abi(o32) } {
 	[list \
 	    "microMIPS link PIC branch relaxation with offset" \
 	    "$abi_ldflags(o32) -shared -T relax-offset.ld" "" \
-	    "$abi_asflags(o32) -relax-branch -mmicromips" \
+	    "$abi_asflags(o32) -relax-branch -mips32r2 -mmicromips" \
 	    {../../../gas/testsuite/gas/mips/relax-offset.s} \
 	    {{objdump \
 	      {-d --prefix-addresses --show-raw-insn} \
@@ -1571,7 +1615,7 @@ proc run_mips_undefweak_test { name abi args } {
 		"$name" \
 		"$abi_ldflags($abi) -e foo -T pr21375${scrsuf}.ld ${ldxtra}" \
 		"" \
-		"$abi_asflags($abi) ${asxtra}" \
+		"$abi_asflags($abi) -march=from-abi ${asxtra}" \
 		[list pr21375${srcsuf}.s] \
 		[list \
 		    [list objdump -d pr21375${objsuf}.dd] \
@@ -1650,11 +1694,11 @@ run_dump_test "pic-reloc-2"
 run_dump_test "pic-reloc-3"
 run_dump_test "pic-reloc-4"
 run_dump_test_o32 "pic-reloc-5"
-run_dump_test_o32 "pic-reloc-5" [list [list name (microMIPS)] \
+run_dump_test_o32l "pic-reloc-5" [list [list name (microMIPS)] \
 				      [list as "-mmicromips"]]
-run_dump_test_o32 "pic-reloc-6"
+run_dump_test_o32l "pic-reloc-6"
 run_dump_test_n64 "pic-reloc-7"
-run_dump_test_n64 "pic-reloc-7" [list [list name (microMIPS)] \
+run_dump_test_n64l "pic-reloc-7" [list [list name (microMIPS)] \
 				      [list as "-mmicromips"]]
 
 run_dump_test_o32 "reloc-pcrel-r6"
diff --git a/ld/testsuite/ld-mips-elf/mips16-1.d b/ld/testsuite/ld-mips-elf/mips16-1.d
index 77d1316cb1e..f2d5caafe4b 100644
--- a/ld/testsuite/ld-mips-elf/mips16-1.d
+++ b/ld/testsuite/ld-mips-elf/mips16-1.d
@@ -1,5 +1,5 @@
-#source: mips16-1a.s -no-mips16
-#source: mips16-1b.s -mips16
+#source: mips16-1a.s -no-mips16 -march=from-abi
+#source: mips16-1b.s -mips16 -march=from-abi
 #ld: -r
 #objdump: -pd
 
diff --git a/ld/testsuite/ld-mips-elf/mips16-and-micromips.d b/ld/testsuite/ld-mips-elf/mips16-and-micromips.d
index 6d740fe7209..4b89ae30388 100644
--- a/ld/testsuite/ld-mips-elf/mips16-and-micromips.d
+++ b/ld/testsuite/ld-mips-elf/mips16-and-micromips.d
@@ -1,5 +1,5 @@
 #name: MIPS16 and microMIPS interlink
-#source: ../../../gas/testsuite/gas/mips/nop.s -mips16
-#source: ../../../gas/testsuite/gas/mips/nop.s -mmicromips
+#source: ../../../gas/testsuite/gas/mips/nop.s -mips16 -march=from-abi
+#source: ../../../gas/testsuite/gas/mips/nop.s -mmicromips -march=from-abi
 #ld: -e0
 #error: \A.*: .*\.o: ASE mismatch: linking microMIPS module with previous MIPS16 modules[\n\r]+.*: failed to merge target specific data of file .*\.o\Z
diff --git a/ld/testsuite/ld-mips-elf/mode-change-error-1.d b/ld/testsuite/ld-mips-elf/mode-change-error-1.d
index afa54d88f0e..90636c2e42d 100644
--- a/ld/testsuite/ld-mips-elf/mode-change-error-1.d
+++ b/ld/testsuite/ld-mips-elf/mode-change-error-1.d
@@ -1,6 +1,6 @@
 #name: Mode Change Error 1
-#source: mode-change-error-1a.s
-#source: mode-change-error-1b.s
+#source: mode-change-error-1a.s -march=from-abi
+#source: mode-change-error-1b.s -march=from-abi
 #ld: -e 0x8000000
 #error: \A[^\n]*: in function `main':\n
 #error:   \(\.text\+0x0\): unsupported jump between ISA modes; consider recompiling with interlinking enabled\n
diff --git a/ld/testsuite/ld-mips-elf/n64-plt-1.dd b/ld/testsuite/ld-mips-elf/n64-plt-1.dd
index 4c24a9a16ce..51d654a343b 100644
--- a/ld/testsuite/ld-mips-elf/n64-plt-1.dd
+++ b/ld/testsuite/ld-mips-elf/n64-plt-1.dd
@@ -15,7 +15,7 @@ Disassembly of section \.plt:
 00000000100002a0 <bar@plt>:
     100002a0:	3c0f7fff 	lui	t3,0x7fff
     100002a4:	ddf97ff8 	ld	t9,32760\(t3\)
-    100002a8:	03200008 	jr	t9
+    100002a8:	0320000[89] 	jr	t9
     100002ac:	25f87ff8 	addiu	t8,t3,32760
 
 Disassembly of section \.text:
diff --git a/ld/testsuite/ld-mips-elf/n64-plt-4.dd b/ld/testsuite/ld-mips-elf/n64-plt-4.dd
index 01c50256153..71fee33c4e1 100644
--- a/ld/testsuite/ld-mips-elf/n64-plt-4.dd
+++ b/ld/testsuite/ld-mips-elf/n64-plt-4.dd
@@ -15,7 +15,7 @@ ffffffff1000029c:	2718fffe 	addiu	t8,t8,-2
 ffffffff100002a0 <bar@plt>:
 ffffffff100002a0:	3c0f8000 	lui	t3,0x8000
 ffffffff100002a4:	ddf98010 	ld	t9,-32752\(t3\)
-ffffffff100002a8:	03200008 	jr	t9
+ffffffff100002a8:	0320000[89] 	jr	t9
 ffffffff100002ac:	25f88010 	addiu	t8,t3,-32752
 
 Disassembly of section \.text:
diff --git a/ld/testsuite/ld-mips-elf/nan-legacy.d b/ld/testsuite/ld-mips-elf/nan-legacy.d
index 8dacc069671..0d90432e61b 100644
--- a/ld/testsuite/ld-mips-elf/nan-legacy.d
+++ b/ld/testsuite/ld-mips-elf/nan-legacy.d
@@ -1,5 +1,6 @@
 #source: nan-legacy.s
 #source: nan-legacy.s
+#as: -march=from-abi
 #ld: -r
 #objdump: -p
 
diff --git a/ld/testsuite/ld-mips-elf/nan-mixed-1.d b/ld/testsuite/ld-mips-elf/nan-mixed-1.d
index 9bc524c5552..c7e9570d5ee 100644
--- a/ld/testsuite/ld-mips-elf/nan-mixed-1.d
+++ b/ld/testsuite/ld-mips-elf/nan-mixed-1.d
@@ -1,5 +1,6 @@
 #source: nan-legacy.s
 #source: nan-2008.s
+#as: -march=from-abi
 #ld: -r
 #error: \A[^\n]*: [^\n]* linking -mnan=2008 module with previous -mnan=legacy modules\n
 #error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
diff --git a/ld/testsuite/ld-mips-elf/nan-mixed-2.d b/ld/testsuite/ld-mips-elf/nan-mixed-2.d
index 388d7709663..a96cda06081 100644
--- a/ld/testsuite/ld-mips-elf/nan-mixed-2.d
+++ b/ld/testsuite/ld-mips-elf/nan-mixed-2.d
@@ -1,5 +1,6 @@
 #source: nan-2008.s
 #source: nan-legacy.s
+#as: -march=from-abi
 #ld: -r
 #error: \A[^\n]*: [^\n]* linking -mnan=legacy module with previous -mnan=2008 modules\n
 #error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
diff --git a/ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d b/ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d
index 3baf22851a0..e3cc14ec793 100644
--- a/ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d
+++ b/ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d
@@ -17,6 +17,6 @@ Disassembly of section \.text:
    4101c:	27391020 	addiu	t9,t9,4128
 
 00041020 <foo2>:
-   41020:	03e00008 	jr	ra
+   41020:	03e0000[89] 	jr	ra
    41024:	00000000 	nop
 	\.\.\.
diff --git a/ld/testsuite/ld-mips-elf/reloc-3.d b/ld/testsuite/ld-mips-elf/reloc-3.d
index 1ec51c5f8f3..02150162d37 100644
--- a/ld/testsuite/ld-mips-elf/reloc-3.d
+++ b/ld/testsuite/ld-mips-elf/reloc-3.d
@@ -1,5 +1,5 @@
 #name: R_MIPS16_GPREL reloc
-#source: ../../../gas/testsuite/gas/mips/elf-rel6.s
+#source: ../../../gas/testsuite/gas/mips/elf-rel6.s -march=from-abi
 #objdump: --prefix-addresses -tdr --show-raw-insn
 #ld: -Ttext 0x20000000 -e 0x20000000 -N
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4/4] MIPS: fix -gnuabi64 testsuite
  2023-05-12  7:17 [PATCH 0/4] Some MIPS changes and testsuite fixes YunQiang Su
                   ` (2 preceding siblings ...)
  2023-05-12  7:17 ` [PATCH 3/4] MIPS: fix r6 testsuites YunQiang Su
@ 2023-05-12  7:17 ` YunQiang Su
  2023-05-13 11:57 ` [PATCH 0/4] Some MIPS changes and testsuite fixes Alan Modra
  4 siblings, 0 replies; 6+ messages in thread
From: YunQiang Su @ 2023-05-12  7:17 UTC (permalink / raw)
  To: binutils
  Cc: syq, macro, xry111, richard.sandiford, jiaxun.yang, amodra, YunQiang Su

Test on:
	mips64-linux-gnuabi64
	mips64el-linux-gnuabi64
	mipsisa64-linux-gnuabi64
	mipsisa64el-linux-gnuabi64
	mipsisa64r2-linux-gnuabi64
	mipsisa64r2el-linux-gnuabi64
	mipsisa64r6-linux-gnuabi64
	mipsisa64r6el-linux-gnuabi64
---
 binutils/testsuite/binutils-all/mips/mips.exp |  19 +
 binutils/testsuite/binutils-all/objcopy.exp   |   2 +-
 binutils/testsuite/binutils-all/readelf.r-64  |   2 +
 binutils/testsuite/binutils-all/readelf.s-64  |  10 +-
 .../testsuite/binutils-all/remove-relocs-01.d |   2 +-
 .../testsuite/binutils-all/remove-relocs-04.d |   2 +-
 .../testsuite/binutils-all/remove-relocs-05.d |   2 +-
 .../testsuite/binutils-all/remove-relocs-06.d |   2 +-
 binutils/testsuite/binutils-all/strip-3.d     |   2 +-
 gas/testsuite/gas/all/assign.d                |   4 +
 gas/testsuite/gas/all/fwdexp.d                |   2 +
 gas/testsuite/gas/all/none.d                  |   2 +
 gas/testsuite/gas/elf/missing-build-notes.d   |   8 +
 gas/testsuite/gas/macros/irp.d                |  12 +
 gas/testsuite/gas/macros/repeat.d             |  72 ++
 gas/testsuite/gas/macros/rept.d               |   6 +
 gas/testsuite/gas/macros/test2.d              |   6 +
 gas/testsuite/gas/macros/vararg.d             |  12 +
 gas/testsuite/gas/mips/align2-el.d            |   8 +-
 gas/testsuite/gas/mips/align2.d               |   8 +-
 gas/testsuite/gas/mips/compact-eh-eb-1.d      |  11 +-
 gas/testsuite/gas/mips/compact-eh-eb-2.d      |  23 +-
 gas/testsuite/gas/mips/compact-eh-eb-3.d      |  15 +-
 gas/testsuite/gas/mips/compact-eh-eb-4.d      |  15 +-
 gas/testsuite/gas/mips/compact-eh-eb-5.d      |  23 +-
 gas/testsuite/gas/mips/compact-eh-eb-6.d      |  15 +-
 gas/testsuite/gas/mips/compact-eh-eb-7.d      |  23 +-
 gas/testsuite/gas/mips/compact-eh-el-1.d      |  11 +-
 gas/testsuite/gas/mips/compact-eh-el-2.d      |  23 +-
 gas/testsuite/gas/mips/compact-eh-el-3.d      |  15 +-
 gas/testsuite/gas/mips/compact-eh-el-4.d      |  15 +-
 gas/testsuite/gas/mips/compact-eh-el-5.d      |  23 +-
 gas/testsuite/gas/mips/compact-eh-el-6.d      |  15 +-
 gas/testsuite/gas/mips/compact-eh-el-7.d      |  23 +-
 gas/testsuite/gas/mips/fix-rm7000-2.d         |   2 +-
 gas/testsuite/gas/mips/llpscp-64.d            |   1 +
 gas/testsuite/gas/mips/loongson-2f-2.d        |   2 +-
 gas/testsuite/gas/mips/loongson-2f-3.d        |   4 +-
 .../gas/mips/micromips@fix-rm7000-2.d         |   2 +-
 gas/testsuite/gas/mips/mips-jalx.d            |   4 +-
 gas/testsuite/gas/mips/mips.exp               |  14 +-
 gas/testsuite/gas/mips/mips64-dsp.d           |   2 +-
 gas/testsuite/gas/mips/pcrel-1.d              |   4 +-
 gas/testsuite/gas/mips/set-arch.d             | 718 +++++++++---------
 ld/testsuite/ld-elf/eh5.d                     |  50 +-
 ld/testsuite/ld-elf/group.ld                  |   2 +-
 ld/testsuite/ld-elf/orphan-region.ld          |   2 +-
 ld/testsuite/ld-elf/orphan.ld                 |   2 +-
 ld/testsuite/ld-mips-elf/compact-eh6.d        |   6 +-
 ld/testsuite/ld-mips-elf/got-dump-1.d         |  22 +-
 ld/testsuite/ld-mips-elf/got-page-1.ld        |   2 +-
 ld/testsuite/ld-mips-elf/got-page-3.d         |  11 +-
 ld/testsuite/ld-mips-elf/jaloverflow-2.d      |   2 +-
 ld/testsuite/ld-mips-elf/jalx-1.d             |  10 +-
 ld/testsuite/ld-mips-elf/mips-elf.exp         |  28 +-
 ld/testsuite/ld-mips-elf/reloc-estimate-1.d   |   4 +-
 ld/testsuite/ld-scripts/overlay-size.t        |   2 +-
 ld/testsuite/ld-undefined/undefined.exp       |   4 +
 58 files changed, 803 insertions(+), 530 deletions(-)

diff --git a/binutils/testsuite/binutils-all/mips/mips.exp b/binutils/testsuite/binutils-all/mips/mips.exp
index 3b7bc29056a..bd2a2f754e3 100644
--- a/binutils/testsuite/binutils-all/mips/mips.exp
+++ b/binutils/testsuite/binutils-all/mips/mips.exp
@@ -152,6 +152,25 @@ set abi_ldflags(eabi) ""
 # Override as needed.
 if {[istarget *-*-openbsd*] } {
     set irixemul 0
+} elseif { [istarget mips*64*-*-linux*-gnuabi64] } {
+    set abi_asflags(o32) -32
+    set abi_asflags(o32l) "-32 -march=from-abi"
+    set abi_asflags(n32) "-n32"
+    set abi_asflags(n32l) "-n32 -march=from-abi"
+    set abi_asflags(n64) ""
+    set abi_asflags(n64l) "-march=from-abi -64"
+    if [istarget *el-*-*] {
+	set abi_ldflags(o32) -melf32ltsmip
+	set abi_ldflags(o32l) -melf32ltsmip
+	set abi_ldflags(n32) -melf32ltsmipn32
+	set abi_ldflags(n32l) -melf32ltsmipn32
+    } else {
+	set abi_ldflags(o32) -melf32btsmip
+	set abi_ldflags(o32l) -melf32btsmip
+	set abi_ldflags(n32) -melf32btsmipn32
+	set abi_ldflags(n32l) -melf32btsmipn32
+    }
+    set irixemul 0
 } elseif { [istarget mips*64*-*-linux*] } {
     set abi_asflags(o32) -32
     set abi_asflags(o32l) "-32 -march=from-abi"
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index 361e430f119..f6d4d1b839e 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -1269,7 +1269,7 @@ if [is_elf_format] {
     run_dump_test "strip-9"
     run_dump_test "strip-12"
 
-    if { [istarget "mips64*-*-openbsd*"] } {
+    if { [istarget "mips64*-*-openbsd*"] || [istarget "mips*64*-linux-gnuabi64"] } {
 	set reloc_format mips64
     }
     # A relocation type not supported by any target
diff --git a/binutils/testsuite/binutils-all/readelf.r-64 b/binutils/testsuite/binutils-all/readelf.r-64
index e7487f1bece..7f850d9e0db 100644
--- a/binutils/testsuite/binutils-all/readelf.r-64
+++ b/binutils/testsuite/binutils-all/readelf.r-64
@@ -2,3 +2,5 @@
 Relocation section '.rel.*text' at offset 0x.* contains 1 entry:
   Offset          Info           Type           Sym. Value    Sym. Name.*
 0+04  [0-9A-Fa-f]+ *R_.*0+00 external_symbol.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
diff --git a/binutils/testsuite/binutils-all/readelf.s-64 b/binutils/testsuite/binutils-all/readelf.s-64
index e0037a56954..380a9c1aa55 100644
--- a/binutils/testsuite/binutils-all/readelf.s-64
+++ b/binutils/testsuite/binutils-all/readelf.s-64
@@ -10,8 +10,8 @@ Section Headers:
  +\[ 2\] .rel.+text +REL. +0+ +0+.*
  +000000000000001. +000000000000001. +I +. +1 +8
  +\[ 3\] .data +PROGBITS +0000000000000000 +000000(48|50)
- +000000000000000[48] +0000000000000000 +WA +0 +0 +.*
- +\[ 4\] .bss +NOBITS +0000000000000000 +000000(4c|50|54|58|68)
+ +00000000000000(04|08|10) +0000000000000000 +WA +0 +0 +.*
+ +\[ 4\] .bss +NOBITS +0000000000000000 +000000(4c|50|54|58|60|68)
  +0000000000000000 +0000000000000000 +WA +0 +0 +.*
 # x86 targets may put .note.gnu.property here.
 # riscv targets put .riscv.attributes here.
@@ -20,10 +20,10 @@ Section Headers:
 # aarch64-elf targets have one more data symbol.
 # x86 targets may have .note.gnu.property.
 # riscv targets have two more symbols, data symbol and .riscv.attributes.
- +0+.* +0000000000000018 +(6|7) +(3|4|5) +8
- +\[ .\] .strtab +STRTAB +0000000000000000 +0+.*
+ +0+.* +0000000000000(018|180) +(6|7|10) +(3|4|5|10) +8
+ +\[..\] .strtab +STRTAB +0000000000000000 +0+.*
  +0+.* +0000000000000000 .* +0 +0 +1
- +\[ .\] .shstrtab +STRTAB +0000000000000000 +[0-9a-f]+
+ +\[..\] .shstrtab +STRTAB +0000000000000000 +[0-9a-f]+
  +00000000000000.. +0000000000000000 .* +0 +0 +.*
 Key to Flags:
 #...
diff --git a/binutils/testsuite/binutils-all/remove-relocs-01.d b/binutils/testsuite/binutils-all/remove-relocs-01.d
index 702747bc3f3..abef16fdff2 100644
--- a/binutils/testsuite/binutils-all/remove-relocs-01.d
+++ b/binutils/testsuite/binutils-all/remove-relocs-01.d
@@ -2,7 +2,7 @@
 #source: remove-relocs-01.s
 #objcopy: --remove-relocations=.data.relocs.01
 #readelf: -r
-#notarget: "mips64*-*-openbsd*"
+#notarget: "mips64*-*-openbsd*" "mips*64*-*-linux-gnuabi64"
 
 Relocation section '\.rela?\.data\.relocs\.02' at offset 0x[0-9a-f]+ contains 3 entries:
 .*
diff --git a/binutils/testsuite/binutils-all/remove-relocs-04.d b/binutils/testsuite/binutils-all/remove-relocs-04.d
index 1b8eab39a1a..ce63f50827a 100644
--- a/binutils/testsuite/binutils-all/remove-relocs-04.d
+++ b/binutils/testsuite/binutils-all/remove-relocs-04.d
@@ -2,7 +2,7 @@
 #source: remove-relocs-01.s
 #objcopy: --remove-relocations=.data.relocs.0\[12\]
 #readelf: -r
-#notarget: "mips64*-*-openbsd*"
+#notarget: "mips64*-*-openbsd*" "mips*64*-linux-gnuabi64"
 
 Relocation section '\.rela?\.data\.relocs\.03' at offset 0x[0-9a-f]+ contains 3 entries:
 .*
diff --git a/binutils/testsuite/binutils-all/remove-relocs-05.d b/binutils/testsuite/binutils-all/remove-relocs-05.d
index a429182d258..a74c573cf90 100644
--- a/binutils/testsuite/binutils-all/remove-relocs-05.d
+++ b/binutils/testsuite/binutils-all/remove-relocs-05.d
@@ -2,7 +2,7 @@
 #source: remove-relocs-01.s
 #objcopy: --remove-section=.rela.data.relocs.01 --remove-section=.rel.data.relocs.01
 #readelf: -r
-#notarget: "mips64*-*-openbsd*"
+#notarget: "mips64*-*-openbsd*" "mips*64*-linux-gnuabi64"
 
 Relocation section '\.rela?\.data\.relocs\.02' at offset 0x[0-9a-f]+ contains 3 entries:
 .*
diff --git a/binutils/testsuite/binutils-all/remove-relocs-06.d b/binutils/testsuite/binutils-all/remove-relocs-06.d
index 5214bc7297a..53c47b582da 100644
--- a/binutils/testsuite/binutils-all/remove-relocs-06.d
+++ b/binutils/testsuite/binutils-all/remove-relocs-06.d
@@ -2,7 +2,7 @@
 #source: remove-relocs-01.s
 #objcopy: --remove-relocations=.data.relocs.* --remove-relocations=!.data.relocs.02
 #readelf: -r
-#notarget: "mips64*-*-openbsd*"
+#notarget: "mips64*-*-openbsd*" "mips*64*-linux-gnuabi64"
 
 Relocation section '\.rela?\.data\.relocs\.02' at offset 0x[0-9a-f]+ contains 3 entries:
 .*
diff --git a/binutils/testsuite/binutils-all/strip-3.d b/binutils/testsuite/binutils-all/strip-3.d
index cb2f78eef5c..89c75ae6992 100644
--- a/binutils/testsuite/binutils-all/strip-3.d
+++ b/binutils/testsuite/binutils-all/strip-3.d
@@ -1,6 +1,6 @@
 #PROG: strip
 #source: empty.s
-#strip: -R .text -R .data -R .bss -R .ARM.attributes -R .reginfo -R .gnu.attributes -R .MIPS.abiflags -R .pdr -R .xtensa.info -R .ARC.attributes -R .note.gnu.property -R .riscv.attributes -R .csky.attributes
+#strip: -R .text -R .data -R .bss -R .ARM.attributes -R .reginfo -R .gnu.attributes -R .MIPS.abiflags -R .MIPS.options -R .pdr -R .xtensa.info -R .ARC.attributes -R .note.gnu.property -R .riscv.attributes -R .csky.attributes
 #readelf: -S --wide
 #name: strip empty file
 #target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi
diff --git a/gas/testsuite/gas/all/assign.d b/gas/testsuite/gas/all/assign.d
index 64b39976ec4..172d0b74f29 100644
--- a/gas/testsuite/gas/all/assign.d
+++ b/gas/testsuite/gas/all/assign.d
@@ -3,5 +3,9 @@
 
 #...
 .*zzz.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 .*zzz.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 #pass
diff --git a/gas/testsuite/gas/all/fwdexp.d b/gas/testsuite/gas/all/fwdexp.d
index e83d05a9a94..9b839314741 100644
--- a/gas/testsuite/gas/all/fwdexp.d
+++ b/gas/testsuite/gas/all/fwdexp.d
@@ -6,6 +6,8 @@
 RELOCATION RECORDS FOR .*
 OFFSET +TYPE +VALUE
 0+ .*(\.data|label_i)(|\+0xf+e|\+0xf+c|\+0xf+8|-0x0*2|-0x0*4|-0x0*8)
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 Contents of section .*
  0+ (0+|feff|fffe|fcffffff|fffffffc|f8ffffff|f8ffffff ffffffff|ffffffff fffffff8|0+4) .*
diff --git a/gas/testsuite/gas/all/none.d b/gas/testsuite/gas/all/none.d
index 374808a4f59..9ea861cbd71 100644
--- a/gas/testsuite/gas/all/none.d
+++ b/gas/testsuite/gas/all/none.d
@@ -5,3 +5,5 @@
 
 #...
 0+ .*(NONE|NULL|UNUSED0) +\*ABS\*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
diff --git a/gas/testsuite/gas/elf/missing-build-notes.d b/gas/testsuite/gas/elf/missing-build-notes.d
index 95071baefa7..273bd37c5a9 100644
--- a/gas/testsuite/gas/elf/missing-build-notes.d
+++ b/gas/testsuite/gas/elf/missing-build-notes.d
@@ -8,7 +8,15 @@
 RELOCATION RECORDS FOR \[.gnu.build.attributes\]:
 OFFSET +TYPE +VALUE
 0+014 .*[ 	]+.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+0(18|1c) .*[ 	]+.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+0(30|38) .*[ 	]+.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+0(34|40) .*[ 	]+.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 #pass
diff --git a/gas/testsuite/gas/macros/irp.d b/gas/testsuite/gas/macros/irp.d
index fd98b60cc80..62a5df265a2 100644
--- a/gas/testsuite/gas/macros/irp.d
+++ b/gas/testsuite/gas/macros/irp.d
@@ -8,9 +8,21 @@
 RELOCATION RECORDS FOR .*
 OFFSET[ 	]+TYPE[ 	]+VALUE.*
 0+00[ 	]+[a-zA-Z0-9_]+[ 	]+foo1
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+04[ 	]+[a-zA-Z0-9_]+[ 	]+foo2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+08[ 	]+[a-zA-Z0-9_]+[ 	]+foo3
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+0c[ 	]+[a-zA-Z0-9_]+[ 	]+bar1
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+10[ 	]+[a-zA-Z0-9_]+[ 	]+bar2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+14[ 	]+[a-zA-Z0-9_]+[ 	]+bar3
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 #pass
diff --git a/gas/testsuite/gas/macros/repeat.d b/gas/testsuite/gas/macros/repeat.d
index 8f3bdcf535c..3392bfd7532 100644
--- a/gas/testsuite/gas/macros/repeat.d
+++ b/gas/testsuite/gas/macros/repeat.d
@@ -8,39 +8,111 @@
 RELOCATION RECORDS FOR .*
 OFFSET[ 	]+TYPE[ 	]+VALUE.*
 0+00[ 	]+[a-zA-Z0-9_]+[ 	]+irp_irp_19
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+04[ 	]+[a-zA-Z0-9_]+[ 	]+irp_irp_18
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+08[ 	]+[a-zA-Z0-9_]+[ 	]+irp_irp_29
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+0c[ 	]+[a-zA-Z0-9_]+[ 	]+irp_irp_28
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+10[ 	]+[a-zA-Z0-9_]+[ 	]+irp_irpc_19
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+14[ 	]+[a-zA-Z0-9_]+[ 	]+irp_irpc_18
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+18[ 	]+[a-zA-Z0-9_]+[ 	]+irp_irpc_29
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+1c[ 	]+[a-zA-Z0-9_]+[ 	]+irp_irpc_28
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+20[ 	]+[a-zA-Z0-9_]+[ 	]+irp_rept_1
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+24[ 	]+[a-zA-Z0-9_]+[ 	]+irp_rept_1
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+28[ 	]+[a-zA-Z0-9_]+[ 	]+irp_rept_2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+2c[ 	]+[a-zA-Z0-9_]+[ 	]+irp_rept_2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+30[ 	]+[a-zA-Z0-9_]+[ 	]+irpc_irp_19
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+34[ 	]+[a-zA-Z0-9_]+[ 	]+irpc_irp_18
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+38[ 	]+[a-zA-Z0-9_]+[ 	]+irpc_irp_29
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+3c[ 	]+[a-zA-Z0-9_]+[ 	]+irpc_irp_28
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+40[ 	]+[a-zA-Z0-9_]+[ 	]+irpc_irpc_19
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+44[ 	]+[a-zA-Z0-9_]+[ 	]+irpc_irpc_18
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+48[ 	]+[a-zA-Z0-9_]+[ 	]+irpc_irpc_29
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+4c[ 	]+[a-zA-Z0-9_]+[ 	]+irpc_irpc_28
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+50[ 	]+[a-zA-Z0-9_]+[ 	]+irpc_rept_1
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+54[ 	]+[a-zA-Z0-9_]+[ 	]+irpc_rept_1
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+58[ 	]+[a-zA-Z0-9_]+[ 	]+irpc_rept_2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+5c[ 	]+[a-zA-Z0-9_]+[ 	]+irpc_rept_2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+60[ 	]+[a-zA-Z0-9_]+[ 	]+rept_irp_9
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+64[ 	]+[a-zA-Z0-9_]+[ 	]+rept_irp_8
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+68[ 	]+[a-zA-Z0-9_]+[ 	]+rept_irp_9
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+6c[ 	]+[a-zA-Z0-9_]+[ 	]+rept_irp_8
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+70[ 	]+[a-zA-Z0-9_]+[ 	]+rept_irpc_9
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+74[ 	]+[a-zA-Z0-9_]+[ 	]+rept_irpc_8
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+78[ 	]+[a-zA-Z0-9_]+[ 	]+rept_irpc_9
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+7c[ 	]+[a-zA-Z0-9_]+[ 	]+rept_irpc_8
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+80[ 	]+[a-zA-Z0-9_]+[ 	]+rept_rept
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+84[ 	]+[a-zA-Z0-9_]+[ 	]+rept_rept
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+88[ 	]+[a-zA-Z0-9_]+[ 	]+rept_rept
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+8c[ 	]+[a-zA-Z0-9_]+[ 	]+rept_rept
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 #pass
diff --git a/gas/testsuite/gas/macros/rept.d b/gas/testsuite/gas/macros/rept.d
index 73223490e4f..1e553181601 100644
--- a/gas/testsuite/gas/macros/rept.d
+++ b/gas/testsuite/gas/macros/rept.d
@@ -8,6 +8,12 @@
 RELOCATION RECORDS FOR .*
 OFFSET[ 	]+TYPE[ 	]+VALUE.*
 0+00[ 	]+[a-zA-Z0-9_]+[ 	]+foo1
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+04[ 	]+[a-zA-Z0-9_]+[ 	]+foo1
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+08[ 	]+[a-zA-Z0-9_]+[ 	]+foo1
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 #pass
diff --git a/gas/testsuite/gas/macros/test2.d b/gas/testsuite/gas/macros/test2.d
index 08ba703ddd5..9d5cc6c0b14 100644
--- a/gas/testsuite/gas/macros/test2.d
+++ b/gas/testsuite/gas/macros/test2.d
@@ -8,6 +8,12 @@
 RELOCATION RECORDS FOR .*
 OFFSET[ 	]+TYPE[ 	]+VALUE.*
 0+00[ 	]+[a-zA-Z0-9_]+[ 	]+foo1
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+04[ 	]+[a-zA-Z0-9_]+[ 	]+foo2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+08[ 	]+[a-zA-Z0-9_]+[ 	]+foo3
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 #pass
diff --git a/gas/testsuite/gas/macros/vararg.d b/gas/testsuite/gas/macros/vararg.d
index f566eae4356..c83d93972cd 100644
--- a/gas/testsuite/gas/macros/vararg.d
+++ b/gas/testsuite/gas/macros/vararg.d
@@ -8,9 +8,21 @@
 RELOCATION RECORDS FOR .*
 OFFSET[ 	]+TYPE[ 	]+VALUE.*
 0+00[ 	]+[a-zA-Z0-9_]+[ 	]+foo1
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+04[ 	]+[a-zA-Z0-9_]+[ 	]+foo2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+08[ 	]+[a-zA-Z0-9_]+[ 	]+foo3
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+0c[ 	]+[a-zA-Z0-9_]+[ 	]+foo4
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+10[ 	]+[a-zA-Z0-9_]+[ 	]+foo5
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 0+14[ 	]+[a-zA-Z0-9_]+[ 	]+foo6
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 #pass
diff --git a/gas/testsuite/gas/mips/align2-el.d b/gas/testsuite/gas/mips/align2-el.d
index 8072c528282..8be241d9df4 100644
--- a/gas/testsuite/gas/mips/align2-el.d
+++ b/gas/testsuite/gas/mips/align2-el.d
@@ -6,7 +6,7 @@
 
 Disassembly of section \.text:
 
-00000000 <f1>:
+0+000000 <f1>:
    0:	4a01      	addiu	v0,1
    2:	6500      	nop
    4:	6500      	nop
@@ -14,14 +14,14 @@ Disassembly of section \.text:
    8:	4b01      	addiu	v1,1
    a:	6500      	nop
 
-0000000c <f2>:
+0+00000c <f2>:
    c:	24420001 	addiu	v0,v0,1
   10:	24630001 	addiu	v1,v1,1
 	\.\.\.
   20:	24840001 	addiu	a0,a0,1
   24:	00000000 	nop
 
-00000028 <f3>:
+0+000028 <f3>:
   28:	4001      	addiu	s0,s0,1
   2a:	6500      	nop
   2c:	6500      	nop
@@ -37,6 +37,6 @@ Disassembly of section \.text:
 
 Disassembly of section \.text\.a:
 
-00000000 <f4>:
+0+000000 <f4>:
    0:	24a50001 	addiu	a1,a1,1
 	\.\.\.
diff --git a/gas/testsuite/gas/mips/align2.d b/gas/testsuite/gas/mips/align2.d
index d14fa2ce7c4..d9d4bd1e2a8 100644
--- a/gas/testsuite/gas/mips/align2.d
+++ b/gas/testsuite/gas/mips/align2.d
@@ -5,7 +5,7 @@
 
 Disassembly of section \.text:
 
-00000000 <f1>:
+0+000000 <f1>:
    0:	4a01      	addiu	v0,1
    2:	6500      	nop
    4:	6500      	nop
@@ -13,14 +13,14 @@ Disassembly of section \.text:
    8:	4b01      	addiu	v1,1
    a:	6500      	nop
 
-0000000c <f2>:
+0+00000c <f2>:
    c:	24420001 	addiu	v0,v0,1
   10:	24630001 	addiu	v1,v1,1
 	\.\.\.
   20:	24840001 	addiu	a0,a0,1
   24:	00000000 	nop
 
-00000028 <f3>:
+0+000028 <f3>:
   28:	4001      	addiu	s0,s0,1
   2a:	6500      	nop
   2c:	6500      	nop
@@ -36,6 +36,6 @@ Disassembly of section \.text:
 
 Disassembly of section \.text\.a:
 
-00000000 <f4>:
+0+000000 <f4>:
    0:	24a50001 	addiu	a1,a1,1
 	\.\.\.
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-1.d b/gas/testsuite/gas/mips/compact-eh-eb-1.d
index de88882296d..dd23259c24c 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-1.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-1.d
@@ -8,14 +8,17 @@
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .text:
  0000 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-2.d b/gas/testsuite/gas/mips/compact-eh-eb-2.d
index e8d9f489d92..b626e5da018 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-2.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-2.d
@@ -8,27 +8,36 @@
 
 RELOCATION RECORDS FOR \[.data.DW.ref.__gnu_compact_pr2\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_32         __gnu_compact_pr2
+0+000000 R_MIPS_32         __gnu_compact_pr2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 RELOCATION RECORDS FOR \[.gnu_extab\]:
 OFFSET +TYPE +VALUE
-00000001 R_MIPS_PC32       DW.ref.__gnu_compact_pr2
+0+000001 R_MIPS_PC32       DW.ref.__gnu_compact_pr2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
-00000004 R_MIPS_PC32       .gnu_extab
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
+0+000004 R_MIPS_PC32       .gnu_extab
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .group:
  0000 00000001 00000007 00000008          .*
 Contents of section .text:
  0000 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-3.d b/gas/testsuite/gas/mips/compact-eh-eb-3.d
index 3a5345c79c6..5fca29fd6bb 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-3.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-3.d
@@ -8,15 +8,20 @@
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
-00000004 R_MIPS_PC32       .gnu_extab
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
+0+000004 R_MIPS_PC32       .gnu_extab
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .text:
  0000 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-4.d b/gas/testsuite/gas/mips/compact-eh-eb-4.d
index a39ab45455c..1964220962e 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-4.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-4.d
@@ -8,16 +8,21 @@
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
-00000004 R_MIPS_PC32       .gnu_extab
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
+0+000004 R_MIPS_PC32       .gnu_extab
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .text:
  0000 00000000 00000000 00000000 00000000  .*
  0010 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-5.d b/gas/testsuite/gas/mips/compact-eh-eb-5.d
index bc568353605..bcc3472e9e1 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-5.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-5.d
@@ -8,18 +8,26 @@
 
 RELOCATION RECORDS FOR \[.data.DW.ref.__gnu_compact_pr2\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_32         __gnu_compact_pr2
+0+000000 R_MIPS_32         __gnu_compact_pr2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 RELOCATION RECORDS FOR \[.gnu_extab\]:
 OFFSET +TYPE +VALUE
-00000001 R_MIPS_PC32       DW.ref.__gnu_compact_pr2
+0+000001 R_MIPS_PC32       DW.ref.__gnu_compact_pr2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
-00000004 R_MIPS_PC32       .gnu_extab
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
+0+000004 R_MIPS_PC32       .gnu_extab
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .group:
@@ -27,9 +35,10 @@ Contents of section .group:
 Contents of section .text:
  0000 00000000 00000000 00000000 00000000  .*
  0010 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-6.d b/gas/testsuite/gas/mips/compact-eh-eb-6.d
index a3d13c50035..3dd8e8b685d 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-6.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-6.d
@@ -8,16 +8,21 @@
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
-00000004 R_MIPS_PC32       .gnu_extab
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
+0+000004 R_MIPS_PC32       .gnu_extab
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .text:
  0000 00000000 00000000 00000000 00000000  .*
  0010 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-7.d b/gas/testsuite/gas/mips/compact-eh-eb-7.d
index 82da65ca286..fbc1330d872 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-7.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-7.d
@@ -8,27 +8,34 @@
 
 RELOCATION RECORDS FOR \[.eh_frame\]:
 OFFSET +TYPE +VALUE
-0000001c R_MIPS_PC32       .text.*
+0+00001c R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
-00000004 R_MIPS_PC32       .eh_frame.*
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
+0+000004 R_MIPS_PC32       .eh_frame.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .text:
  0000 00000000 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
 Contents of section .eh_frame:
  0000 00000010 00000000 017a5200 017c1f01  .*
- 0010 1b0d1d00 00000014 00000018 00000000  .*
- 0020 00000008 00441308 440e0000           .*
+ 0010 1b0d1d00 0000001[48] 00000018 00000000  .*
+ 0020 00000008 00441308 440e0000 (00000000|        )  .*
 Contents of section .eh_frame_entry:
  0000 00000001 00000015                    .*
 Contents of section .gnu.attributes:
diff --git a/gas/testsuite/gas/mips/compact-eh-el-1.d b/gas/testsuite/gas/mips/compact-eh-el-1.d
index d88871242aa..97ad1d84d8d 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-1.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-1.d
@@ -8,14 +8,17 @@
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .text:
  0000 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
diff --git a/gas/testsuite/gas/mips/compact-eh-el-2.d b/gas/testsuite/gas/mips/compact-eh-el-2.d
index b589122af59..e8c030ecd88 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-2.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-2.d
@@ -8,27 +8,36 @@
 
 RELOCATION RECORDS FOR \[.data.DW.ref.__gnu_compact_pr2\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_32         __gnu_compact_pr2
+0+000000 R_MIPS_32         __gnu_compact_pr2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 RELOCATION RECORDS FOR \[.gnu_extab\]:
 OFFSET +TYPE +VALUE
-00000001 R_MIPS_PC32       DW.ref.__gnu_compact_pr2
+0+000001 R_MIPS_PC32       DW.ref.__gnu_compact_pr2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
-00000004 R_MIPS_PC32       .gnu_extab
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
+0+000004 R_MIPS_PC32       .gnu_extab
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .group:
  0000 01000000 07000000 08000000           .*
 Contents of section .text:
  0000 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
diff --git a/gas/testsuite/gas/mips/compact-eh-el-3.d b/gas/testsuite/gas/mips/compact-eh-el-3.d
index bffe5772343..486c4f53d3e 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-3.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-3.d
@@ -8,15 +8,20 @@
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
-00000004 R_MIPS_PC32       .gnu_extab
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
+0+000004 R_MIPS_PC32       .gnu_extab
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .text:
  0000 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
diff --git a/gas/testsuite/gas/mips/compact-eh-el-4.d b/gas/testsuite/gas/mips/compact-eh-el-4.d
index 85bc6d10e1d..61bd45d0397 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-4.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-4.d
@@ -8,16 +8,21 @@
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
-00000004 R_MIPS_PC32       .gnu_extab
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
+0+000004 R_MIPS_PC32       .gnu_extab
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .text:
  0000 00000000 00000000 00000000 00000000  .*
  0010 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
diff --git a/gas/testsuite/gas/mips/compact-eh-el-5.d b/gas/testsuite/gas/mips/compact-eh-el-5.d
index ffa93b6e7e8..4d330023190 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-5.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-5.d
@@ -7,18 +7,26 @@
 
 RELOCATION RECORDS FOR \[.data.DW.ref.__gnu_compact_pr2\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_32         __gnu_compact_pr2
+0+000000 R_MIPS_32         __gnu_compact_pr2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 RELOCATION RECORDS FOR \[.gnu_extab\]:
 OFFSET +TYPE +VALUE
-00000001 R_MIPS_PC32       DW.ref.__gnu_compact_pr2
+0+000001 R_MIPS_PC32       DW.ref.__gnu_compact_pr2
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
-00000004 R_MIPS_PC32       .gnu_extab
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
+0+000004 R_MIPS_PC32       .gnu_extab
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .group:
@@ -26,9 +34,10 @@ Contents of section .group:
 Contents of section .text:
  0000 00000000 00000000 00000000 00000000  .*
  0010 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
diff --git a/gas/testsuite/gas/mips/compact-eh-el-6.d b/gas/testsuite/gas/mips/compact-eh-el-6.d
index 3dc8fb9ac57..e7f8d17f034 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-6.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-6.d
@@ -8,16 +8,21 @@
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
-00000004 R_MIPS_PC32       .gnu_extab
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
+0+000004 R_MIPS_PC32       .gnu_extab
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .text:
  0000 00000000 00000000 00000000 00000000  .*
  0010 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
diff --git a/gas/testsuite/gas/mips/compact-eh-el-7.d b/gas/testsuite/gas/mips/compact-eh-el-7.d
index 626f84c0202..35d3fb6016d 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-7.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-7.d
@@ -8,27 +8,34 @@
 
 RELOCATION RECORDS FOR \[.eh_frame\]:
 OFFSET +TYPE +VALUE
-0000001c R_MIPS_PC32       .text.*
+0+00001c R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 RELOCATION RECORDS FOR \[.eh_frame_entry\]:
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_PC32       .text.*
-00000004 R_MIPS_PC32       .eh_frame.*
+0+000000 R_MIPS_PC32       .text.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
+0+000004 R_MIPS_PC32       .eh_frame.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
 
 
 Contents of section .text:
  0000 00000000 00000000.*
-Contents of section .reginfo:
- 0000 00000000 00000000 00000000 00000000  .*
- 0010 00000000 00000000                    .*
+Contents of section (.reginfo|.MIPS.options):
+ 0000 0(000|128)0000 00000000 00000000 00000000  .*
+ (0010 00000000 00000000                  |0010 00000000 00000000 00000000 00000000)  .*
+#? 0020 00000000 00000000                    .*
 Contents of section .MIPS.abiflags:
  .*
  .*
 Contents of section .eh_frame:
  0000 10000000 00000000 017a5200 017c1f01  .*
- 0010 1b0d1d00 14000000 18000000 00000000  .*
- 0020 08000000 00441308 440e0000           .*
+ 0010 1b0d1d00 1[48]000000 18000000 00000000  .*
+ 0020 08000000 00441308 440e0000 (00000000|        )  .*
 Contents of section .eh_frame_entry:
  0000 01000000 15000000                    .*
 Contents of section .gnu.attributes:
diff --git a/gas/testsuite/gas/mips/fix-rm7000-2.d b/gas/testsuite/gas/mips/fix-rm7000-2.d
index 3ec28174336..552dad52044 100644
--- a/gas/testsuite/gas/mips/fix-rm7000-2.d
+++ b/gas/testsuite/gas/mips/fix-rm7000-2.d
@@ -1,4 +1,4 @@
-#as: -mfix-rm7000
+#as: -mfix-rm7000 -mabi=n32
 #objdump: -dz --prefix-addresses
 #name: MIPS RM7000 workarounds test 2
 #source: fix-rm7000-2.s
diff --git a/gas/testsuite/gas/mips/llpscp-64.d b/gas/testsuite/gas/mips/llpscp-64.d
index bbf1efb062f..033055019e4 100644
--- a/gas/testsuite/gas/mips/llpscp-64.d
+++ b/gas/testsuite/gas/mips/llpscp-64.d
@@ -1,4 +1,5 @@
 #objdump: -dr
+#as: -n32
 #name: Paired LL/SC for mips64r6
 
 .*: +file format .*
diff --git a/gas/testsuite/gas/mips/loongson-2f-2.d b/gas/testsuite/gas/mips/loongson-2f-2.d
index 0c4ec9819b9..a70573a3c96 100644
--- a/gas/testsuite/gas/mips/loongson-2f-2.d
+++ b/gas/testsuite/gas/mips/loongson-2f-2.d
@@ -6,7 +6,7 @@
 
 Disassembly of section .text:
 
-00000000 <loongson2f_nop_insn>:
+0+000000 <loongson2f_nop_insn>:
    0:	00200825 	move	\$1,\$1
    4:	00200825 	move	\$1,\$1
    8:	00200825 	move	\$1,\$1
diff --git a/gas/testsuite/gas/mips/loongson-2f-3.d b/gas/testsuite/gas/mips/loongson-2f-3.d
index 5269bcc33bc..c31d3abf53a 100644
--- a/gas/testsuite/gas/mips/loongson-2f-3.d
+++ b/gas/testsuite/gas/mips/loongson-2f-3.d
@@ -6,7 +6,7 @@
 
 Disassembly of section .text:
 
-00000000 <.text>:
+0+000000 <.text>:
    0:	3c01cfff 	lui	\$1,0xcfff
    4:	3421ffff 	ori	\$1,\$1,0xffff
    8:	03c1f024 	and	\$30,\$30,\$1
@@ -30,5 +30,7 @@ Disassembly of section .text:
 
   44:	08000000 	j	0x0
 			44: R_MIPS_26	external_label
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
   48:	00000000 	nop
   4c:	00000000 	nop
diff --git a/gas/testsuite/gas/mips/micromips@fix-rm7000-2.d b/gas/testsuite/gas/mips/micromips@fix-rm7000-2.d
index b95d6154d0e..236548fcab0 100644
--- a/gas/testsuite/gas/mips/micromips@fix-rm7000-2.d
+++ b/gas/testsuite/gas/mips/micromips@fix-rm7000-2.d
@@ -1,4 +1,4 @@
-#as: -mfix-rm7000
+#as: -mfix-rm7000 -mabi=n32
 #objdump: -dz --prefix-addresses
 #name: MIPS RM7000 workarounds test 2
 #source: fix-rm7000-2.s
diff --git a/gas/testsuite/gas/mips/mips-jalx.d b/gas/testsuite/gas/mips/mips-jalx.d
index 04174e39cf6..374a0a1b51c 100644
--- a/gas/testsuite/gas/mips/mips-jalx.d
+++ b/gas/testsuite/gas/mips/mips-jalx.d
@@ -3,9 +3,11 @@
 #name: mips jalx
 .*:     file format .*
 Disassembly of section .text:
-00000000 <.text>:
+0+000000 <.text>:
    0:	74000000 	jalx	0x0
 			0: R_MIPS_26	external_label
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
    4:	00000000 	nop
    8:	00000000 	nop
    c:	00000000 	nop
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 7f964ed775f..b21f529e466 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -569,6 +569,8 @@ if { [istarget mips*-*-vxworks*] } {
     set has_newabi [expr [istarget *-*-irix6*] || [istarget mips*-*-linux*] \
                          || [istarget mips*-sde-elf*] || [istarget mips*-mti-elf*] \
                          || [istarget mips*-img-elf*]]
+    set default_n64 [expr [istarget mips*64*-linux-gnuabi64] ]
+
 
     if { [istarget "mips*-*-*linux*"]
 	 || [istarget "mips*-sde-elf*"]
@@ -1462,7 +1464,9 @@ if { [istarget mips*-*-vxworks*] } {
     if { $has_newabi } {
 	run_dump_test_arches "octeon"	[mips_arch_list_matching octeon]
     }
-    run_dump_test_arches "octeon-saa-saad" [mips_arch_list_matching octeonp]
+    if !$default_n64 {
+	run_dump_test_arches "octeon-saa-saad" [mips_arch_list_matching octeonp]
+    }
     run_list_test_arches "octeon-ill"	[mips_arch_list_matching octeon]
     if { $has_newabi } {
 	run_dump_test_arches "octeon-pref" \
@@ -1627,10 +1631,12 @@ if { [istarget mips*-*-vxworks*] } {
     run_dump_test "r5900"
     run_dump_test "r5900-fix"
     run_dump_test "r5900-no-fix"
-    run_dump_test "r5900-full"
-    run_list_test "r5900-nollsc" "-mabi=o64 -march=r5900"
-    run_dump_test "r5900-vu0"
+    if !$default_n64 {
+	run_dump_test "r5900-full"
+	run_dump_test "r5900-vu0"
+    }
     run_dump_test "r5900-full-vu0"
+    run_list_test "r5900-nollsc" "-mabi=o64 -march=r5900"
     run_dump_test "r5900-all-vu0"
     run_list_test "r5900-error-vu0" "-march=r5900"
 
diff --git a/gas/testsuite/gas/mips/mips64-dsp.d b/gas/testsuite/gas/mips/mips64-dsp.d
index b56855dffdd..6eaad3240c7 100644
--- a/gas/testsuite/gas/mips/mips64-dsp.d
+++ b/gas/testsuite/gas/mips/mips64-dsp.d
@@ -15,7 +15,7 @@ Disassembly of section .text:
 0+0014 <[^>]*> 7c851b94 	addq_s\.qh	v1,a0,a1
 0+0018 <[^>]*> 7d4b4814 	addu\.ob	t1,t2,t3
 0+001c <[^>]*> 7d6c5114 	addu_s\.ob	t2,t3,t4
-0+0020 <[^>]*> 041dfff7 	bposge64	00000000 <text_label>
+0+0020 <[^>]*> 041dfff7 	bposge64	0+000000 <text_label>
 0+0024 <[^>]*> 00000000 	nop
 0+0028 <[^>]*> 7e950415 	cmp\.eq\.pw	s4,s5
 0+002c <[^>]*> 7eb60455 	cmp\.lt\.pw	s5,s6
diff --git a/gas/testsuite/gas/mips/pcrel-1.d b/gas/testsuite/gas/mips/pcrel-1.d
index 5c9f655d95a..91128178f29 100644
--- a/gas/testsuite/gas/mips/pcrel-1.d
+++ b/gas/testsuite/gas/mips/pcrel-1.d
@@ -5,10 +5,10 @@
 
 Disassembly of section .text:
 
-00000000 <func>:
+0+000000 <func>:
        0:	3c040001 	lui	a0,0x1
        4:	2484800c 	addiu	a0,a0,-32756
 	...
 
-00008010 <foo>:
+0+008010 <foo>:
 #pass
diff --git a/gas/testsuite/gas/mips/set-arch.d b/gas/testsuite/gas/mips/set-arch.d
index 49f6c19aad5..3ca32857450 100644
--- a/gas/testsuite/gas/mips/set-arch.d
+++ b/gas/testsuite/gas/mips/set-arch.d
@@ -9,363 +9,363 @@
 .*:     file format .*
 
 Disassembly of section \.text:
-00000000 <[^>]*> bc010000 	cache	0x1,0\(zero\)
-00000004 <[^>]*> bc020000 	cache	0x2,0\(zero\)
-00000008 <[^>]*> bc030000 	cache	0x3,0\(zero\)
-0000000c <[^>]*> 0085001c 	dmult	a0,a1
-00000010 <[^>]*> 00a6001d 	dmultu	a1,a2
-00000014 <[^>]*> 00e0300b 	movn	a2,a3,zero
-00000018 <[^>]*> 0100380a 	movz	a3,t0,zero
-0000001c <[^>]*> 0109001e 	ddiv	zero,t0,t1
-00000020 <[^>]*> 012a001f 	ddivu	zero,t1,t2
-00000024 <[^>]*> 016c5005 	.word	0x16c5005
-00000028 <[^>]*> 018d5801 	movt	t3,t4,\$fcc3
-0000002c <[^>]*> 42000020 	wait
-00000030 <[^>]*> bdc40010 	cache	0x4,16\(t6\)
-00000034 <[^>]*> 71ee0010 	.word	0x71ee0010
-00000038 <[^>]*> 42000023 	c0	0x23
-0000003c <[^>]*> 42000021 	c0	0x21
-00000040 <[^>]*> 42000022 	c0	0x22
-00000044 <[^>]*> 70850000 	madd	a0,a1
-00000048 <[^>]*> 70a60001 	maddu	a1,a2
-0000004c <[^>]*> 70e83002 	mul	a2,a3,t0
-00000050 <[^>]*> 4500ffff 	bc1f	00000050 <[^>]*>
-00000054 <[^>]*> 4504fffe 	bc1f	\$fcc1,00000050 <[^>]*>
-00000058 <[^>]*> 4506fffd 	bc1fl	\$fcc1,00000050 <[^>]*>
-0000005c <[^>]*> 4505fffc 	bc1t	\$fcc1,00000050 <[^>]*>
-00000060 <[^>]*> 450bfffb 	bc1tl	\$fcc2,00000050 <[^>]*>
-00000064 <[^>]*> 46262030 	c\.f\.d	\$f4,\$f6
-00000068 <[^>]*> 46262130 	c\.f\.d	\$fcc1,\$f4,\$f6
-0000006c <[^>]*> 4ca40081 	ldxc1	\$f2,a0\(a1\)
-00000070 <[^>]*> 4ca40080 	lwxc1	\$f2,a0\(a1\)
-00000074 <[^>]*> 4c462021 	madd\.d	\$f0,\$f2,\$f4,\$f6
-00000078 <[^>]*> 4c462020 	madd\.s	\$f0,\$f2,\$f4,\$f6
-0000007c <[^>]*> 00b02001 	movf	a0,a1,\$fcc4
-00000080 <[^>]*> 46203111 	movf\.d	\$f4,\$f6,\$fcc0
-00000084 <[^>]*> 46003111 	movf\.s	\$f4,\$f6,\$fcc0
-00000088 <[^>]*> 00c6200b 	movn	a0,a2,a2
-0000008c <[^>]*> 46263113 	movn\.d	\$f4,\$f6,a2
-00000090 <[^>]*> 46063113 	movn\.s	\$f4,\$f6,a2
-00000094 <[^>]*> 00b12001 	movt	a0,a1,\$fcc4
-00000098 <[^>]*> 46213111 	movt\.d	\$f4,\$f6,\$fcc0
-0000009c <[^>]*> 46013111 	movt\.s	\$f4,\$f6,\$fcc0
-000000a0 <[^>]*> 00c6200a 	movz	a0,a2,a2
-000000a4 <[^>]*> 46263112 	movz\.d	\$f4,\$f6,a2
-000000a8 <[^>]*> 46063112 	movz\.s	\$f4,\$f6,a2
-000000ac <[^>]*> 4c462029 	msub\.d	\$f0,\$f2,\$f4,\$f6
-000000b0 <[^>]*> 4c462028 	msub\.s	\$f0,\$f2,\$f4,\$f6
-000000b4 <[^>]*> 4c462031 	nmadd\.d	\$f0,\$f2,\$f4,\$f6
-000000b8 <[^>]*> 4c462030 	nmadd\.s	\$f0,\$f2,\$f4,\$f6
-000000bc <[^>]*> 4c462039 	nmsub\.d	\$f0,\$f2,\$f4,\$f6
-000000c0 <[^>]*> 4c462038 	nmsub\.s	\$f0,\$f2,\$f4,\$f6
-000000c4 <[^>]*> 4ca4200f 	prefx	0x4,a0\(a1\)
-000000c8 <[^>]*> 46203115 	recip\.d	\$f4,\$f6
-000000cc <[^>]*> 46003115 	recip\.s	\$f4,\$f6
-000000d0 <[^>]*> 46203116 	rsqrt\.d	\$f4,\$f6
-000000d4 <[^>]*> 46003116 	rsqrt\.s	\$f4,\$f6
-000000d8 <[^>]*> 4ca42009 	sdxc1	\$f4,a0\(a1\)
-000000dc <[^>]*> 4ca42008 	swxc1	\$f4,a0\(a1\)
-000000e0 <[^>]*> 46c01005 	abs\.ps	\$f0,\$f2
-000000e4 <[^>]*> 46c62080 	add\.ps	\$f2,\$f4,\$f6
-000000e8 <[^>]*> 4c6a419e 	alnv\.ps	\$f6,\$f8,\$f10,v1
-000000ec <[^>]*> 46ca4032 	c\.eq\.ps	\$f8,\$f10
-000000f0 <[^>]*> 46cc5232 	c\.eq\.ps	\$fcc2,\$f10,\$f12
-000000f4 <[^>]*> 46ca4030 	c\.f\.ps	\$f8,\$f10
-000000f8 <[^>]*> 46cc5230 	c\.f\.ps	\$fcc2,\$f10,\$f12
-000000fc <[^>]*> 46ca403e 	c\.le\.ps	\$f8,\$f10
-00000100 <[^>]*> 46cc523e 	c\.le\.ps	\$fcc2,\$f10,\$f12
-00000104 <[^>]*> 46ca403c 	c\.lt\.ps	\$f8,\$f10
-00000108 <[^>]*> 46cc523c 	c\.lt\.ps	\$fcc2,\$f10,\$f12
-0000010c <[^>]*> 46ca403d 	c\.nge\.ps	\$f8,\$f10
-00000110 <[^>]*> 46cc523d 	c\.nge\.ps	\$fcc2,\$f10,\$f12
-00000114 <[^>]*> 46ca403b 	c\.ngl\.ps	\$f8,\$f10
-00000118 <[^>]*> 46cc523b 	c\.ngl\.ps	\$fcc2,\$f10,\$f12
-0000011c <[^>]*> 46ca4039 	c\.ngle\.ps	\$f8,\$f10
-00000120 <[^>]*> 46cc5239 	c\.ngle\.ps	\$fcc2,\$f10,\$f12
-00000124 <[^>]*> 46ca403f 	c\.ngt\.ps	\$f8,\$f10
-00000128 <[^>]*> 46cc523f 	c\.ngt\.ps	\$fcc2,\$f10,\$f12
-0000012c <[^>]*> 46ca4036 	c\.ole\.ps	\$f8,\$f10
-00000130 <[^>]*> 46cc5236 	c\.ole\.ps	\$fcc2,\$f10,\$f12
-00000134 <[^>]*> 46ca4034 	c\.olt\.ps	\$f8,\$f10
-00000138 <[^>]*> 46cc5234 	c\.olt\.ps	\$fcc2,\$f10,\$f12
-0000013c <[^>]*> 46ca403a 	c\.seq\.ps	\$f8,\$f10
-00000140 <[^>]*> 46cc523a 	c\.seq\.ps	\$fcc2,\$f10,\$f12
-00000144 <[^>]*> 46ca4038 	c\.sf\.ps	\$f8,\$f10
-00000148 <[^>]*> 46cc5238 	c\.sf\.ps	\$fcc2,\$f10,\$f12
-0000014c <[^>]*> 46ca4033 	c\.ueq\.ps	\$f8,\$f10
-00000150 <[^>]*> 46cc5233 	c\.ueq\.ps	\$fcc2,\$f10,\$f12
-00000154 <[^>]*> 46ca4037 	c\.ule\.ps	\$f8,\$f10
-00000158 <[^>]*> 46cc5237 	c\.ule\.ps	\$fcc2,\$f10,\$f12
-0000015c <[^>]*> 46ca4035 	c\.ult\.ps	\$f8,\$f10
-00000160 <[^>]*> 46cc5235 	c\.ult\.ps	\$fcc2,\$f10,\$f12
-00000164 <[^>]*> 46ca4031 	c\.un\.ps	\$f8,\$f10
-00000168 <[^>]*> 46cc5231 	c\.un\.ps	\$fcc2,\$f10,\$f12
-0000016c <[^>]*> 46107326 	cvt\.ps\.s	\$f12,\$f14,\$f16
-00000170 <[^>]*> 46c09428 	cvt\.s\.pl	\$f16,\$f18
-00000174 <[^>]*> 46c0a4a0 	cvt\.s\.pu	\$f18,\$f20
-00000178 <[^>]*> 4ca40505 	luxc1	\$f20,a0\(a1\)
-0000017c <[^>]*> 4edac526 	madd\.ps	\$f20,\$f22,\$f24,\$f26
-00000180 <[^>]*> 46c0d606 	mov\.ps	\$f24,\$f26
-00000184 <[^>]*> 46c8e691 	movf\.ps	\$f26,\$f28,\$fcc2
-00000188 <[^>]*> 46c3e693 	movn\.ps	\$f26,\$f28,v1
-0000018c <[^>]*> 46d1f711 	movt\.ps	\$f28,\$f30,\$fcc4
-00000190 <[^>]*> 46c5f712 	movz\.ps	\$f28,\$f30,a1
-00000194 <[^>]*> 4c0417ae 	msub\.ps	\$f30,\$f0,\$f2,\$f4
-00000198 <[^>]*> 46c62082 	mul\.ps	\$f2,\$f4,\$f6
-0000019c <[^>]*> 46c04187 	neg\.ps	\$f6,\$f8
-000001a0 <[^>]*> 4d0c51b6 	nmadd\.ps	\$f6,\$f8,\$f10,\$f12
-000001a4 <[^>]*> 4d0c51be 	nmsub\.ps	\$f6,\$f8,\$f10,\$f12
-000001a8 <[^>]*> 46ce62ac 	pll\.ps	\$f10,\$f12,\$f14
-000001ac <[^>]*> 46d283ad 	plu\.ps	\$f14,\$f16,\$f18
-000001b0 <[^>]*> 46d4942e 	pul\.ps	\$f16,\$f18,\$f20
-000001b4 <[^>]*> 46d8b52f 	puu\.ps	\$f20,\$f22,\$f24
-000001b8 <[^>]*> 46dac581 	sub\.ps	\$f22,\$f24,\$f26
-000001bc <[^>]*> 4ce6d00d 	suxc1	\$f26,a2\(a3\)
-000001c0 <[^>]*> 46cc5332 	c\.eq\.ps	\$fcc3,\$f10,\$f12
-000001c4 <[^>]*> 46cce691 	movf\.ps	\$f26,\$f28,\$fcc3
-000001c8 <[^>]*> 70410821 	clo	at,v0
-000001cc <[^>]*> 70831820 	clz	v1,a0
-000001d0 <[^>]*> 70a60000 	madd	a1,a2
-000001d4 <[^>]*> 70e80001 	maddu	a3,t0
-000001d8 <[^>]*> 712a0004 	msub	t1,t2
-000001dc <[^>]*> 716c0005 	msubu	t3,t4
-000001e0 <[^>]*> 71cf6802 	mul	t5,t6,t7
-000001e4 <[^>]*> ce040000 	pref	0x4,0\(s0\)
-000001e8 <[^>]*> ce247fff 	pref	0x4,32767\(s1\)
-000001ec <[^>]*> ce448000 	pref	0x4,-32768\(s2\)
-000001f0 <[^>]*> 00000040 	ssnop
-000001f4 <[^>]*> 4900ff96 	bc2f	00000050 <[^>]*>
-000001f8 <[^>]*> 00000000 	nop
-000001fc <[^>]*> 4902ff94 	bc2fl	00000050 <[^>]*>
-00000200 <[^>]*> 00000000 	nop
-00000204 <[^>]*> 4901ff92 	bc2t	00000050 <[^>]*>
-00000208 <[^>]*> 00000000 	nop
-0000020c <[^>]*> 4903ff90 	bc2tl	00000050 <[^>]*>
-00000210 <[^>]*> 00000000 	nop
-00000214 <[^>]*> 48411000 	cfc2	at,\$2
-00000218 <[^>]*> 4b234567 	c2	0x1234567
-0000021c <[^>]*> 48c21800 	ctc2	v0,\$3
-00000220 <[^>]*> 48032000 	mfc2	v1,\$4
-00000224 <[^>]*> 48042800 	mfc2	a0,\$5
-00000228 <[^>]*> 48053007 	mfc2	a1,\$6,7
-0000022c <[^>]*> 48863800 	mtc2	a2,\$7
-00000230 <[^>]*> 48874000 	mtc2	a3,\$8
-00000234 <[^>]*> 48884807 	mtc2	t0,\$9,7
-00000238 <[^>]*> bc250000 	cache	0x5,0\(at\)
-0000023c <[^>]*> bc457fff 	cache	0x5,32767\(v0\)
-00000240 <[^>]*> bc658000 	cache	0x5,-32768\(v1\)
-00000244 <[^>]*> 42000018 	eret
-00000248 <[^>]*> 42000008 	tlbp
-0000024c <[^>]*> 42000001 	tlbr
-00000250 <[^>]*> 42000002 	tlbwi
-00000254 <[^>]*> 42000006 	tlbwr
-00000258 <[^>]*> 42000020 	wait
-0000025c <[^>]*> 42000020 	wait
-00000260 <[^>]*> 4359e260 	wait	0x56789
-00000264 <[^>]*> 0000000d 	break
-00000268 <[^>]*> 0000000d 	break
-0000026c <[^>]*> 0345000d 	break	0x345
-00000270 <[^>]*> 0048d14d 	break	0x48,0x345
-00000274 <[^>]*> 7000003f 	sdbbp
-00000278 <[^>]*> 7000003f 	sdbbp
-0000027c <[^>]*> 7159e27f 	sdbbp	0x56789
-00000280 <[^>]*> 000000c0 	ehb
-00000284 <[^>]*> 7ca43980 	.word	0x7ca43980
-00000288 <[^>]*> 7ca46984 	.word	0x7ca46984
-0000028c <[^>]*> 0100fc09 	jalr.hb	t0
-00000290 <[^>]*> 0120a409 	jalr.hb	s4,t1
-00000294 <[^>]*> 01000408 	jr.hb	t0
-00000298 <[^>]*> 7c0a003b 	.word	0x7c0a003b
-0000029c <[^>]*> 7c0b083b 	.word	0x7c0b083b
-000002a0 <[^>]*> 7c0c103b 	.word	0x7c0c103b
-000002a4 <[^>]*> 7c0d183b 	.word	0x7c0d183b
-000002a8 <[^>]*> 7c0e203b 	.word	0x7c0e203b
-000002ac <[^>]*> 7c0f283b 	.word	0x7c0f283b
-000002b0 <[^>]*> 002acf02 	.word	0x2acf02
-000002b4 <[^>]*> 002ac902 	.word	0x2ac902
-000002b8 <[^>]*> 0004c823 	negu	t9,a0
-000002bc <[^>]*> 032ac846 	.word	0x32ac846
-000002c0 <[^>]*> 008ac846 	.word	0x8ac846
-000002c4 <[^>]*> 008ac846 	.word	0x8ac846
-000002c8 <[^>]*> 7c073c20 	.word	0x7c073c20
-000002cc <[^>]*> 7c0a4420 	.word	0x7c0a4420
-000002d0 <[^>]*> 7c073e20 	.word	0x7c073e20
-000002d4 <[^>]*> 7c0a4620 	.word	0x7c0a4620
-000002d8 <[^>]*> 055f5555 	.word	0x55f5555
-000002dc <[^>]*> 7c0738a0 	.word	0x7c0738a0
-000002e0 <[^>]*> 7c0a40a0 	.word	0x7c0a40a0
-000002e4 <[^>]*> 41606000 	.word	0x41606000
-000002e8 <[^>]*> 41606000 	.word	0x41606000
-000002ec <[^>]*> 416a6000 	.word	0x416a6000
-000002f0 <[^>]*> 41606020 	.word	0x41606020
-000002f4 <[^>]*> 41606020 	.word	0x41606020
-000002f8 <[^>]*> 416a6020 	.word	0x416a6020
-000002fc <[^>]*> 41595000 	.word	0x41595000
-00000300 <[^>]*> 41d95000 	.word	0x41d95000
-00000304 <[^>]*> 44710000 	.word	0x44710000
-00000308 <[^>]*> 44f10000 	.word	0x44f10000
-0000030c <[^>]*> 48715555 	.word	0x48715555
-00000310 <[^>]*> 48f15555 	.word	0x48f15555
-00000314 <[^>]*> 70410825 	dclo	at,v0
-00000318 <[^>]*> 70831824 	dclz	v1,a0
-0000031c <[^>]*> 48232000 	dmfc2	v1,\$4
-00000320 <[^>]*> 48242800 	dmfc2	a0,\$5
-00000324 <[^>]*> 48253007 	dmfc2	a1,\$6,7
-00000328 <[^>]*> 48a63800 	dmtc2	a2,\$7
-0000032c <[^>]*> 48a74000 	dmtc2	a3,\$8
-00000330 <[^>]*> 48a84807 	dmtc2	t0,\$9,7
-00000334 <[^>]*> 00850029 	.word	0x850029
-00000338 <[^>]*> 00a60028 	.word	0xa60028
-0000033c <[^>]*> 00002012 	mflo	a0
-00000340 <[^>]*> 00a62029 	.word	0xa62029
-00000344 <[^>]*> 00a62229 	.word	0xa62229
-00000348 <[^>]*> 00a62629 	.word	0xa62629
-0000034c <[^>]*> 00a62269 	.word	0xa62269
-00000350 <[^>]*> 00a62669 	.word	0xa62669
-00000354 <[^>]*> 00a62429 	.word	0xa62429
-00000358 <[^>]*> 00a62069 	.word	0xa62069
-0000035c <[^>]*> 00a62469 	.word	0xa62469
-00000360 <[^>]*> 00002012 	mflo	a0
-00000364 <[^>]*> 00a62028 	.word	0xa62028
-00000368 <[^>]*> 00a62228 	.word	0xa62228
-0000036c <[^>]*> 00a62628 	.word	0xa62628
-00000370 <[^>]*> 00a62268 	.word	0xa62268
-00000374 <[^>]*> 00a62668 	.word	0xa62668
-00000378 <[^>]*> 00a62428 	.word	0xa62428
-0000037c <[^>]*> 00a62068 	.word	0xa62068
-00000380 <[^>]*> 00a62468 	.word	0xa62468
-00000384 <[^>]*> 00a62059 	.word	0xa62059
-00000388 <[^>]*> 00a62258 	.word	0xa62258
-0000038c <[^>]*> 00a62259 	.word	0xa62259
-00000390 <[^>]*> 00a620d8 	.word	0xa620d8
-00000394 <[^>]*> 00a620d9 	.word	0xa620d9
-00000398 <[^>]*> 00a622d8 	.word	0xa622d8
-0000039c <[^>]*> 00a622d9 	.word	0xa622d9
-000003a0 <[^>]*> 00a62158 	.word	0xa62158
-000003a4 <[^>]*> 00a62159 	.word	0xa62159
-000003a8 <[^>]*> 00a62358 	.word	0xa62358
-000003ac <[^>]*> 00a62359 	.word	0xa62359
-000003b0 <[^>]*> 00a621d8 	.word	0xa621d8
-000003b4 <[^>]*> 00a621d9 	.word	0xa621d9
-000003b8 <[^>]*> 00a623d8 	.word	0xa623d8
-000003bc <[^>]*> 00a623d9 	.word	0xa623d9
-000003c0 <[^>]*> 00252642 	.word	0x252642
-000003c4 <[^>]*> 00c52046 	.word	0xc52046
-000003c8 <[^>]*> 0025267a 	.word	0x25267a
-000003cc <[^>]*> 0025267e 	.word	0x25267e
-000003d0 <[^>]*> 0025267e 	.word	0x25267e
-000003d4 <[^>]*> 00c52056 	.word	0xc52056
-000003d8 <[^>]*> 7000003f 	sdbbp
-000003dc <[^>]*> 7000003e 	.word	0x7000003e
-000003e0 <[^>]*> 7003183d 	.word	0x7003183d
-000003e4 <[^>]*> 7083183d 	.word	0x7083183d
-000003e8 <[^>]*> 4004c803 	mfc0	a0,c0_perfcnt,3
-000003ec <[^>]*> 4004c802 	mfc0	a0,c0_perfcnt,2
-000003f0 <[^>]*> 4084c803 	mtc0	a0,c0_perfcnt,3
-000003f4 <[^>]*> 4084c802 	mtc0	a0,c0_perfcnt,2
-000003f8 <[^>]*> 4ac4100b 	c2	0xc4100b
-000003fc <[^>]*> 4886208b 	.word	0x4886208b
-00000400 <[^>]*> 4bcf218b 	c2	0x1cf218b
-00000404 <[^>]*> 4bdf310b 	c2	0x1df310b
-00000408 <[^>]*> 4ac4100c 	c2	0xc4100c
-0000040c <[^>]*> 4886208c 	.word	0x4886208c
-00000410 <[^>]*> 4bcf218c 	c2	0x1cf218c
-00000414 <[^>]*> 4bdf310c 	c2	0x1df310c
-00000418 <[^>]*> 4ac20001 	c2	0xc20001
-0000041c <[^>]*> 48862001 	mtc2	a2,\$4,1
-00000420 <[^>]*> 4bcf3001 	c2	0x1cf3001
-00000424 <[^>]*> 4bdf2001 	c2	0x1df2001
-00000428 <[^>]*> 4ac20005 	c2	0xc20005
-0000042c <[^>]*> 48862005 	mtc2	a2,\$4,5
-00000430 <[^>]*> 4bcf3005 	c2	0x1cf3005
-00000434 <[^>]*> 4bdf2005 	c2	0x1df2005
-00000438 <[^>]*> 4ac20004 	c2	0xc20004
-0000043c <[^>]*> 48862004 	mtc2	a2,\$4,4
-00000440 <[^>]*> 4bcf3004 	c2	0x1cf3004
-00000444 <[^>]*> 4bdf2004 	c2	0x1df2004
-00000448 <[^>]*> 4ac41007 	c2	0xc41007
-0000044c <[^>]*> 48862087 	.word	0x48862087
-00000450 <[^>]*> 4bcf2187 	c2	0x1cf2187
-00000454 <[^>]*> 4bdf3107 	c2	0x1df3107
-00000458 <[^>]*> 4ac41006 	c2	0xc41006
-0000045c <[^>]*> 48862086 	.word	0x48862086
-00000460 <[^>]*> 4bcf2186 	c2	0x1cf2186
-00000464 <[^>]*> 4bdf3106 	c2	0x1df3106
-00000468 <[^>]*> 4ac41030 	c2	0xc41030
-0000046c <[^>]*> 488620b0 	.word	0x488620b0
-00000470 <[^>]*> 4bcf21b0 	c2	0x1cf21b0
-00000474 <[^>]*> 4bdf3130 	c2	0x1df3130
-00000478 <[^>]*> 4ac20033 	c2	0xc20033
-0000047c <[^>]*> 48862033 	.word	0x48862033
-00000480 <[^>]*> 4bcf3033 	c2	0x1cf3033
-00000484 <[^>]*> 4bdf2033 	c2	0x1df2033
-00000488 <[^>]*> 4ac20433 	c2	0xc20433
-0000048c <[^>]*> 48862433 	.word	0x48862433
-00000490 <[^>]*> 4bcf3433 	c2	0x1cf3433
-00000494 <[^>]*> 4bdf2433 	c2	0x1df2433
-00000498 <[^>]*> 4ac20032 	c2	0xc20032
-0000049c <[^>]*> 48862032 	.word	0x48862032
-000004a0 <[^>]*> 4bcf3032 	c2	0x1cf3032
-000004a4 <[^>]*> 4bdf2032 	c2	0x1df2032
-000004a8 <[^>]*> 4ac20432 	c2	0xc20432
-000004ac <[^>]*> 48862432 	.word	0x48862432
-000004b0 <[^>]*> 4bcf3432 	c2	0x1cf3432
-000004b4 <[^>]*> 4bdf2432 	c2	0x1df2432
-000004b8 <[^>]*> 4ac4100f 	c2	0xc4100f
-000004bc <[^>]*> 4886208f 	.word	0x4886208f
-000004c0 <[^>]*> 4bcf218f 	c2	0x1cf218f
-000004c4 <[^>]*> 4bdf310f 	c2	0x1df310f
-000004c8 <[^>]*> 4ac4100e 	c2	0xc4100e
-000004cc <[^>]*> 4886208e 	.word	0x4886208e
-000004d0 <[^>]*> 4bcf218e 	c2	0x1cf218e
-000004d4 <[^>]*> 4bdf310e 	c2	0x1df310e
-000004d8 <[^>]*> 4ac41002 	c2	0xc41002
-000004dc <[^>]*> 48862082 	.word	0x48862082
-000004e0 <[^>]*> 4bcf2182 	c2	0x1cf2182
-000004e4 <[^>]*> 4bdf3102 	c2	0x1df3102
-000004e8 <[^>]*> 4ac41003 	c2	0xc41003
-000004ec <[^>]*> 48862083 	.word	0x48862083
-000004f0 <[^>]*> 4bcf2183 	c2	0x1cf2183
-000004f4 <[^>]*> 4bdf3103 	c2	0x1df3103
-000004f8 <[^>]*> 4ac4100a 	c2	0xc4100a
-000004fc <[^>]*> 4886208a 	.word	0x4886208a
-00000500 <[^>]*> 4bcf218a 	c2	0x1cf218a
-00000504 <[^>]*> 4bdf310a 	c2	0x1df310a
-00000508 <[^>]*> 4ac4100d 	c2	0xc4100d
-0000050c <[^>]*> 4886208d 	.word	0x4886208d
-00000510 <[^>]*> 4bcf218d 	c2	0x1cf218d
-00000514 <[^>]*> 4bdf310d 	c2	0x1df310d
-00000518 <[^>]*> 48a41018 	.word	0x48a41018
-0000051c <[^>]*> 4984101f 	.word	0x4984101f
-00000520 <[^>]*> 49c4101f 	.word	0x49c4101f
-00000524 <[^>]*> 4904101f 	bc2f	\$cc1,000045a4 <[^>]*>
-00000528 <[^>]*> 4944101f 	.word	0x4944101f
-0000052c <[^>]*> 48c62090 	.word	0x48c62090
-00000530 <[^>]*> 4bce3110 	c2	0x1ce3110
-00000534 <[^>]*> 48c62092 	.word	0x48c62092
-00000538 <[^>]*> 4bce3112 	c2	0x1ce3112
-0000053c <[^>]*> 4bcd00a0 	c2	0x1cd00a0
-00000540 <[^>]*> 4a0000bf 	c2	0xbf
-00000544 <[^>]*> 480000bf 	.word	0x480000bf
-00000548 <[^>]*> 490000bf 	bc2f	00000848 <[^>]*>
-0000054c <[^>]*> 4a00103e 	c2	0x103e
-00000550 <[^>]*> 4804103e 	.word	0x4804103e
-00000554 <[^>]*> 00c52046 	.word	0xc52046
-00000558 <[^>]*> 00252442 	.word	0x252442
-0000055c <[^>]*> 00c52056 	.word	0xc52056
-00000560 <[^>]*> 0025207e 	.word	0x25207e
-00000564 <[^>]*> 002520ba 	.word	0x2520ba
-00000568 <[^>]*> 4ca4200f 	prefx	0x4,a0\(a1\)
-0000056c <[^>]*> 42000020 	wait
-00000570 <[^>]*> 42000020 	wait
-00000574 <[^>]*> 4359e260 	wait	0x56789
-00000578 <[^>]*> 00000040 	ssnop
-0000057c <[^>]*> 70831821 	clo	v1,a0
-00000580 <[^>]*> 70831825 	dclo	v1,a0
-00000584 <[^>]*> 70831820 	clz	v1,a0
-00000588 <[^>]*> 70831824 	dclz	v1,a0
-0000058c <[^>]*> 4c440005 	luxc1	\$f0,a0\(v0\)
-00000590 <[^>]*> 4c44100d 	suxc1	\$f2,a0\(v0\)
-00000594 <[^>]*> 42000008 	tlbp
-00000598 <[^>]*> 42000001 	tlbr
+0+000000 <[^>]*> bc010000 	cache	0x1,0\(zero\)
+0+000004 <[^>]*> bc020000 	cache	0x2,0\(zero\)
+0+000008 <[^>]*> bc030000 	cache	0x3,0\(zero\)
+0+00000c <[^>]*> 0085001c 	dmult	a0,a1
+0+000010 <[^>]*> 00a6001d 	dmultu	a1,a2
+0+000014 <[^>]*> 00e0300b 	movn	a2,a3,zero
+0+000018 <[^>]*> 0100380a 	movz	a3,t0,zero
+0+00001c <[^>]*> 0109001e 	ddiv	zero,t0,t1
+0+000020 <[^>]*> 012a001f 	ddivu	zero,t1,t2
+0+000024 <[^>]*> 016c5005 	.word	0x16c5005
+0+000028 <[^>]*> 018d5801 	movt	t3,t4,\$fcc3
+0+00002c <[^>]*> 42000020 	wait
+0+000030 <[^>]*> bdc40010 	cache	0x4,16\(t6\)
+0+000034 <[^>]*> 71ee0010 	.word	0x71ee0010
+0+000038 <[^>]*> 42000023 	c0	0x23
+0+00003c <[^>]*> 42000021 	c0	0x21
+0+000040 <[^>]*> 42000022 	c0	0x22
+0+000044 <[^>]*> 70850000 	madd	a0,a1
+0+000048 <[^>]*> 70a60001 	maddu	a1,a2
+0+00004c <[^>]*> 70e83002 	mul	a2,a3,t0
+0+000050 <[^>]*> 4500ffff 	bc1f	0+000050 <[^>]*>
+0+000054 <[^>]*> 4504fffe 	bc1f	\$fcc1,0+000050 <[^>]*>
+0+000058 <[^>]*> 4506fffd 	bc1fl	\$fcc1,0+000050 <[^>]*>
+0+00005c <[^>]*> 4505fffc 	bc1t	\$fcc1,0+000050 <[^>]*>
+0+000060 <[^>]*> 450bfffb 	bc1tl	\$fcc2,0+000050 <[^>]*>
+0+000064 <[^>]*> 46262030 	c\.f\.d	\$f4,\$f6
+0+000068 <[^>]*> 46262130 	c\.f\.d	\$fcc1,\$f4,\$f6
+0+00006c <[^>]*> 4ca40081 	ldxc1	\$f2,a0\(a1\)
+0+000070 <[^>]*> 4ca40080 	lwxc1	\$f2,a0\(a1\)
+0+000074 <[^>]*> 4c462021 	madd\.d	\$f0,\$f2,\$f4,\$f6
+0+000078 <[^>]*> 4c462020 	madd\.s	\$f0,\$f2,\$f4,\$f6
+0+00007c <[^>]*> 00b02001 	movf	a0,a1,\$fcc4
+0+000080 <[^>]*> 46203111 	movf\.d	\$f4,\$f6,\$fcc0
+0+000084 <[^>]*> 46003111 	movf\.s	\$f4,\$f6,\$fcc0
+0+000088 <[^>]*> 00c6200b 	movn	a0,a2,a2
+0+00008c <[^>]*> 46263113 	movn\.d	\$f4,\$f6,a2
+0+000090 <[^>]*> 46063113 	movn\.s	\$f4,\$f6,a2
+0+000094 <[^>]*> 00b12001 	movt	a0,a1,\$fcc4
+0+000098 <[^>]*> 46213111 	movt\.d	\$f4,\$f6,\$fcc0
+0+00009c <[^>]*> 46013111 	movt\.s	\$f4,\$f6,\$fcc0
+0+0000a0 <[^>]*> 00c6200a 	movz	a0,a2,a2
+0+0000a4 <[^>]*> 46263112 	movz\.d	\$f4,\$f6,a2
+0+0000a8 <[^>]*> 46063112 	movz\.s	\$f4,\$f6,a2
+0+0000ac <[^>]*> 4c462029 	msub\.d	\$f0,\$f2,\$f4,\$f6
+0+0000b0 <[^>]*> 4c462028 	msub\.s	\$f0,\$f2,\$f4,\$f6
+0+0000b4 <[^>]*> 4c462031 	nmadd\.d	\$f0,\$f2,\$f4,\$f6
+0+0000b8 <[^>]*> 4c462030 	nmadd\.s	\$f0,\$f2,\$f4,\$f6
+0+0000bc <[^>]*> 4c462039 	nmsub\.d	\$f0,\$f2,\$f4,\$f6
+0+0000c0 <[^>]*> 4c462038 	nmsub\.s	\$f0,\$f2,\$f4,\$f6
+0+0000c4 <[^>]*> 4ca4200f 	prefx	0x4,a0\(a1\)
+0+0000c8 <[^>]*> 46203115 	recip\.d	\$f4,\$f6
+0+0000cc <[^>]*> 46003115 	recip\.s	\$f4,\$f6
+0+0000d0 <[^>]*> 46203116 	rsqrt\.d	\$f4,\$f6
+0+0000d4 <[^>]*> 46003116 	rsqrt\.s	\$f4,\$f6
+0+0000d8 <[^>]*> 4ca42009 	sdxc1	\$f4,a0\(a1\)
+0+0000dc <[^>]*> 4ca42008 	swxc1	\$f4,a0\(a1\)
+0+0000e0 <[^>]*> 46c01005 	abs\.ps	\$f0,\$f2
+0+0000e4 <[^>]*> 46c62080 	add\.ps	\$f2,\$f4,\$f6
+0+0000e8 <[^>]*> 4c6a419e 	alnv\.ps	\$f6,\$f8,\$f10,v1
+0+0000ec <[^>]*> 46ca4032 	c\.eq\.ps	\$f8,\$f10
+0+0000f0 <[^>]*> 46cc5232 	c\.eq\.ps	\$fcc2,\$f10,\$f12
+0+0000f4 <[^>]*> 46ca4030 	c\.f\.ps	\$f8,\$f10
+0+0000f8 <[^>]*> 46cc5230 	c\.f\.ps	\$fcc2,\$f10,\$f12
+0+0000fc <[^>]*> 46ca403e 	c\.le\.ps	\$f8,\$f10
+0+000100 <[^>]*> 46cc523e 	c\.le\.ps	\$fcc2,\$f10,\$f12
+0+000104 <[^>]*> 46ca403c 	c\.lt\.ps	\$f8,\$f10
+0+000108 <[^>]*> 46cc523c 	c\.lt\.ps	\$fcc2,\$f10,\$f12
+0+00010c <[^>]*> 46ca403d 	c\.nge\.ps	\$f8,\$f10
+0+000110 <[^>]*> 46cc523d 	c\.nge\.ps	\$fcc2,\$f10,\$f12
+0+000114 <[^>]*> 46ca403b 	c\.ngl\.ps	\$f8,\$f10
+0+000118 <[^>]*> 46cc523b 	c\.ngl\.ps	\$fcc2,\$f10,\$f12
+0+00011c <[^>]*> 46ca4039 	c\.ngle\.ps	\$f8,\$f10
+0+000120 <[^>]*> 46cc5239 	c\.ngle\.ps	\$fcc2,\$f10,\$f12
+0+000124 <[^>]*> 46ca403f 	c\.ngt\.ps	\$f8,\$f10
+0+000128 <[^>]*> 46cc523f 	c\.ngt\.ps	\$fcc2,\$f10,\$f12
+0+00012c <[^>]*> 46ca4036 	c\.ole\.ps	\$f8,\$f10
+0+000130 <[^>]*> 46cc5236 	c\.ole\.ps	\$fcc2,\$f10,\$f12
+0+000134 <[^>]*> 46ca4034 	c\.olt\.ps	\$f8,\$f10
+0+000138 <[^>]*> 46cc5234 	c\.olt\.ps	\$fcc2,\$f10,\$f12
+0+00013c <[^>]*> 46ca403a 	c\.seq\.ps	\$f8,\$f10
+0+000140 <[^>]*> 46cc523a 	c\.seq\.ps	\$fcc2,\$f10,\$f12
+0+000144 <[^>]*> 46ca4038 	c\.sf\.ps	\$f8,\$f10
+0+000148 <[^>]*> 46cc5238 	c\.sf\.ps	\$fcc2,\$f10,\$f12
+0+00014c <[^>]*> 46ca4033 	c\.ueq\.ps	\$f8,\$f10
+0+000150 <[^>]*> 46cc5233 	c\.ueq\.ps	\$fcc2,\$f10,\$f12
+0+000154 <[^>]*> 46ca4037 	c\.ule\.ps	\$f8,\$f10
+0+000158 <[^>]*> 46cc5237 	c\.ule\.ps	\$fcc2,\$f10,\$f12
+0+00015c <[^>]*> 46ca4035 	c\.ult\.ps	\$f8,\$f10
+0+000160 <[^>]*> 46cc5235 	c\.ult\.ps	\$fcc2,\$f10,\$f12
+0+000164 <[^>]*> 46ca4031 	c\.un\.ps	\$f8,\$f10
+0+000168 <[^>]*> 46cc5231 	c\.un\.ps	\$fcc2,\$f10,\$f12
+0+00016c <[^>]*> 46107326 	cvt\.ps\.s	\$f12,\$f14,\$f16
+0+000170 <[^>]*> 46c09428 	cvt\.s\.pl	\$f16,\$f18
+0+000174 <[^>]*> 46c0a4a0 	cvt\.s\.pu	\$f18,\$f20
+0+000178 <[^>]*> 4ca40505 	luxc1	\$f20,a0\(a1\)
+0+00017c <[^>]*> 4edac526 	madd\.ps	\$f20,\$f22,\$f24,\$f26
+0+000180 <[^>]*> 46c0d606 	mov\.ps	\$f24,\$f26
+0+000184 <[^>]*> 46c8e691 	movf\.ps	\$f26,\$f28,\$fcc2
+0+000188 <[^>]*> 46c3e693 	movn\.ps	\$f26,\$f28,v1
+0+00018c <[^>]*> 46d1f711 	movt\.ps	\$f28,\$f30,\$fcc4
+0+000190 <[^>]*> 46c5f712 	movz\.ps	\$f28,\$f30,a1
+0+000194 <[^>]*> 4c0417ae 	msub\.ps	\$f30,\$f0,\$f2,\$f4
+0+000198 <[^>]*> 46c62082 	mul\.ps	\$f2,\$f4,\$f6
+0+00019c <[^>]*> 46c04187 	neg\.ps	\$f6,\$f8
+0+0001a0 <[^>]*> 4d0c51b6 	nmadd\.ps	\$f6,\$f8,\$f10,\$f12
+0+0001a4 <[^>]*> 4d0c51be 	nmsub\.ps	\$f6,\$f8,\$f10,\$f12
+0+0001a8 <[^>]*> 46ce62ac 	pll\.ps	\$f10,\$f12,\$f14
+0+0001ac <[^>]*> 46d283ad 	plu\.ps	\$f14,\$f16,\$f18
+0+0001b0 <[^>]*> 46d4942e 	pul\.ps	\$f16,\$f18,\$f20
+0+0001b4 <[^>]*> 46d8b52f 	puu\.ps	\$f20,\$f22,\$f24
+0+0001b8 <[^>]*> 46dac581 	sub\.ps	\$f22,\$f24,\$f26
+0+0001bc <[^>]*> 4ce6d00d 	suxc1	\$f26,a2\(a3\)
+0+0001c0 <[^>]*> 46cc5332 	c\.eq\.ps	\$fcc3,\$f10,\$f12
+0+0001c4 <[^>]*> 46cce691 	movf\.ps	\$f26,\$f28,\$fcc3
+0+0001c8 <[^>]*> 70410821 	clo	at,v0
+0+0001cc <[^>]*> 70831820 	clz	v1,a0
+0+0001d0 <[^>]*> 70a60000 	madd	a1,a2
+0+0001d4 <[^>]*> 70e80001 	maddu	a3,t0
+0+0001d8 <[^>]*> 712a0004 	msub	t1,t2
+0+0001dc <[^>]*> 716c0005 	msubu	t3,t4
+0+0001e0 <[^>]*> 71cf6802 	mul	t5,t6,t7
+0+0001e4 <[^>]*> ce040000 	pref	0x4,0\(s0\)
+0+0001e8 <[^>]*> ce247fff 	pref	0x4,32767\(s1\)
+0+0001ec <[^>]*> ce448000 	pref	0x4,-32768\(s2\)
+0+0001f0 <[^>]*> 00000040 	ssnop
+0+0001f4 <[^>]*> 4900ff96 	bc2f	0+000050 <[^>]*>
+0+0001f8 <[^>]*> 00000000 	nop
+0+0001fc <[^>]*> 4902ff94 	bc2fl	0+000050 <[^>]*>
+0+000200 <[^>]*> 00000000 	nop
+0+000204 <[^>]*> 4901ff92 	bc2t	0+000050 <[^>]*>
+0+000208 <[^>]*> 00000000 	nop
+0+00020c <[^>]*> 4903ff90 	bc2tl	0+000050 <[^>]*>
+0+000210 <[^>]*> 00000000 	nop
+0+000214 <[^>]*> 48411000 	cfc2	at,\$2
+0+000218 <[^>]*> 4b234567 	c2	0x1234567
+0+00021c <[^>]*> 48c21800 	ctc2	v0,\$3
+0+000220 <[^>]*> 48032000 	mfc2	v1,\$4
+0+000224 <[^>]*> 48042800 	mfc2	a0,\$5
+0+000228 <[^>]*> 48053007 	mfc2	a1,\$6,7
+0+00022c <[^>]*> 48863800 	mtc2	a2,\$7
+0+000230 <[^>]*> 48874000 	mtc2	a3,\$8
+0+000234 <[^>]*> 48884807 	mtc2	t0,\$9,7
+0+000238 <[^>]*> bc250000 	cache	0x5,0\(at\)
+0+00023c <[^>]*> bc457fff 	cache	0x5,32767\(v0\)
+0+000240 <[^>]*> bc658000 	cache	0x5,-32768\(v1\)
+0+000244 <[^>]*> 42000018 	eret
+0+000248 <[^>]*> 42000008 	tlbp
+0+00024c <[^>]*> 42000001 	tlbr
+0+000250 <[^>]*> 42000002 	tlbwi
+0+000254 <[^>]*> 42000006 	tlbwr
+0+000258 <[^>]*> 42000020 	wait
+0+00025c <[^>]*> 42000020 	wait
+0+000260 <[^>]*> 4359e260 	wait	0x56789
+0+000264 <[^>]*> 0000000d 	break
+0+000268 <[^>]*> 0000000d 	break
+0+00026c <[^>]*> 0345000d 	break	0x345
+0+000270 <[^>]*> 0048d14d 	break	0x48,0x345
+0+000274 <[^>]*> 7000003f 	sdbbp
+0+000278 <[^>]*> 7000003f 	sdbbp
+0+00027c <[^>]*> 7159e27f 	sdbbp	0x56789
+0+000280 <[^>]*> 000000c0 	ehb
+0+000284 <[^>]*> 7ca43980 	.word	0x7ca43980
+0+000288 <[^>]*> 7ca46984 	.word	0x7ca46984
+0+00028c <[^>]*> 0100fc09 	jalr.hb	t0
+0+000290 <[^>]*> 0120a409 	jalr.hb	s4,t1
+0+000294 <[^>]*> 01000408 	jr.hb	t0
+0+000298 <[^>]*> 7c0a003b 	.word	0x7c0a003b
+0+00029c <[^>]*> 7c0b083b 	.word	0x7c0b083b
+0+0002a0 <[^>]*> 7c0c103b 	.word	0x7c0c103b
+0+0002a4 <[^>]*> 7c0d183b 	.word	0x7c0d183b
+0+0002a8 <[^>]*> 7c0e203b 	.word	0x7c0e203b
+0+0002ac <[^>]*> 7c0f283b 	.word	0x7c0f283b
+0+0002b0 <[^>]*> 002acf02 	.word	0x2acf02
+0+0002b4 <[^>]*> 002ac902 	.word	0x2ac902
+0+0002b8 <[^>]*> 0004c823 	negu	t9,a0
+0+0002bc <[^>]*> 032ac846 	.word	0x32ac846
+0+0002c0 <[^>]*> 008ac846 	.word	0x8ac846
+0+0002c4 <[^>]*> 008ac846 	.word	0x8ac846
+0+0002c8 <[^>]*> 7c073c20 	.word	0x7c073c20
+0+0002cc <[^>]*> 7c0a4420 	.word	0x7c0a4420
+0+0002d0 <[^>]*> 7c073e20 	.word	0x7c073e20
+0+0002d4 <[^>]*> 7c0a4620 	.word	0x7c0a4620
+0+0002d8 <[^>]*> 055f5555 	.word	0x55f5555
+0+0002dc <[^>]*> 7c0738a0 	.word	0x7c0738a0
+0+0002e0 <[^>]*> 7c0a40a0 	.word	0x7c0a40a0
+0+0002e4 <[^>]*> 41606000 	.word	0x41606000
+0+0002e8 <[^>]*> 41606000 	.word	0x41606000
+0+0002ec <[^>]*> 416a6000 	.word	0x416a6000
+0+0002f0 <[^>]*> 41606020 	.word	0x41606020
+0+0002f4 <[^>]*> 41606020 	.word	0x41606020
+0+0002f8 <[^>]*> 416a6020 	.word	0x416a6020
+0+0002fc <[^>]*> 41595000 	.word	0x41595000
+0+000300 <[^>]*> 41d95000 	.word	0x41d95000
+0+000304 <[^>]*> 44710000 	.word	0x44710000
+0+000308 <[^>]*> 44f10000 	.word	0x44f10000
+0+00030c <[^>]*> 48715555 	.word	0x48715555
+0+000310 <[^>]*> 48f15555 	.word	0x48f15555
+0+000314 <[^>]*> 70410825 	dclo	at,v0
+0+000318 <[^>]*> 70831824 	dclz	v1,a0
+0+00031c <[^>]*> 48232000 	dmfc2	v1,\$4
+0+000320 <[^>]*> 48242800 	dmfc2	a0,\$5
+0+000324 <[^>]*> 48253007 	dmfc2	a1,\$6,7
+0+000328 <[^>]*> 48a63800 	dmtc2	a2,\$7
+0+00032c <[^>]*> 48a74000 	dmtc2	a3,\$8
+0+000330 <[^>]*> 48a84807 	dmtc2	t0,\$9,7
+0+000334 <[^>]*> 00850029 	.word	0x850029
+0+000338 <[^>]*> 00a60028 	.word	0xa60028
+0+00033c <[^>]*> 00002012 	mflo	a0
+0+000340 <[^>]*> 00a62029 	.word	0xa62029
+0+000344 <[^>]*> 00a62229 	.word	0xa62229
+0+000348 <[^>]*> 00a62629 	.word	0xa62629
+0+00034c <[^>]*> 00a62269 	.word	0xa62269
+0+000350 <[^>]*> 00a62669 	.word	0xa62669
+0+000354 <[^>]*> 00a62429 	.word	0xa62429
+0+000358 <[^>]*> 00a62069 	.word	0xa62069
+0+00035c <[^>]*> 00a62469 	.word	0xa62469
+0+000360 <[^>]*> 00002012 	mflo	a0
+0+000364 <[^>]*> 00a62028 	.word	0xa62028
+0+000368 <[^>]*> 00a62228 	.word	0xa62228
+0+00036c <[^>]*> 00a62628 	.word	0xa62628
+0+000370 <[^>]*> 00a62268 	.word	0xa62268
+0+000374 <[^>]*> 00a62668 	.word	0xa62668
+0+000378 <[^>]*> 00a62428 	.word	0xa62428
+0+00037c <[^>]*> 00a62068 	.word	0xa62068
+0+000380 <[^>]*> 00a62468 	.word	0xa62468
+0+000384 <[^>]*> 00a62059 	.word	0xa62059
+0+000388 <[^>]*> 00a62258 	.word	0xa62258
+0+00038c <[^>]*> 00a62259 	.word	0xa62259
+0+000390 <[^>]*> 00a620d8 	.word	0xa620d8
+0+000394 <[^>]*> 00a620d9 	.word	0xa620d9
+0+000398 <[^>]*> 00a622d8 	.word	0xa622d8
+0+00039c <[^>]*> 00a622d9 	.word	0xa622d9
+0+0003a0 <[^>]*> 00a62158 	.word	0xa62158
+0+0003a4 <[^>]*> 00a62159 	.word	0xa62159
+0+0003a8 <[^>]*> 00a62358 	.word	0xa62358
+0+0003ac <[^>]*> 00a62359 	.word	0xa62359
+0+0003b0 <[^>]*> 00a621d8 	.word	0xa621d8
+0+0003b4 <[^>]*> 00a621d9 	.word	0xa621d9
+0+0003b8 <[^>]*> 00a623d8 	.word	0xa623d8
+0+0003bc <[^>]*> 00a623d9 	.word	0xa623d9
+0+0003c0 <[^>]*> 00252642 	.word	0x252642
+0+0003c4 <[^>]*> 00c52046 	.word	0xc52046
+0+0003c8 <[^>]*> 0025267a 	.word	0x25267a
+0+0003cc <[^>]*> 0025267e 	.word	0x25267e
+0+0003d0 <[^>]*> 0025267e 	.word	0x25267e
+0+0003d4 <[^>]*> 00c52056 	.word	0xc52056
+0+0003d8 <[^>]*> 7000003f 	sdbbp
+0+0003dc <[^>]*> 7000003e 	.word	0x7000003e
+0+0003e0 <[^>]*> 7003183d 	.word	0x7003183d
+0+0003e4 <[^>]*> 7083183d 	.word	0x7083183d
+0+0003e8 <[^>]*> 4004c803 	mfc0	a0,c0_perfcnt,3
+0+0003ec <[^>]*> 4004c802 	mfc0	a0,c0_perfcnt,2
+0+0003f0 <[^>]*> 4084c803 	mtc0	a0,c0_perfcnt,3
+0+0003f4 <[^>]*> 4084c802 	mtc0	a0,c0_perfcnt,2
+0+0003f8 <[^>]*> 4ac4100b 	c2	0xc4100b
+0+0003fc <[^>]*> 4886208b 	.word	0x4886208b
+0+000400 <[^>]*> 4bcf218b 	c2	0x1cf218b
+0+000404 <[^>]*> 4bdf310b 	c2	0x1df310b
+0+000408 <[^>]*> 4ac4100c 	c2	0xc4100c
+0+00040c <[^>]*> 4886208c 	.word	0x4886208c
+0+000410 <[^>]*> 4bcf218c 	c2	0x1cf218c
+0+000414 <[^>]*> 4bdf310c 	c2	0x1df310c
+0+000418 <[^>]*> 4ac20001 	c2	0xc20001
+0+00041c <[^>]*> 48862001 	mtc2	a2,\$4,1
+0+000420 <[^>]*> 4bcf3001 	c2	0x1cf3001
+0+000424 <[^>]*> 4bdf2001 	c2	0x1df2001
+0+000428 <[^>]*> 4ac20005 	c2	0xc20005
+0+00042c <[^>]*> 48862005 	mtc2	a2,\$4,5
+0+000430 <[^>]*> 4bcf3005 	c2	0x1cf3005
+0+000434 <[^>]*> 4bdf2005 	c2	0x1df2005
+0+000438 <[^>]*> 4ac20004 	c2	0xc20004
+0+00043c <[^>]*> 48862004 	mtc2	a2,\$4,4
+0+000440 <[^>]*> 4bcf3004 	c2	0x1cf3004
+0+000444 <[^>]*> 4bdf2004 	c2	0x1df2004
+0+000448 <[^>]*> 4ac41007 	c2	0xc41007
+0+00044c <[^>]*> 48862087 	.word	0x48862087
+0+000450 <[^>]*> 4bcf2187 	c2	0x1cf2187
+0+000454 <[^>]*> 4bdf3107 	c2	0x1df3107
+0+000458 <[^>]*> 4ac41006 	c2	0xc41006
+0+00045c <[^>]*> 48862086 	.word	0x48862086
+0+000460 <[^>]*> 4bcf2186 	c2	0x1cf2186
+0+000464 <[^>]*> 4bdf3106 	c2	0x1df3106
+0+000468 <[^>]*> 4ac41030 	c2	0xc41030
+0+00046c <[^>]*> 488620b0 	.word	0x488620b0
+0+000470 <[^>]*> 4bcf21b0 	c2	0x1cf21b0
+0+000474 <[^>]*> 4bdf3130 	c2	0x1df3130
+0+000478 <[^>]*> 4ac20033 	c2	0xc20033
+0+00047c <[^>]*> 48862033 	.word	0x48862033
+0+000480 <[^>]*> 4bcf3033 	c2	0x1cf3033
+0+000484 <[^>]*> 4bdf2033 	c2	0x1df2033
+0+000488 <[^>]*> 4ac20433 	c2	0xc20433
+0+00048c <[^>]*> 48862433 	.word	0x48862433
+0+000490 <[^>]*> 4bcf3433 	c2	0x1cf3433
+0+000494 <[^>]*> 4bdf2433 	c2	0x1df2433
+0+000498 <[^>]*> 4ac20032 	c2	0xc20032
+0+00049c <[^>]*> 48862032 	.word	0x48862032
+0+0004a0 <[^>]*> 4bcf3032 	c2	0x1cf3032
+0+0004a4 <[^>]*> 4bdf2032 	c2	0x1df2032
+0+0004a8 <[^>]*> 4ac20432 	c2	0xc20432
+0+0004ac <[^>]*> 48862432 	.word	0x48862432
+0+0004b0 <[^>]*> 4bcf3432 	c2	0x1cf3432
+0+0004b4 <[^>]*> 4bdf2432 	c2	0x1df2432
+0+0004b8 <[^>]*> 4ac4100f 	c2	0xc4100f
+0+0004bc <[^>]*> 4886208f 	.word	0x4886208f
+0+0004c0 <[^>]*> 4bcf218f 	c2	0x1cf218f
+0+0004c4 <[^>]*> 4bdf310f 	c2	0x1df310f
+0+0004c8 <[^>]*> 4ac4100e 	c2	0xc4100e
+0+0004cc <[^>]*> 4886208e 	.word	0x4886208e
+0+0004d0 <[^>]*> 4bcf218e 	c2	0x1cf218e
+0+0004d4 <[^>]*> 4bdf310e 	c2	0x1df310e
+0+0004d8 <[^>]*> 4ac41002 	c2	0xc41002
+0+0004dc <[^>]*> 48862082 	.word	0x48862082
+0+0004e0 <[^>]*> 4bcf2182 	c2	0x1cf2182
+0+0004e4 <[^>]*> 4bdf3102 	c2	0x1df3102
+0+0004e8 <[^>]*> 4ac41003 	c2	0xc41003
+0+0004ec <[^>]*> 48862083 	.word	0x48862083
+0+0004f0 <[^>]*> 4bcf2183 	c2	0x1cf2183
+0+0004f4 <[^>]*> 4bdf3103 	c2	0x1df3103
+0+0004f8 <[^>]*> 4ac4100a 	c2	0xc4100a
+0+0004fc <[^>]*> 4886208a 	.word	0x4886208a
+0+000500 <[^>]*> 4bcf218a 	c2	0x1cf218a
+0+000504 <[^>]*> 4bdf310a 	c2	0x1df310a
+0+000508 <[^>]*> 4ac4100d 	c2	0xc4100d
+0+00050c <[^>]*> 4886208d 	.word	0x4886208d
+0+000510 <[^>]*> 4bcf218d 	c2	0x1cf218d
+0+000514 <[^>]*> 4bdf310d 	c2	0x1df310d
+0+000518 <[^>]*> 48a41018 	.word	0x48a41018
+0+00051c <[^>]*> 4984101f 	.word	0x4984101f
+0+000520 <[^>]*> 49c4101f 	.word	0x49c4101f
+0+000524 <[^>]*> 4904101f 	bc2f	\$cc1,0+0045a4 <[^>]*>
+0+000528 <[^>]*> 4944101f 	.word	0x4944101f
+0+00052c <[^>]*> 48c62090 	.word	0x48c62090
+0+000530 <[^>]*> 4bce3110 	c2	0x1ce3110
+0+000534 <[^>]*> 48c62092 	.word	0x48c62092
+0+000538 <[^>]*> 4bce3112 	c2	0x1ce3112
+0+00053c <[^>]*> 4bcd00a0 	c2	0x1cd00a0
+0+000540 <[^>]*> 4a0000bf 	c2	0xbf
+0+000544 <[^>]*> 480000bf 	.word	0x480000bf
+0+000548 <[^>]*> 490000bf 	bc2f	0+000848 <[^>]*>
+0+00054c <[^>]*> 4a00103e 	c2	0x103e
+0+000550 <[^>]*> 4804103e 	.word	0x4804103e
+0+000554 <[^>]*> 00c52046 	.word	0xc52046
+0+000558 <[^>]*> 00252442 	.word	0x252442
+0+00055c <[^>]*> 00c52056 	.word	0xc52056
+0+000560 <[^>]*> 0025207e 	.word	0x25207e
+0+000564 <[^>]*> 002520ba 	.word	0x2520ba
+0+000568 <[^>]*> 4ca4200f 	prefx	0x4,a0\(a1\)
+0+00056c <[^>]*> 42000020 	wait
+0+000570 <[^>]*> 42000020 	wait
+0+000574 <[^>]*> 4359e260 	wait	0x56789
+0+000578 <[^>]*> 00000040 	ssnop
+0+00057c <[^>]*> 70831821 	clo	v1,a0
+0+000580 <[^>]*> 70831825 	dclo	v1,a0
+0+000584 <[^>]*> 70831820 	clz	v1,a0
+0+000588 <[^>]*> 70831824 	dclz	v1,a0
+0+00058c <[^>]*> 4c440005 	luxc1	\$f0,a0\(v0\)
+0+000590 <[^>]*> 4c44100d 	suxc1	\$f2,a0\(v0\)
+0+000594 <[^>]*> 42000008 	tlbp
+0+000598 <[^>]*> 42000001 	tlbr
 	\.\.\.
diff --git a/ld/testsuite/ld-elf/eh5.d b/ld/testsuite/ld-elf/eh5.d
index 4a697482355..3f3fd2d0354 100644
--- a/ld/testsuite/ld-elf/eh5.d
+++ b/ld/testsuite/ld-elf/eh5.d
@@ -14,7 +14,7 @@ Contents of the .eh_frame section:
   Code alignment factor: .*
   Data alignment factor: .*
   Return address column: .*
-  Augmentation data:     (0b|1b)
+  Augmentation data:     (0b|0c|1b)
 
   DW_CFA_nop
   DW_CFA_nop
@@ -24,44 +24,44 @@ Contents of the .eh_frame section:
 #?  DW_CFA_nop
 #?  DW_CFA_nop
 
-0+001[48] 0+0014 0+001[8c] FDE cie=0+0000 pc=.*
+0+001[48] 0+001[4c] 0+001[8c] FDE cie=0+0000 pc=.*
   DW_CFA_advance_loc: 4 to .*
   DW_CFA_def_cfa: r0(.*) ofs 16
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+00(2c|30) 0+0014 0+0000 CIE
+0+00(2c|30|38) 0+0014 0+0000 CIE
   Version:               [13]
   Augmentation:          "zPR"
   Code alignment factor: .*
   Data alignment factor: .*
   Return address column: .*
-  Augmentation data:     03 .. .. .. .. (0b|1b)
+  Augmentation data:     03 .. .. .. .. (0b|0c|1b)
 
   DW_CFA_nop
 
-0+004[48] 0+0014 0+001c FDE cie=0+00(2c|30) pc=.*
+0+00(44|48|50) 0+001[4c] 0+001c FDE cie=0+00(2c|30|38) pc=.*
   DW_CFA_advance_loc: 4 to .*
   DW_CFA_def_cfa: r0(.*) ofs 16
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+00(5c|60) 0+0014 0+006[04] FDE cie=0+0000 pc=.*
+0+00(5c|60|70) 0+001[4c] 0+00(60|64|74) FDE cie=0+0000 pc=.*
   DW_CFA_advance_loc: 4 to .*
   DW_CFA_def_cfa: r0(.*) ofs 16
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+007[48] 0+001[8c] 0+0000 CIE
+0+00(74|78|90) 0+001[8c] 0+0000 CIE
   Version:               [13]
   Augmentation:          "zPLR"
   Code alignment factor: .*
   Data alignment factor: .*
   Return address column: .*
-  Augmentation data:     03 .. .. .. .. 0c (0b|1b)
+  Augmentation data:     03 .. .. .. .. 0c (0b|0c|1b)
 
   DW_CFA_nop
   DW_CFA_nop
@@ -71,7 +71,7 @@ Contents of the .eh_frame section:
 #?  DW_CFA_nop
 #?  DW_CFA_nop
 
-0+009[08] 0+001c 0+002[04] FDE cie=0+007[48] pc=.*
+0+00(90|98|b0) 0+00(1c|24) 0+002[04] FDE cie=0+00(74|78|90) pc=.*
   Augmentation data:     (ef be ad de 00 00 00 00|00 00 00 00 de ad be ef)
 
   DW_CFA_advance_loc: 4 to .*
@@ -80,13 +80,13 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+00b[08] 0+001[04] 0+0000 CIE
+0+00(b0|b8|d8) 0+001[04] 0+0000 CIE
   Version:               [13]
   Augmentation:          "zR"
   Code alignment factor: .*
   Data alignment factor: .*
   Return address column: .*
-  Augmentation data:     (0b|1b)
+  Augmentation data:     (0b|0c|1b)
 
   DW_CFA_def_cfa: r0(.*) ofs 16
 #?  DW_CFA_nop
@@ -94,7 +94,7 @@ Contents of the .eh_frame section:
 #?  DW_CFA_nop
 #?  DW_CFA_nop
 
-0+00(c4|d0) 0+001[04] 0+001[8c] FDE cie=0+00b[08] pc=.*
+0+00(c4|d0|f0) 0+001[048] 0+001[8c] FDE cie=0+00(b0|b8|d8) pc=.*
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
@@ -103,24 +103,28 @@ Contents of the .eh_frame section:
 #?  DW_CFA_nop
 #?  DW_CFA_nop
 
-0+00[de]8 0+0014 0+0000 CIE
+0+0(0d8|0e8|10c) 0+001[48] 0+0000 CIE
   Version:               [13]
   Augmentation:          "zPR"
   Code alignment factor: .*
   Data alignment factor: .*
   Return address column: .*
-  Augmentation data:     03 .. .. .. .. (0b|1b)
+  Augmentation data:     03 .. .. .. .. (0b|0c|1b)
 
   DW_CFA_nop
+#?  DW_CFA_nop
+#?  DW_CFA_nop
+#?  DW_CFA_nop
+#?  DW_CFA_nop
 
-0+0(0f|10)0 0+0014 0+001c FDE cie=0+00[de]8 pc=.*
+0+0(0f0|100|128) 0+001[4c] 0+00(1c|20) FDE cie=0+0(0d8|0e8|10c) pc=.*
   DW_CFA_advance_loc: 4 to .*
   DW_CFA_def_cfa: r0(.*) ofs 16
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+01[01]8 0+001[04] 0+00(5c|64) FDE cie=0+00b[08] pc=.*
+0+01[014]8 0+001[048] 0+00(5c|64|74) FDE cie=0+00(b0|b8|d8) pc=.*
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
@@ -129,13 +133,13 @@ Contents of the .eh_frame section:
 #?  DW_CFA_nop
 #?  DW_CFA_nop
 
-0+01(1c|30) 0+001[8c] 0+0000 CIE
+0+0(11c|130|164) 0+001[8c] 0+0000 CIE
   Version:               [13]
   Augmentation:          "zPLR"
   Code alignment factor: .*
   Data alignment factor: .*
   Return address column: .*
-  Augmentation data:     03 .. .. .. .. 0c (0b|1b)
+  Augmentation data:     03 .. .. .. .. 0c (0b|0c|1b)
 
   DW_CFA_nop
   DW_CFA_nop
@@ -145,7 +149,7 @@ Contents of the .eh_frame section:
 #?  DW_CFA_nop
 #?  DW_CFA_nop
 
-0+01(38|50) 0+001c 0+002[04] FDE cie=0+01(1c|30) pc=.*
+0+01(38|50|80) 0+00(1c|24|2c) 0+002[04] FDE cie=0+01(1c|30|64) pc=.*
   Augmentation data:     (ef be ad de 00 00 00 00|00 00 00 00 de ad be ef)
 
   DW_CFA_advance_loc: 4 to .*
@@ -154,7 +158,7 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+01(58|70) 0+0014 0+01(5c|74) FDE cie=0+0000 pc=.*
+0+01(58|70|a8) 0+001[4c] 0+01(5c|74|ac) FDE cie=0+0000 pc=.*
   DW_CFA_advance_loc: 4 to .*
   DW_CFA_def_cfa: r0(.*) ofs 16
   DW_CFA_nop
@@ -170,14 +174,14 @@ Contents of the .eh_frame section:
 #?  Augmentation data:     03 .. .. .. .. 1b
 #?  DW_CFA_nop
 
-0+01(70|88) 0+0014 0+0(01c|148|15c) FDE cie=0+0(02c|030|170) pc=.*
+0+01(70|88|c8) 0+001[4c] 0+0(01c|148|15c|194) FDE cie=0+0(02c|030|038|170|188) pc=.*
   DW_CFA_advance_loc: 4 to .*
   DW_CFA_def_cfa: r0(.*) ofs 16
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+01(88|a0) 0+0014 0+01(8c|a4) FDE cie=0+0000 pc=.*
+0+01(88|a0|e8) 0+001[4c] 0+01(8c|a4|ec) FDE cie=0+0000 pc=.*
   DW_CFA_advance_loc: 4 to .*
   DW_CFA_def_cfa: r0(.*) ofs 16
   DW_CFA_nop
@@ -195,7 +199,7 @@ Contents of the .eh_frame section:
 #?  DW_CFA_nop
 #?  DW_CFA_nop
 
-0+01(a0|b8|d4) 0+001c 0+0(020|130|144) FDE cie=0+0(074|078|1b8) pc=.*
+0+0(1a0|1b8|1d4|208) 0+00(1c|24) 0+0(020|130|144|17c) FDE cie=0+0(074|078|090|1b8) pc=.*
   Augmentation data:     (ef be ad de 00 00 00 00|00 00 00 00 de ad be ef)
 
   DW_CFA_advance_loc: 4 to .*
diff --git a/ld/testsuite/ld-elf/group.ld b/ld/testsuite/ld-elf/group.ld
index 53e27903563..1c561b6aa0e 100644
--- a/ld/testsuite/ld-elf/group.ld
+++ b/ld/testsuite/ld-elf/group.ld
@@ -8,5 +8,5 @@ SECTIONS
 {
   . = 0x1000;
   .text : { *(.text) *(.rodata.brlt) } :image :header
-  /DISCARD/ : { *(.dropme) *(.reginfo) *(.MIPS.abiflags) }
+  /DISCARD/ : { *(.dropme) *(.reginfo) *(.MIPS.abiflags) *(.MIPS.options) }
 }
diff --git a/ld/testsuite/ld-elf/orphan-region.ld b/ld/testsuite/ld-elf/orphan-region.ld
index 71834df647a..f4f7e1846d7 100644
--- a/ld/testsuite/ld-elf/orphan-region.ld
+++ b/ld/testsuite/ld-elf/orphan-region.ld
@@ -7,5 +7,5 @@ SECTIONS
 {
 	.text : ALIGN (4) { *(.text) } > region
 	.rodata : ALIGN (4) { *(.rodata) } > region
-	/DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.trampolines) *(.riscv.attributes) }
+	/DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.MIPS.options) *(.trampolines) *(.riscv.attributes) }
 }
diff --git a/ld/testsuite/ld-elf/orphan.ld b/ld/testsuite/ld-elf/orphan.ld
index 8b5015e157e..86c0b8959c9 100644
--- a/ld/testsuite/ld-elf/orphan.ld
+++ b/ld/testsuite/ld-elf/orphan.ld
@@ -6,5 +6,5 @@ SECTIONS
   .bss : { *(.bss) *(COMMON) }
   .sbss : { *(.sbss) }
   .note : { *(.note) }
-  /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.trampolines) }
+  /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.MIPS.options) *(.trampolines) }
 }
diff --git a/ld/testsuite/ld-mips-elf/compact-eh6.d b/ld/testsuite/ld-mips-elf/compact-eh6.d
index e81285afc02..66b21b17c6c 100644
--- a/ld/testsuite/ld-mips-elf/compact-eh6.d
+++ b/ld/testsuite/ld-mips-elf/compact-eh6.d
@@ -8,6 +8,6 @@
 
 Hex dump of section \'\.eh_frame_hdr\':
 
-  0x[0-9a-f]+ 021b0000 00000005 ffffff[0-9a-f]+ 00000060.*
-  0x[0-9a-f]+ ffffff[0-9a-f]+ 015d5d01 ffffff[0-9a-f]+ 00000029.*
-  0x[0-9a-f]+ ffffff[0-9a-f]+ 00000035 ffffff[0-9a-f]+ 015d5d01.*
+  0x[0-9a-f]+ 021b0000 00000005 ffffff[0-9a-f]+ 0000006[08].*
+  0x[0-9a-f]+ ffffff[0-9a-f]+ 015d5d01 ffffff[0-9a-f]+ 0000002[9d].*
+  0x[0-9a-f]+ ffffff[0-9a-f]+ 0000003[59] ffffff[0-9a-f]+ 015d5d01.*
diff --git a/ld/testsuite/ld-mips-elf/got-dump-1.d b/ld/testsuite/ld-mips-elf/got-dump-1.d
index b14adffa911..00c976c4625 100644
--- a/ld/testsuite/ld-mips-elf/got-dump-1.d
+++ b/ld/testsuite/ld-mips-elf/got-dump-1.d
@@ -5,21 +5,21 @@
 #readelf: -A
 
 Primary GOT:
- Canonical gp value: 00068000
+ Canonical gp value: 0+068000
 
  Reserved entries:
-   Address     Access  Initial Purpose
-  00060010 -32752\(gp\) 00000000 Lazy resolver
-  00060014 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+ * Address * Access * Initial Purpose
+  0+060010 -32752\(gp\) 0+000000 Lazy resolver
+  0+06001[48] -3274[48]\(gp\) 8000000+ Module pointer \(GNU extension\)
 
  Local entries:
-   Address     Access  Initial
-  00060018 -32744\(gp\) 00060000
-  0006001c -32740\(gp\) 00060004
+ * Address * Access * Initial
+  0+0600(18|20) -327(44|36)\(gp\) 0+060000
+  0+0600(1c|28) -327(40|28)\(gp\) 0+060004
 
  Global entries:
-   Address     Access  Initial Sym.Val. Type    Ndx Name
-  00060020 -32736\(gp\) 00050020 00050020 FUNC    UND extern
-  00060024 -32732\(gp\) 00050000 00050000 FUNC      7 glob
-  00060028 -32728\(gp\) 00000000 00000000 NOTYPE  UND undef
+ * Address * Access * Initial * Sym.Val. Type * Ndx Name
+  0+0600(2|3)0 -327(36|20)\(gp\) 0+050020 0+050020 FUNC    UND extern
+  0+0600(24|38) -327(32|12)\(gp\) 0+050000 0+050000 FUNC      7 glob
+  0+0600(28|40) -327(28|04)\(gp\) 0+000000 0+000000 NOTYPE  UND undef
 
diff --git a/ld/testsuite/ld-mips-elf/got-page-1.ld b/ld/testsuite/ld-mips-elf/got-page-1.ld
index cfe7c1fb77d..b87abbfd6be 100644
--- a/ld/testsuite/ld-mips-elf/got-page-1.ld
+++ b/ld/testsuite/ld-mips-elf/got-page-1.ld
@@ -22,7 +22,7 @@ SECTIONS
   . = ALIGN (0x400);
   .bss : { *(.bss .bss.*) }
 
-  /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) }
+  /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.MIPS.options) }
 }
 
 VERSION
diff --git a/ld/testsuite/ld-mips-elf/got-page-3.d b/ld/testsuite/ld-mips-elf/got-page-3.d
index 913b0c9cc83..430dd22c00c 100644
--- a/ld/testsuite/ld-mips-elf/got-page-3.d
+++ b/ld/testsuite/ld-mips-elf/got-page-3.d
@@ -5,6 +5,7 @@
 #as: -mips3
 #ld: -T got-page-1.ld -shared
 #objdump: -dr
+#xfail: mips*64*-linux-gnuabi64
 #
 # got-page-3a.s and got-page-3b.s should get assigned the same GOT,
 # with a page estimate of 10.  Thus the first page entry has offset
@@ -15,12 +16,12 @@
 # The first global symbol should therefore be at offset -32744.
 #
 #...
-.*	lw	a0,-32744\(gp\)
-.*	addiu	a0,a0,.*
+ *.*	lw	a0,-32744\(gp\)
+ *.*	addiu	a0,a0,.*
 #...
-.*	lw	a1,-32704\(gp\)
+ *.*	lw	a1,-32704\(gp\)
 #...
-.* <f3>:
+ *.* <f3>:
 #...
-.*	lw	a1,-32744\(gp\)
+ *.*	lw	a1,-32744\(gp\)
 #pass
diff --git a/ld/testsuite/ld-mips-elf/jaloverflow-2.d b/ld/testsuite/ld-mips-elf/jaloverflow-2.d
index b40f4281777..bff776e7f6c 100644
--- a/ld/testsuite/ld-mips-elf/jaloverflow-2.d
+++ b/ld/testsuite/ld-mips-elf/jaloverflow-2.d
@@ -4,5 +4,5 @@
 #ld: -Ttext=0x20000000 -e start
 #objdump: -dr
 #...
-0*20000000:	0c000000.*
+ *0*20000000:	0c000000.*
 #pass
diff --git a/ld/testsuite/ld-mips-elf/jalx-1.d b/ld/testsuite/ld-mips-elf/jalx-1.d
index 80c3be229a4..37cad5dd2a0 100644
--- a/ld/testsuite/ld-mips-elf/jalx-1.d
+++ b/ld/testsuite/ld-mips-elf/jalx-1.d
@@ -7,10 +7,10 @@
 
 Disassembly of section \.text:
 
-88000000 <test>:
-88000000:	f200 0002 	jalx	88000008 <test1>
-88000004:	0000 0000 	nop
+0*88000000 <test>:
+ *88000000:	f200 0002 	jalx	88000008 <test1>
+ *88000004:	0000 0000 	nop
 
-88000008 <test1>:
-88000008:	00851821 	addu	v1,a0,a1
+0*88000008 <test1>:
+ *88000008:	00851821 	addu	v1,a0,a1
 	\.\.\.
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index ff9635ec9d1..ee0522b073f 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -182,6 +182,25 @@ set abi_ldflags(eabi) ""
 # Override as needed.
 if {[istarget *-*-openbsd*] } {
     set irixemul 0
+} elseif { [istarget mips*64*-*-linux*-gnuabi64] } {
+    set abi_asflags(o32) -32
+    set abi_asflags(o32l) "-32 -march=from-abi"
+    set abi_asflags(n32) "-n32"
+    set abi_asflags(n32l) "-n32 -march=from-abi"
+    set abi_asflags(n64) ""
+    set abi_asflags(n64l) "-64 -march=from-abi"
+    if [istarget *el-*-*] {
+	set abi_ldflags(o32) -melf32ltsmip
+	set abi_ldflags(o32l) -melf32ltsmip
+	set abi_ldflags(n32) -melf32ltsmipn32
+	set abi_ldflags(n32l) -melf32ltsmipn32
+    } else {
+	set abi_ldflags(o32) -melf32btsmip
+	set abi_ldflags(o32l) -melf32btsmip
+	set abi_ldflags(n32) -melf32btsmipn32
+	set abi_ldflags(n32l) -melf32btsmipn32
+    }
+    set irixemul 0
 } elseif { [istarget mips*64*-*-linux*] } {
     set abi_asflags(o32) -32
     set abi_asflags(o32l) "-32 -march=from-abi"
@@ -892,7 +911,8 @@ if { $linux_gnu } {
     }
     run_dump_test "got-dump-1"
     run_dump_test_n64 "got-dump-2" noarch
-    run_dump_test "reloc-estimate-1"
+    run_dump_test_n32 "reloc-estimate-1"
+    run_dump_test_o32 "reloc-estimate-1"
 }
 
 run_dump_test_n32 "emit-relocs-1" {{as -EB} {ld -EB}}
@@ -1080,7 +1100,8 @@ if { $has_abi(o32) } {
     run_ld_link_tests $mips16_intermix_test
 }
 
-run_dump_test "mips16-local-stubs-1"
+run_dump_test_o32 "mips16-local-stubs-1"
+run_dump_test_n32 "mips16-local-stubs-1"
 
 set mips16_fp_stub_test [list \
     [list "Floating-point stub for mips16 functions" \
@@ -1106,7 +1127,8 @@ foreach firstfpabi [list 4 5 6 7 ] {
 }
 foreach firstfpabi [list 0 1 2 3 ] {
   foreach secondfpabi [list 0 1 2 3 8 9] {
-    run_dump_test "attr-gnu-4-${firstfpabi}${secondfpabi}"
+    run_dump_test_o32 "attr-gnu-4-${firstfpabi}${secondfpabi}"
+    run_dump_test_n32 "attr-gnu-4-${firstfpabi}${secondfpabi}"
   }
 }
 
diff --git a/ld/testsuite/ld-mips-elf/reloc-estimate-1.d b/ld/testsuite/ld-mips-elf/reloc-estimate-1.d
index fcca55a2ade..fa536f938a7 100644
--- a/ld/testsuite/ld-mips-elf/reloc-estimate-1.d
+++ b/ld/testsuite/ld-mips-elf/reloc-estimate-1.d
@@ -8,8 +8,8 @@
 
 DYNAMIC RELOCATION RECORDS
 OFFSET +TYPE +VALUE
-00000000 R_MIPS_NONE       \*ABS\*
-00010000 R_MIPS_REL32      foo@@V2
+0+000000 R_MIPS_NONE       \*ABS\*
+0+010000 R_MIPS_REL32      foo@@V2
 
 
 # The address must be 0x810.  We should only ever allocate one dynamic
diff --git a/ld/testsuite/ld-scripts/overlay-size.t b/ld/testsuite/ld-scripts/overlay-size.t
index 68c09861b63..452e97cdf46 100644
--- a/ld/testsuite/ld-scripts/overlay-size.t
+++ b/ld/testsuite/ld-scripts/overlay-size.t
@@ -60,5 +60,5 @@ SECTIONS
   end_of_data_overlays = . ;
   
   . = 0x8000;
-  /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) }
+  /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.MIPS.options) }
 }
diff --git a/ld/testsuite/ld-undefined/undefined.exp b/ld/testsuite/ld-undefined/undefined.exp
index 69a8f9bf6a9..1e7b05b8065 100644
--- a/ld/testsuite/ld-undefined/undefined.exp
+++ b/ld/testsuite/ld-undefined/undefined.exp
@@ -210,6 +210,10 @@ if { ![is_elf_format] || ![check_shared_lib_support]} then {
 	    set none_count 6
 	    set reloc_count 4
 	}
+	"mips*64*-linux-gnuabi64" {
+	    set none_count 6
+	    set reloc_count 4
+	}
 	"mips*" -
 	"score*" {
 	    set none_count 1
-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4] Some MIPS changes and testsuite fixes
  2023-05-12  7:17 [PATCH 0/4] Some MIPS changes and testsuite fixes YunQiang Su
                   ` (3 preceding siblings ...)
  2023-05-12  7:17 ` [PATCH 4/4] MIPS: fix -gnuabi64 testsuite YunQiang Su
@ 2023-05-13 11:57 ` Alan Modra
  4 siblings, 0 replies; 6+ messages in thread
From: Alan Modra @ 2023-05-13 11:57 UTC (permalink / raw)
  To: YunQiang Su; +Cc: binutils, syq, macro, xry111, richard.sandiford, jiaxun.yang

On Fri, May 12, 2023 at 03:17:16PM +0800, YunQiang Su wrote:
> 4. Fix testsuite for all -gnuabi64 targets, which are N64 default.

Thanks for doing this.  I'm impressed, you fixed almost all the
regressions and other failures on mips64-linux-gnuabi64.  The only
regressions I see are

Running .../ld/testsuite/ld-selective/selective.exp ...
FAIL: selective1
FAIL: selective2
FAIL: selective3
which are all 
"... ABI is incompatible with that of the selected emulation ...
... failed to merge target specific data ...".

See ld/testsuite/config/default.exp for why ld_compile uses
-mabi=n32 which is the cause of these failures, I think.

This isn't an OK to apply as I think that should be done by one of the
MIPS maintainers.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-13 11:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12  7:17 [PATCH 0/4] Some MIPS changes and testsuite fixes YunQiang Su
2023-05-12  7:17 ` [PATCH 1/4] MIPS: gas: alter 64 or 32 for mipsisa triples if march is implicit YunQiang Su
2023-05-12  7:17 ` [PATCH 2/4] MIPS: default r6 if vendor is img YunQiang Su
2023-05-12  7:17 ` [PATCH 3/4] MIPS: fix r6 testsuites YunQiang Su
2023-05-12  7:17 ` [PATCH 4/4] MIPS: fix -gnuabi64 testsuite YunQiang Su
2023-05-13 11:57 ` [PATCH 0/4] Some MIPS changes and testsuite fixes Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).