summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/binutils/gas/config/ppc-sol.mt1
-rw-r--r--gnu/usr.bin/binutils/gas/config/sco5.mt1
-rw-r--r--gnu/usr.bin/binutils/gas/config/te-aux.h17
-rw-r--r--gnu/usr.bin/binutils/gas/config/te-delt88.h13
-rw-r--r--gnu/usr.bin/binutils/gas/config/te-psos.h22
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsub.s16
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsubh.s25
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1.s18
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1h.s19
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2.s15
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2h.s16
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3.s15
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3h.s16
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4.s18
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4h.s19
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branches.s10
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branchesh.s12
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranch.s23
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranchh.s43
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compare.s6
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compareh.s10
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimal.s5
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimalh.s6
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmul.s5
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmulh.s12
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/extendh.s8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdec.s5
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdech.s14
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logical.s14
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logicalh.s31
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misc.s13
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misch.s27
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/mov32bug.s4
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movb.s15
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movbh.s20
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movlh.s18
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movw.s13
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movwh.s18
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpop.s5
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpoph.s8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshift.s11
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshifth.s27
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-xgot.d42
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-xgot.d618
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-xgot.d242
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-xgot.d273
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-xgot.d28
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-xgot.d154
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mri/immconst.d22
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mism-1.s22
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mismatch.exp20
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.d169
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.s211
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.d11
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.s7
55 files changed, 2433 insertions, 0 deletions
diff --git a/gnu/usr.bin/binutils/gas/config/ppc-sol.mt b/gnu/usr.bin/binutils/gas/config/ppc-sol.mt
new file mode 100644
index 00000000000..2216647ccb0
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/config/ppc-sol.mt
@@ -0,0 +1 @@
+TDEFINES=-DTARGET_BYTES_LITTLE_ENDIAN=1 -DTARGET_SOLARIS_COMMENT
diff --git a/gnu/usr.bin/binutils/gas/config/sco5.mt b/gnu/usr.bin/binutils/gas/config/sco5.mt
new file mode 100644
index 00000000000..8879320c4e1
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/config/sco5.mt
@@ -0,0 +1 @@
+TDEFINES=-DSCO_ELF
diff --git a/gnu/usr.bin/binutils/gas/config/te-aux.h b/gnu/usr.bin/binutils/gas/config/te-aux.h
new file mode 100644
index 00000000000..da6fa0164cf
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/config/te-aux.h
@@ -0,0 +1,17 @@
+#define TE_AUX
+
+/* From obj-coff.h:
+ This internal_lineno crap is to stop namespace pollution from the
+ bfd internal coff headerfile. */
+#define internal_lineno bfd_internal_lineno
+#include "coff/aux-coff.h" /* override bits in coff/internal.h */
+#undef internal_lineno
+
+#define COFF_NOLOAD_PROBLEM
+#define KEEP_RELOC_INFO
+
+#include "obj-format.h"
+
+#ifndef LOCAL_LABELS_FB
+#define LOCAL_LABELS_FB 1
+#endif
diff --git a/gnu/usr.bin/binutils/gas/config/te-delt88.h b/gnu/usr.bin/binutils/gas/config/te-delt88.h
new file mode 100644
index 00000000000..adcd6b7f7b6
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/config/te-delt88.h
@@ -0,0 +1,13 @@
+/* This file is te-delta88.h. */
+
+#define TE_DELTA88 1
+
+#define COFF_NOLOAD_PROBLEM 1
+
+/* Added these, because if we don't know what we're targetting we may
+ need an assembler version of libgcc, and that will use local
+ labels. */
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#include "obj-format.h"
diff --git a/gnu/usr.bin/binutils/gas/config/te-psos.h b/gnu/usr.bin/binutils/gas/config/te-psos.h
new file mode 100644
index 00000000000..2ad4153b81a
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/config/te-psos.h
@@ -0,0 +1,22 @@
+/*
+ * This file is te-psos.h for embedded systems running pSOS.
+ * Contributed by Martin Anantharaman (martin@mail.imech.uni-duisburg.de)
+ */
+
+#define TE_PSOS
+
+/* Added these, because if we don't know what we're targetting we may
+ need an assembler version of libgcc, and that will use local
+ labels. */
+
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+/* This makes GAS more versatile and blocks some ELF'isms in
+ tc-m68k.h. */
+
+#define REGISTER_PREFIX_OPTIONAL 1
+
+#include "obj-format.h"
+
+/* end of te-psos.h */
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsub.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsub.s
new file mode 100644
index 00000000000..802b0d7621f
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsub.s
@@ -0,0 +1,16 @@
+ .text
+h8300_add_sub:
+ add.b #16,r1l
+ add.b r1h,r1l
+ add.w r1,r2
+ adds #1,r4
+ adds #2,r5
+ addx r0l,r1l
+ addx #16,r2h
+ sub.b r0l,r1l
+ sub.w r0,r1
+ subs #1,r4
+ subs #2,r5
+ subx r0l,r1l
+ subx #16,r2h
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsubh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsubh.s
new file mode 100644
index 00000000000..1f885d3fc5f
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsubh.s
@@ -0,0 +1,25 @@
+ .h8300h
+ .text
+h8300h_add_sub:
+ add.b #16,r1l
+ add.b r1h,r1l
+ add.w #32,r1
+ add.w r1,r2
+ add.l #64,er1
+ add.l er1,er2
+ adds #1,er4
+ adds #2,er5
+ adds #4,er6
+ addx r0l,r1l
+ addx #16,r2h
+ sub.b r0l,r1l
+ sub.w #16,r1
+ sub.w r0,r1
+ sub.l #64,er1
+ sub.l er1,er2
+ subs #1,er4
+ subs #2,er5
+ subs #4,er6
+ subx r0l,r1l
+ subx #16,r2h
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1.s
new file mode 100644
index 00000000000..3c107a1b822
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1.s
@@ -0,0 +1,18 @@
+ .text
+h8300_bit_ops_1:
+ band #0,r0l
+ band #0,@r0
+ band #0,@64:8
+ bclr #0,r0l
+ bclr #0,@r0
+ bclr #0,@64:8
+ bclr r1l,r0l
+ bclr r1l,@r0
+ bclr r1l,@64:8
+ biand #0,r0l
+ biand #0,@r0
+ biand #0,@64:8
+ bild #0,r0l
+ bild #0,@r0
+ bild #0,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1h.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1h.s
new file mode 100644
index 00000000000..4139a590e8f
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1h.s
@@ -0,0 +1,19 @@
+ .h8300h
+ .text
+h8300h_bit_ops_1:
+ band #0,r0l
+ band #0,@er0
+ band #0,@64:8
+ bclr #0,r0l
+ bclr #0,@er0
+ bclr #0,@64:8
+ bclr r1l,r0l
+ bclr r1l,@er0
+ bclr r1l,@64:8
+ biand #0,r0l
+ biand #0,@er0
+ biand #0,@64:8
+ bild #0,r0l
+ bild #0,@er0
+ bild #0,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2.s
new file mode 100644
index 00000000000..3996e5a469f
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2.s
@@ -0,0 +1,15 @@
+ .text
+h8300_bit_ops_2:
+ bior #0,r0l
+ bior #0,@r0
+ bior #0,@64:8
+ bist #0,r0l
+ bist #0,@r0
+ bist #0,@64:8
+ bixor #0,r0l
+ bixor #0,@r0
+ bixor #0,@64:8
+ bld #0,r0l
+ bld #0,@r0
+ bld #0,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2h.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2h.s
new file mode 100644
index 00000000000..22be74e4b78
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2h.s
@@ -0,0 +1,16 @@
+ .h8300h
+ .text
+h8300h_bit_ops_2:
+ bior #0,r0l
+ bior #0,@er0
+ bior #0,@64:8
+ bist #0,r0l
+ bist #0,@er0
+ bist #0,@64:8
+ bixor #0,r0l
+ bixor #0,@er0
+ bixor #0,@64:8
+ bld #0,r0l
+ bld #0,@er0
+ bld #0,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3.s
new file mode 100644
index 00000000000..78c9bfb482e
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3.s
@@ -0,0 +1,15 @@
+ .text
+h8300_bit_ops_3:
+ bnot #0,r0l
+ bnot #0,@r0
+ bnot #0,@64:8
+ bnot r1l,r0l
+ bnot r1l,@r0
+ bnot r1l,@64:8
+ bset #0,r0l
+ bset #0,@r0
+ bset #0,@64:8
+ bset r1l,r0l
+ bset r1l,@r0
+ bset r1l,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3h.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3h.s
new file mode 100644
index 00000000000..fdeda609080
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3h.s
@@ -0,0 +1,16 @@
+ .h8300h
+ .text
+h8300h_bit_ops_3:
+ bnot #0,r0l
+ bnot #0,@er0
+ bnot #0,@64:8
+ bnot r1l,r0l
+ bnot r1l,@er0
+ bnot r1l,@64:8
+ bset #0,r0l
+ bset #0,@er0
+ bset #0,@64:8
+ bset r1l,r0l
+ bset r1l,@er0
+ bset r1l,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4.s
new file mode 100644
index 00000000000..f7e66d8b251
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4.s
@@ -0,0 +1,18 @@
+ .text
+h8300_bit_ops_4:
+ bor #0,r0l
+ bor #0,@r0
+ bor #0,@64:8
+ bst #0,r0l
+ bst #0,@r0
+ bst #0,@64:8
+ btst #0,r0l
+ btst #0,@r0
+ btst #0,@64:8
+ btst r1l,r0l
+ btst r1l,@r0
+ btst r1l,@64:8
+ bxor #0,r0l
+ bxor #0,@r0
+ bxor #0,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4h.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4h.s
new file mode 100644
index 00000000000..ed35e17dcbd
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4h.s
@@ -0,0 +1,19 @@
+ .h8300h
+ .text
+h8300h_bit_ops_4:
+ bor #0,r0l
+ bor #0,@er0
+ bor #0,@64:8
+ bst #0,r0l
+ bst #0,@er0
+ bst #0,@64:8
+ btst #0,r0l
+ btst #0,@er0
+ btst #0,@64:8
+ btst r1l,r0l
+ btst r1l,@er0
+ btst r1l,@64:8
+ bxor #0,r0l
+ bxor #0,@er0
+ bxor #0,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branches.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branches.s
new file mode 100644
index 00000000000..25806153c42
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branches.s
@@ -0,0 +1,10 @@
+ .text
+h8300_branches:
+ bsr h8300_branches
+ jmp h8300_branches
+ jmp @r0
+ jmp @@16:8
+ jsr h8300_branches
+ jsr @r0
+ jsr @@16:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branchesh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branchesh.s
new file mode 100644
index 00000000000..7cbc62f3e2b
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branchesh.s
@@ -0,0 +1,12 @@
+ .h8300h
+ .text
+h8300h_branches:
+ bsr h8300h_branches:8
+ bsr h8300h_branches:16
+ jmp h8300h_branches
+ jmp @er0
+ jmp @@16:8
+ jsr h8300h_branches
+ jsr @er0
+ jsr @@16:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranch.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranch.s
new file mode 100644
index 00000000000..ae3d53ed88c
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranch.s
@@ -0,0 +1,23 @@
+ .text
+h8300_cbranch:
+ bra h8300_cbranch
+ bt h8300_cbranch
+ brn h8300_cbranch
+ bf h8300_cbranch
+ bhi h8300_cbranch
+ bls h8300_cbranch
+ bcc h8300_cbranch
+ bhs h8300_cbranch
+ bcs h8300_cbranch
+ blo h8300_cbranch
+ bne h8300_cbranch
+ beq h8300_cbranch
+ bvc h8300_cbranch
+ bvs h8300_cbranch
+ bpl h8300_cbranch
+ bmi h8300_cbranch
+ bge h8300_cbranch
+ blt h8300_cbranch
+ bgt h8300_cbranch
+ ble h8300_cbranch
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranchh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranchh.s
new file mode 100644
index 00000000000..3582bb162ce
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranchh.s
@@ -0,0 +1,43 @@
+ .text
+h8300h_cbranch:
+ bra h8300h_cbranch:8
+ bt h8300h_cbranch:8
+ brn h8300h_cbranch:8
+ bf h8300h_cbranch:8
+ bhi h8300h_cbranch:8
+ bls h8300h_cbranch:8
+ bcc h8300h_cbranch:8
+ bhs h8300h_cbranch:8
+ bcs h8300h_cbranch:8
+ blo h8300h_cbranch:8
+ bne h8300h_cbranch:8
+ beq h8300h_cbranch:8
+ bvc h8300h_cbranch:8
+ bvs h8300h_cbranch:8
+ bpl h8300h_cbranch:8
+ bmi h8300h_cbranch:8
+ bge h8300h_cbranch:8
+ blt h8300h_cbranch:8
+ bgt h8300h_cbranch:8
+ ble h8300h_cbranch:8
+ bra h8300h_cbranch:16
+ bt h8300h_cbranch:16
+ brn h8300h_cbranch:16
+ bf h8300h_cbranch:16
+ bhi h8300h_cbranch:16
+ bls h8300h_cbranch:16
+ bcc h8300h_cbranch:16
+ bhs h8300h_cbranch:16
+ bcs h8300h_cbranch:16
+ blo h8300h_cbranch:16
+ bne h8300h_cbranch:16
+ beq h8300h_cbranch:16
+ bvc h8300h_cbranch:16
+ bvs h8300h_cbranch:16
+ bpl h8300h_cbranch:16
+ bmi h8300h_cbranch:16
+ bge h8300h_cbranch:16
+ blt h8300h_cbranch:16
+ bgt h8300h_cbranch:16
+ ble h8300h_cbranch:16
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compare.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compare.s
new file mode 100644
index 00000000000..60c1a417d76
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compare.s
@@ -0,0 +1,6 @@
+ .text
+h8300_cmp:
+ cmp.b #0,r0l
+ cmp.b r0h,r0l
+ cmp.w r0,r1
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compareh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compareh.s
new file mode 100644
index 00000000000..c81e88e0c20
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compareh.s
@@ -0,0 +1,10 @@
+ .h8300h
+ .text
+h8300h_cmp:
+ cmp.b #0,r0l
+ cmp.b r0h,r0l
+ cmp.w #32,r0
+ cmp.w r0,r1
+ cmp.l #64,er0
+ cmp.l er0,er1
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimal.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimal.s
new file mode 100644
index 00000000000..8d4c0a0da9d
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimal.s
@@ -0,0 +1,5 @@
+ .text
+h8300_decimal:
+ daa r0l
+ das r0l
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimalh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimalh.s
new file mode 100644
index 00000000000..939240568eb
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimalh.s
@@ -0,0 +1,6 @@
+ .h8300h
+ .text
+h8300h_decimal:
+ daa r0l
+ das r0l
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmul.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmul.s
new file mode 100644
index 00000000000..37372ce4841
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmul.s
@@ -0,0 +1,5 @@
+ .text
+h8300_div_mul:
+ divxu r0l,r1
+ mulxu r0l,r1
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmulh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmulh.s
new file mode 100644
index 00000000000..db60f8f49aa
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmulh.s
@@ -0,0 +1,12 @@
+ .h8300h
+ .text
+h8300h_div_mul:
+ divxu.b r0l,r1
+ divxu.w r0,er1
+ divxs.b r0l,r1
+ divxs.w r0,er1
+ mulxu.b r0l,r1
+ mulxu.w r0,er1
+ mulxs.b r0l,r1
+ mulxs.w r0,er1
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/extendh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/extendh.s
new file mode 100644
index 00000000000..c034c833ee6
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/extendh.s
@@ -0,0 +1,8 @@
+ .h8300h
+ .text
+h8300h_extend:
+ exts.w r0
+ exts.l er0
+ extu.w r0
+ extu.l er0
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdec.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdec.s
new file mode 100644
index 00000000000..26188277317
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdec.s
@@ -0,0 +1,5 @@
+ .text
+h8300_incdec:
+ dec r0l
+ inc r0l
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdech.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdech.s
new file mode 100644
index 00000000000..bb93fc54b36
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdech.s
@@ -0,0 +1,14 @@
+ .h8300h
+ .text
+h8300h_incdec:
+ dec.b r0l
+ dec.w #1,r0
+ dec.w #2,r0
+ dec.l #1,er0
+ dec.l #2,er0
+ inc.b r0l
+ inc.w #1,r0
+ inc.w #2,r0
+ inc.l #1,er0
+ inc.l #2,er0
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logical.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logical.s
new file mode 100644
index 00000000000..3f7e3b7145d
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logical.s
@@ -0,0 +1,14 @@
+ .text
+h8300_logical:
+ and #16,r1l
+ and r1l,r1h
+ andc #16,ccr
+ or #16,r0l
+ or r1l,r0l
+ orc #16,ccr
+ xor #16,r0l
+ xor r0l,r1l
+ xorc #16,ccr
+ neg r0l
+ not r0l
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logicalh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logicalh.s
new file mode 100644
index 00000000000..9e95f11d454
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logicalh.s
@@ -0,0 +1,31 @@
+ .h8300h
+ .text
+h8300h_logical:
+ and.b #16,r1l
+ and.b r1l,r1h
+ and.w #32,r1
+ and.w r1,r1
+ and.l #64,er1
+ and.l er1,er1
+ andc #16,ccr
+ or.b #16,r0l
+ or.b r1l,r0l
+ or.w #32,r1
+ or.w r1,r1
+ or.l #64,er1
+ or.l er1,er1
+ orc #16,ccr
+ xor.b #16,r0l
+ xor.b r0l,r1l
+ xor.w #32,r1
+ xor.w r1,r1
+ xor.l #64,er1
+ xor.l er1,er1
+ xorc #16,ccr
+ neg.b r0l
+ neg.w r0
+ neg.l er0
+ not.b r0l
+ not.w r0
+ not.l er0
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misc.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misc.s
new file mode 100644
index 00000000000..1f6f8084b67
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misc.s
@@ -0,0 +1,13 @@
+ .text
+h8300_misc:
+ eepmov
+ ldc #0,ccr
+ ldc r0l,ccr
+; movfpe 16:16,r0l
+; movtpe r0l,16:16
+ nop
+ rte
+ rts
+ sleep
+ stc ccr,r0l
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misch.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misch.s
new file mode 100644
index 00000000000..4127c86695e
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misch.s
@@ -0,0 +1,27 @@
+ .h8300h
+ .text
+h8300h_misc:
+ eepmov.b
+; eepmov.w
+ ldc.b #0,ccr
+ ldc.b r0l,ccr
+ ldc.w @er0,ccr
+ ldc.w @(16:16,er0),ccr
+ ldc.w @(32:24,er0),ccr
+ ldc.w @er0+,ccr
+ ldc.w @h8300h_misc:16,ccr
+ ldc.w @h8300h_misc:24,ccr
+; movfpe 16:16,r0l
+; movtpe r0l,16:16
+ nop
+ rte
+ rts
+ sleep
+ stc.b ccr,r0l
+ stc.w ccr,@er0
+ stc.w ccr,@(16:16,er0)
+ stc.w ccr,@(32:24,er0)
+ stc.w ccr,@-er0
+ stc.w ccr,@h8300h_misc:16
+ stc.w ccr,@h8300h_misc:24
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/mov32bug.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/mov32bug.s
new file mode 100644
index 00000000000..68393e3f54e
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/mov32bug.s
@@ -0,0 +1,4 @@
+ .h8300h
+ .global _a
+blah:
+ mov.l #_a-2000000000,er2
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movb.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movb.s
new file mode 100644
index 00000000000..fa040c0a7bf
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movb.s
@@ -0,0 +1,15 @@
+ .text
+h8300_movb:
+ mov.b r0l,r1l
+ mov.b #16,r0l
+ mov.b @r1,r0l
+ mov.b @(16:16,r1),r0l
+ mov.b @r1+,r0l
+ mov.b @16:8,r0l
+ mov.b @h8300_movb:16,r0l
+ mov.b r0l,@r1
+ mov.b r0l,@(16:16,r1)
+ mov.b r0l,@-r1
+ mov.b r0l,@16:8
+ mov.b r0l,@h8300_movb:16
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movbh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movbh.s
new file mode 100644
index 00000000000..7d711f8512e
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movbh.s
@@ -0,0 +1,20 @@
+ .h8300h
+ .text
+h8300h_movb:
+ mov.b r0l,r1l
+ mov.b #16,r0l
+ mov.b @er1,r0l
+ mov.b @(16:16,er1),r0l
+ mov.b @(32:24,er1),r0l
+ mov.b @er1+,r0l
+ mov.b @16:8,r0l
+ mov.b @h8300h_movb:16,r0l
+ mov.b @h8300h_movb:24,r0l
+ mov.b r0l,@er1
+ mov.b r0l,@(16:16,er1)
+ mov.b r0l,@(32:24,er1)
+ mov.b r0l,@-er1
+ mov.b r0l,@16:8
+ mov.b r0l,@h8300h_movb:16
+ mov.b r0l,@h8300h_movb:24
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movlh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movlh.s
new file mode 100644
index 00000000000..0cc78e8d361
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movlh.s
@@ -0,0 +1,18 @@
+ .h8300h
+ .text
+h8300h_movl:
+ mov.l er0,er1
+ mov.l #64,er0
+ mov.l @er1,er0
+ mov.l @(16:16,er1),er0
+ mov.l @(32:24,er1),er0
+ mov.l @er1+,er0
+ mov.l @h8300h_movl:16,er0
+ mov.l @h8300h_movl:24,er0
+ mov.l er0,@er1
+ mov.l er0,@(16:16,er1)
+ mov.l er0,@(32:24,er1)
+ mov.l er0,@-er1
+ mov.l er0,@h8300h_movl:16
+ mov.l er0,@h8300h_movl:24
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movw.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movw.s
new file mode 100644
index 00000000000..0cc64f8d522
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movw.s
@@ -0,0 +1,13 @@
+ .text
+h8300_movw:
+ mov.w r0,r1
+ mov.w #16,r0
+ mov.w @r1,r0
+ mov.w @(16:16,r1),r0
+ mov.w @r1+,r0
+ mov.w @h8300_movw:16,r0
+ mov.w r0,@r1
+ mov.w r0,@(16:16,r1)
+ mov.w r0,@-r1
+ mov.w r0,@h8300_movw:16
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movwh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movwh.s
new file mode 100644
index 00000000000..595057cb3d7
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movwh.s
@@ -0,0 +1,18 @@
+ .h8300h
+ .text
+h8300h_movw:
+ mov.w r0,r1
+ mov.w #16,r0
+ mov.w @er1,r0
+ mov.w @(16:16,er1),r0
+ mov.w @(32:24,er1),r0
+ mov.w @er1+,r0
+ mov.w @h8300h_movw:16,r0
+ mov.w @h8300h_movw:24,r0
+ mov.w r0,@er1
+ mov.w r0,@(16:16,er1)
+ mov.w r0,@(32:24,er1)
+ mov.w r0,@-er1
+ mov.w r0,@h8300h_movw:16
+ mov.w r0,@h8300h_movw:24
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpop.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpop.s
new file mode 100644
index 00000000000..941b7357537
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpop.s
@@ -0,0 +1,5 @@
+ .text
+h8300_push_pop:
+ pop r0
+ push r0
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpoph.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpoph.s
new file mode 100644
index 00000000000..6049639f567
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpoph.s
@@ -0,0 +1,8 @@
+ .h8300h
+ .text
+h8300h_push_pop:
+ pop.w r0
+ pop.l er0
+ push.w r0
+ push.l er0
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshift.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshift.s
new file mode 100644
index 00000000000..a9aa87df95e
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshift.s
@@ -0,0 +1,11 @@
+ .text
+h8300_rotate_shift:
+ rotl r0l
+ rotr r0l
+ rotxl r0l
+ rotxr r0l
+ shal r0l
+ shar r0l
+ shll r0l
+ shlr r0l
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshifth.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshifth.s
new file mode 100644
index 00000000000..c7abe40a28f
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshifth.s
@@ -0,0 +1,27 @@
+ .h8300h
+ .text
+h8300h_rotate_shift:
+ rotl.b r0l
+ rotl.w r0
+ rotl.l er0
+ rotr.b r0l
+ rotr.w r0
+ rotr.l er0
+ rotxl.b r0l
+ rotxl.w r0
+ rotxl.l er0
+ rotxr.b r0l
+ rotxr.w r0
+ rotxr.l er0
+ shal.b r0l
+ shal.w r0
+ shal.l er0
+ shar.b r0l
+ shar.w r0
+ shar.l er0
+ shll.b r0l
+ shll.w r0
+ shll.l er0
+ shlr.b r0l
+ shlr.w r0
+ shlr.l er0
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-xgot.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-xgot.d
new file mode 100644
index 00000000000..8879aa4463e
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-xgot.d
@@ -0,0 +1,42 @@
+#objdump: -dr
+#name: MIPS jal-xgot
+#as: -mips1 -KPIC -xgot
+#source: jal-svr4pic.s
+
+# Test the jal macro with -KPIC -xgot.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lui \$gp,0x0
+[ ]*RELOC: 0+0000 R_MIPS_HI16 _gp_disp
+0+0004 <[^>]*> addiu \$gp,\$gp,0
+[ ]*RELOC: 0+0004 R_MIPS_LO16 _gp_disp
+0+0008 <[^>]*> addu \$gp,\$gp,\$t9
+0+000c <[^>]*> sw \$gp,0\(\$sp\)
+0+0010 <[^>]*> jalr \$t9
+...
+0+0018 <[^>]*> lw \$gp,0\(\$sp\)
+0+001c <[^>]*> jalr \$a0,\$t9
+...
+0+0024 <[^>]*> lw \$gp,0\(\$sp\)
+...
+0+002c <[^>]*> lw \$t9,0\(\$gp\)
+[ ]*RELOC: 0+002c R_MIPS_GOT16 .text
+...
+0+0034 <[^>]*> addiu \$t9,\$t9,0
+[ ]*RELOC: 0+0034 R_MIPS_LO16 .text
+0+0038 <[^>]*> jalr \$t9
+...
+0+0040 <[^>]*> lw \$gp,0\(\$sp\)
+0+0044 <[^>]*> lui \$t9,0x0
+[ ]*RELOC: 0+0044 R_MIPS_CALL_HI16 external_text_label
+0+0048 <[^>]*> addu \$t9,\$t9,\$gp
+0+004c <[^>]*> lw \$t9,0\(\$t9\)
+[ ]*RELOC: 0+004c R_MIPS_CALL_LO16 external_text_label
+...
+0+0054 <[^>]*> jalr \$t9
+...
+0+005c <[^>]*> lw \$gp,0\(\$sp\)
+0+0060 <[^>]*> b 0+0000 <text_label>
+...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-xgot.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-xgot.d
new file mode 100644
index 00000000000..e50adf76861
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-xgot.d
@@ -0,0 +1,618 @@
+#objdump: -dr
+#name: MIPS la-xgot
+#as: -mips1 -KPIC -xgot
+#source: la.s
+
+# Test the la macro with -KPIC -xgot.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> li \$a0,0
+0+0004 <[^>]*> li \$a0,1
+0+0008 <[^>]*> li \$a0,0x8000
+0+000c <[^>]*> li \$a0,-32768
+0+0010 <[^>]*> lui \$a0,0x1
+0+0014 <[^>]*> lui \$a0,0x1
+0+0018 <[^>]*> ori \$a0,\$a0,0xa5a5
+0+001c <[^>]*> li \$a0,0
+0+0020 <[^>]*> addu \$a0,\$a0,\$a1
+0+0024 <[^>]*> li \$a0,1
+0+0028 <[^>]*> addu \$a0,\$a0,\$a1
+0+002c <[^>]*> li \$a0,0x8000
+0+0030 <[^>]*> addu \$a0,\$a0,\$a1
+0+0034 <[^>]*> li \$a0,-32768
+0+0038 <[^>]*> addu \$a0,\$a0,\$a1
+0+003c <[^>]*> lui \$a0,0x1
+0+0040 <[^>]*> addu \$a0,\$a0,\$a1
+0+0044 <[^>]*> lui \$a0,0x1
+0+0048 <[^>]*> ori \$a0,\$a0,0xa5a5
+0+004c <[^>]*> addu \$a0,\$a0,\$a1
+0+0050 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0050 R_MIPS_GOT16 .data
+...
+0+0058 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0058 R_MIPS_LO16 .data
+0+005c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+005c R_MIPS_GOT_HI16 big_external_data_label
+0+0060 <[^>]*> addu \$a0,\$a0,\$gp
+0+0064 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0064 R_MIPS_GOT_LO16 big_external_data_label
+0+0068 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0068 R_MIPS_GOT_HI16 small_external_data_label
+0+006c <[^>]*> addu \$a0,\$a0,\$gp
+0+0070 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0070 R_MIPS_GOT_LO16 small_external_data_label
+0+0074 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0074 R_MIPS_GOT_HI16 big_external_common
+0+0078 <[^>]*> addu \$a0,\$a0,\$gp
+0+007c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+007c R_MIPS_GOT_LO16 big_external_common
+0+0080 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0080 R_MIPS_GOT_HI16 small_external_common
+0+0084 <[^>]*> addu \$a0,\$a0,\$gp
+0+0088 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0088 R_MIPS_GOT_LO16 small_external_common
+0+008c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+008c R_MIPS_GOT16 .bss
+...
+0+0094 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0094 R_MIPS_LO16 .bss
+0+0098 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0098 R_MIPS_GOT16 .bss
+...
+0+00a0 <[^>]*> addiu \$a0,\$a0,1000
+[ ]*RELOC: 0+00a0 R_MIPS_LO16 .bss
+0+00a4 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+00a4 R_MIPS_GOT16 .data
+...
+0+00ac <[^>]*> addiu \$a0,\$a0,1
+[ ]*RELOC: 0+00ac R_MIPS_LO16 .data
+0+00b0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00b0 R_MIPS_GOT_HI16 big_external_data_label
+0+00b4 <[^>]*> addu \$a0,\$a0,\$gp
+0+00b8 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00b8 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+00c0 <[^>]*> addiu \$a0,\$a0,1
+0+00c4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00c4 R_MIPS_GOT_HI16 small_external_data_label
+0+00c8 <[^>]*> addu \$a0,\$a0,\$gp
+0+00cc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00cc R_MIPS_GOT_LO16 small_external_data_label
+...
+0+00d4 <[^>]*> addiu \$a0,\$a0,1
+0+00d8 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00d8 R_MIPS_GOT_HI16 big_external_common
+0+00dc <[^>]*> addu \$a0,\$a0,\$gp
+0+00e0 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00e0 R_MIPS_GOT_LO16 big_external_common
+...
+0+00e8 <[^>]*> addiu \$a0,\$a0,1
+0+00ec <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00ec R_MIPS_GOT_HI16 small_external_common
+0+00f0 <[^>]*> addu \$a0,\$a0,\$gp
+0+00f4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00f4 R_MIPS_GOT_LO16 small_external_common
+...
+0+00fc <[^>]*> addiu \$a0,\$a0,1
+0+0100 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0100 R_MIPS_GOT16 .bss
+...
+0+0108 <[^>]*> addiu \$a0,\$a0,1
+[ ]*RELOC: 0+0108 R_MIPS_LO16 .bss
+0+010c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+010c R_MIPS_GOT16 .bss
+...
+0+0114 <[^>]*> addiu \$a0,\$a0,1001
+[ ]*RELOC: 0+0114 R_MIPS_LO16 .bss
+0+0118 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0118 R_MIPS_GOT16 .data
+0+011c <[^>]*> lui \$at,0x1
+0+0120 <[^>]*> addiu \$at,\$at,-32768
+[ ]*RELOC: 0+0120 R_MIPS_LO16 .data
+0+0124 <[^>]*> addu \$a0,\$a0,\$at
+0+0128 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0128 R_MIPS_GOT_HI16 big_external_data_label
+0+012c <[^>]*> addu \$a0,\$a0,\$gp
+0+0130 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0130 R_MIPS_GOT_LO16 big_external_data_label
+0+0134 <[^>]*> lui \$at,0x1
+0+0138 <[^>]*> addiu \$at,\$at,-32768
+0+013c <[^>]*> addu \$a0,\$a0,\$at
+0+0140 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0140 R_MIPS_GOT_HI16 small_external_data_label
+0+0144 <[^>]*> addu \$a0,\$a0,\$gp
+0+0148 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0148 R_MIPS_GOT_LO16 small_external_data_label
+0+014c <[^>]*> lui \$at,0x1
+0+0150 <[^>]*> addiu \$at,\$at,-32768
+0+0154 <[^>]*> addu \$a0,\$a0,\$at
+0+0158 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0158 R_MIPS_GOT_HI16 big_external_common
+0+015c <[^>]*> addu \$a0,\$a0,\$gp
+0+0160 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0160 R_MIPS_GOT_LO16 big_external_common
+0+0164 <[^>]*> lui \$at,0x1
+0+0168 <[^>]*> addiu \$at,\$at,-32768
+0+016c <[^>]*> addu \$a0,\$a0,\$at
+0+0170 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0170 R_MIPS_GOT_HI16 small_external_common
+0+0174 <[^>]*> addu \$a0,\$a0,\$gp
+0+0178 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0178 R_MIPS_GOT_LO16 small_external_common
+0+017c <[^>]*> lui \$at,0x1
+0+0180 <[^>]*> addiu \$at,\$at,-32768
+0+0184 <[^>]*> addu \$a0,\$a0,\$at
+0+0188 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0188 R_MIPS_GOT16 .bss
+0+018c <[^>]*> lui \$at,0x1
+0+0190 <[^>]*> addiu \$at,\$at,-32768
+[ ]*RELOC: 0+0190 R_MIPS_LO16 .bss
+0+0194 <[^>]*> addu \$a0,\$a0,\$at
+0+0198 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0198 R_MIPS_GOT16 .bss
+0+019c <[^>]*> lui \$at,0x1
+0+01a0 <[^>]*> addiu \$at,\$at,-31768
+[ ]*RELOC: 0+01a0 R_MIPS_LO16 .bss
+0+01a4 <[^>]*> addu \$a0,\$a0,\$at
+0+01a8 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+01a8 R_MIPS_GOT16 .data
+...
+0+01b0 <[^>]*> addiu \$a0,\$a0,-32768
+[ ]*RELOC: 0+01b0 R_MIPS_LO16 .data
+0+01b4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01b4 R_MIPS_GOT_HI16 big_external_data_label
+0+01b8 <[^>]*> addu \$a0,\$a0,\$gp
+0+01bc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01bc R_MIPS_GOT_LO16 big_external_data_label
+...
+0+01c4 <[^>]*> addiu \$a0,\$a0,-32768
+0+01c8 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01c8 R_MIPS_GOT_HI16 small_external_data_label
+0+01cc <[^>]*> addu \$a0,\$a0,\$gp
+0+01d0 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01d0 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+01d8 <[^>]*> addiu \$a0,\$a0,-32768
+0+01dc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01dc R_MIPS_GOT_HI16 big_external_common
+0+01e0 <[^>]*> addu \$a0,\$a0,\$gp
+0+01e4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01e4 R_MIPS_GOT_LO16 big_external_common
+...
+0+01ec <[^>]*> addiu \$a0,\$a0,-32768
+0+01f0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01f0 R_MIPS_GOT_HI16 small_external_common
+0+01f4 <[^>]*> addu \$a0,\$a0,\$gp
+0+01f8 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01f8 R_MIPS_GOT_LO16 small_external_common
+...
+0+0200 <[^>]*> addiu \$a0,\$a0,-32768
+0+0204 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0204 R_MIPS_GOT16 .bss
+...
+0+020c <[^>]*> addiu \$a0,\$a0,-32768
+[ ]*RELOC: 0+020c R_MIPS_LO16 .bss
+0+0210 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0210 R_MIPS_GOT16 .bss
+...
+0+0218 <[^>]*> addiu \$a0,\$a0,-31768
+[ ]*RELOC: 0+0218 R_MIPS_LO16 .bss
+0+021c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+021c R_MIPS_GOT16 .data
+0+0220 <[^>]*> lui \$at,0x1
+0+0224 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0224 R_MIPS_LO16 .data
+0+0228 <[^>]*> addu \$a0,\$a0,\$at
+0+022c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+022c R_MIPS_GOT_HI16 big_external_data_label
+0+0230 <[^>]*> addu \$a0,\$a0,\$gp
+0+0234 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0234 R_MIPS_GOT_LO16 big_external_data_label
+0+0238 <[^>]*> lui \$at,0x1
+0+023c <[^>]*> addiu \$at,\$at,0
+0+0240 <[^>]*> addu \$a0,\$a0,\$at
+0+0244 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0244 R_MIPS_GOT_HI16 small_external_data_label
+0+0248 <[^>]*> addu \$a0,\$a0,\$gp
+0+024c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+024c R_MIPS_GOT_LO16 small_external_data_label
+0+0250 <[^>]*> lui \$at,0x1
+0+0254 <[^>]*> addiu \$at,\$at,0
+0+0258 <[^>]*> addu \$a0,\$a0,\$at
+0+025c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+025c R_MIPS_GOT_HI16 big_external_common
+0+0260 <[^>]*> addu \$a0,\$a0,\$gp
+0+0264 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0264 R_MIPS_GOT_LO16 big_external_common
+0+0268 <[^>]*> lui \$at,0x1
+0+026c <[^>]*> addiu \$at,\$at,0
+0+0270 <[^>]*> addu \$a0,\$a0,\$at
+0+0274 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0274 R_MIPS_GOT_HI16 small_external_common
+0+0278 <[^>]*> addu \$a0,\$a0,\$gp
+0+027c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+027c R_MIPS_GOT_LO16 small_external_common
+0+0280 <[^>]*> lui \$at,0x1
+0+0284 <[^>]*> addiu \$at,\$at,0
+0+0288 <[^>]*> addu \$a0,\$a0,\$at
+0+028c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+028c R_MIPS_GOT16 .bss
+0+0290 <[^>]*> lui \$at,0x1
+0+0294 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0294 R_MIPS_LO16 .bss
+0+0298 <[^>]*> addu \$a0,\$a0,\$at
+0+029c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+029c R_MIPS_GOT16 .bss
+0+02a0 <[^>]*> lui \$at,0x1
+0+02a4 <[^>]*> addiu \$at,\$at,1000
+[ ]*RELOC: 0+02a4 R_MIPS_LO16 .bss
+0+02a8 <[^>]*> addu \$a0,\$a0,\$at
+0+02ac <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+02ac R_MIPS_GOT16 .data
+0+02b0 <[^>]*> lui \$at,0x2
+0+02b4 <[^>]*> addiu \$at,\$at,-23131
+[ ]*RELOC: 0+02b4 R_MIPS_LO16 .data
+0+02b8 <[^>]*> addu \$a0,\$a0,\$at
+0+02bc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+02bc R_MIPS_GOT_HI16 big_external_data_label
+0+02c0 <[^>]*> addu \$a0,\$a0,\$gp
+0+02c4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+02c4 R_MIPS_GOT_LO16 big_external_data_label
+0+02c8 <[^>]*> lui \$at,0x2
+0+02cc <[^>]*> addiu \$at,\$at,-23131
+0+02d0 <[^>]*> addu \$a0,\$a0,\$at
+0+02d4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+02d4 R_MIPS_GOT_HI16 small_external_data_label
+0+02d8 <[^>]*> addu \$a0,\$a0,\$gp
+0+02dc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+02dc R_MIPS_GOT_LO16 small_external_data_label
+0+02e0 <[^>]*> lui \$at,0x2
+0+02e4 <[^>]*> addiu \$at,\$at,-23131
+0+02e8 <[^>]*> addu \$a0,\$a0,\$at
+0+02ec <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+02ec R_MIPS_GOT_HI16 big_external_common
+0+02f0 <[^>]*> addu \$a0,\$a0,\$gp
+0+02f4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+02f4 R_MIPS_GOT_LO16 big_external_common
+0+02f8 <[^>]*> lui \$at,0x2
+0+02fc <[^>]*> addiu \$at,\$at,-23131
+0+0300 <[^>]*> addu \$a0,\$a0,\$at
+0+0304 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0304 R_MIPS_GOT_HI16 small_external_common
+0+0308 <[^>]*> addu \$a0,\$a0,\$gp
+0+030c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+030c R_MIPS_GOT_LO16 small_external_common
+0+0310 <[^>]*> lui \$at,0x2
+0+0314 <[^>]*> addiu \$at,\$at,-23131
+0+0318 <[^>]*> addu \$a0,\$a0,\$at
+0+031c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+031c R_MIPS_GOT16 .bss
+0+0320 <[^>]*> lui \$at,0x2
+0+0324 <[^>]*> addiu \$at,\$at,-23131
+[ ]*RELOC: 0+0324 R_MIPS_LO16 .bss
+0+0328 <[^>]*> addu \$a0,\$a0,\$at
+0+032c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+032c R_MIPS_GOT16 .bss
+0+0330 <[^>]*> lui \$at,0x2
+0+0334 <[^>]*> addiu \$at,\$at,-22131
+[ ]*RELOC: 0+0334 R_MIPS_LO16 .bss
+0+0338 <[^>]*> addu \$a0,\$a0,\$at
+0+033c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+033c R_MIPS_GOT16 .data
+...
+0+0344 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0344 R_MIPS_LO16 .data
+0+0348 <[^>]*> addu \$a0,\$a0,\$a1
+0+034c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+034c R_MIPS_GOT_HI16 big_external_data_label
+0+0350 <[^>]*> addu \$a0,\$a0,\$gp
+0+0354 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0354 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+035c <[^>]*> addu \$a0,\$a0,\$a1
+0+0360 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0360 R_MIPS_GOT_HI16 small_external_data_label
+0+0364 <[^>]*> addu \$a0,\$a0,\$gp
+0+0368 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0368 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0370 <[^>]*> addu \$a0,\$a0,\$a1
+0+0374 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0374 R_MIPS_GOT_HI16 big_external_common
+0+0378 <[^>]*> addu \$a0,\$a0,\$gp
+0+037c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+037c R_MIPS_GOT_LO16 big_external_common
+...
+0+0384 <[^>]*> addu \$a0,\$a0,\$a1
+0+0388 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0388 R_MIPS_GOT_HI16 small_external_common
+0+038c <[^>]*> addu \$a0,\$a0,\$gp
+0+0390 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0390 R_MIPS_GOT_LO16 small_external_common
+...
+0+0398 <[^>]*> addu \$a0,\$a0,\$a1
+0+039c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+039c R_MIPS_GOT16 .bss
+...
+0+03a4 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+03a4 R_MIPS_LO16 .bss
+0+03a8 <[^>]*> addu \$a0,\$a0,\$a1
+0+03ac <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+03ac R_MIPS_GOT16 .bss
+...
+0+03b4 <[^>]*> addiu \$a0,\$a0,1000
+[ ]*RELOC: 0+03b4 R_MIPS_LO16 .bss
+0+03b8 <[^>]*> addu \$a0,\$a0,\$a1
+0+03bc <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+03bc R_MIPS_GOT16 .data
+...
+0+03c4 <[^>]*> addiu \$a0,\$a0,1
+[ ]*RELOC: 0+03c4 R_MIPS_LO16 .data
+0+03c8 <[^>]*> addu \$a0,\$a0,\$a1
+0+03cc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+03cc R_MIPS_GOT_HI16 big_external_data_label
+0+03d0 <[^>]*> addu \$a0,\$a0,\$gp
+0+03d4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+03d4 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+03dc <[^>]*> addiu \$a0,\$a0,1
+0+03e0 <[^>]*> addu \$a0,\$a0,\$a1
+0+03e4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+03e4 R_MIPS_GOT_HI16 small_external_data_label
+0+03e8 <[^>]*> addu \$a0,\$a0,\$gp
+0+03ec <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+03ec R_MIPS_GOT_LO16 small_external_data_label
+...
+0+03f4 <[^>]*> addiu \$a0,\$a0,1
+0+03f8 <[^>]*> addu \$a0,\$a0,\$a1
+0+03fc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+03fc R_MIPS_GOT_HI16 big_external_common
+0+0400 <[^>]*> addu \$a0,\$a0,\$gp
+0+0404 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0404 R_MIPS_GOT_LO16 big_external_common
+...
+0+040c <[^>]*> addiu \$a0,\$a0,1
+0+0410 <[^>]*> addu \$a0,\$a0,\$a1
+0+0414 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0414 R_MIPS_GOT_HI16 small_external_common
+0+0418 <[^>]*> addu \$a0,\$a0,\$gp
+0+041c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+041c R_MIPS_GOT_LO16 small_external_common
+...
+0+0424 <[^>]*> addiu \$a0,\$a0,1
+0+0428 <[^>]*> addu \$a0,\$a0,\$a1
+0+042c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+042c R_MIPS_GOT16 .bss
+...
+0+0434 <[^>]*> addiu \$a0,\$a0,1
+[ ]*RELOC: 0+0434 R_MIPS_LO16 .bss
+0+0438 <[^>]*> addu \$a0,\$a0,\$a1
+0+043c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+043c R_MIPS_GOT16 .bss
+...
+0+0444 <[^>]*> addiu \$a0,\$a0,1001
+[ ]*RELOC: 0+0444 R_MIPS_LO16 .bss
+0+0448 <[^>]*> addu \$a0,\$a0,\$a1
+0+044c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+044c R_MIPS_GOT16 .data
+0+0450 <[^>]*> lui \$at,0x1
+0+0454 <[^>]*> addiu \$at,\$at,-32768
+[ ]*RELOC: 0+0454 R_MIPS_LO16 .data
+0+0458 <[^>]*> addu \$a0,\$a0,\$at
+0+045c <[^>]*> addu \$a0,\$a0,\$a1
+0+0460 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0460 R_MIPS_GOT_HI16 big_external_data_label
+0+0464 <[^>]*> addu \$a0,\$a0,\$gp
+0+0468 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0468 R_MIPS_GOT_LO16 big_external_data_label
+0+046c <[^>]*> lui \$at,0x1
+0+0470 <[^>]*> addiu \$at,\$at,-32768
+0+0474 <[^>]*> addu \$a0,\$a0,\$at
+0+0478 <[^>]*> addu \$a0,\$a0,\$a1
+0+047c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+047c R_MIPS_GOT_HI16 small_external_data_label
+0+0480 <[^>]*> addu \$a0,\$a0,\$gp
+0+0484 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0484 R_MIPS_GOT_LO16 small_external_data_label
+0+0488 <[^>]*> lui \$at,0x1
+0+048c <[^>]*> addiu \$at,\$at,-32768
+0+0490 <[^>]*> addu \$a0,\$a0,\$at
+0+0494 <[^>]*> addu \$a0,\$a0,\$a1
+0+0498 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0498 R_MIPS_GOT_HI16 big_external_common
+0+049c <[^>]*> addu \$a0,\$a0,\$gp
+0+04a0 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+04a0 R_MIPS_GOT_LO16 big_external_common
+0+04a4 <[^>]*> lui \$at,0x1
+0+04a8 <[^>]*> addiu \$at,\$at,-32768
+0+04ac <[^>]*> addu \$a0,\$a0,\$at
+0+04b0 <[^>]*> addu \$a0,\$a0,\$a1
+0+04b4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+04b4 R_MIPS_GOT_HI16 small_external_common
+0+04b8 <[^>]*> addu \$a0,\$a0,\$gp
+0+04bc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+04bc R_MIPS_GOT_LO16 small_external_common
+0+04c0 <[^>]*> lui \$at,0x1
+0+04c4 <[^>]*> addiu \$at,\$at,-32768
+0+04c8 <[^>]*> addu \$a0,\$a0,\$at
+0+04cc <[^>]*> addu \$a0,\$a0,\$a1
+0+04d0 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+04d0 R_MIPS_GOT16 .bss
+0+04d4 <[^>]*> lui \$at,0x1
+0+04d8 <[^>]*> addiu \$at,\$at,-32768
+[ ]*RELOC: 0+04d8 R_MIPS_LO16 .bss
+0+04dc <[^>]*> addu \$a0,\$a0,\$at
+0+04e0 <[^>]*> addu \$a0,\$a0,\$a1
+0+04e4 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+04e4 R_MIPS_GOT16 .bss
+0+04e8 <[^>]*> lui \$at,0x1
+0+04ec <[^>]*> addiu \$at,\$at,-31768
+[ ]*RELOC: 0+04ec R_MIPS_LO16 .bss
+0+04f0 <[^>]*> addu \$a0,\$a0,\$at
+0+04f4 <[^>]*> addu \$a0,\$a0,\$a1
+0+04f8 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+04f8 R_MIPS_GOT16 .data
+...
+0+0500 <[^>]*> addiu \$a0,\$a0,-32768
+[ ]*RELOC: 0+0500 R_MIPS_LO16 .data
+0+0504 <[^>]*> addu \$a0,\$a0,\$a1
+0+0508 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0508 R_MIPS_GOT_HI16 big_external_data_label
+0+050c <[^>]*> addu \$a0,\$a0,\$gp
+0+0510 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0510 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0518 <[^>]*> addiu \$a0,\$a0,-32768
+0+051c <[^>]*> addu \$a0,\$a0,\$a1
+0+0520 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0520 R_MIPS_GOT_HI16 small_external_data_label
+0+0524 <[^>]*> addu \$a0,\$a0,\$gp
+0+0528 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0528 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0530 <[^>]*> addiu \$a0,\$a0,-32768
+0+0534 <[^>]*> addu \$a0,\$a0,\$a1
+0+0538 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0538 R_MIPS_GOT_HI16 big_external_common
+0+053c <[^>]*> addu \$a0,\$a0,\$gp
+0+0540 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0540 R_MIPS_GOT_LO16 big_external_common
+...
+0+0548 <[^>]*> addiu \$a0,\$a0,-32768
+0+054c <[^>]*> addu \$a0,\$a0,\$a1
+0+0550 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0550 R_MIPS_GOT_HI16 small_external_common
+0+0554 <[^>]*> addu \$a0,\$a0,\$gp
+0+0558 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0558 R_MIPS_GOT_LO16 small_external_common
+...
+0+0560 <[^>]*> addiu \$a0,\$a0,-32768
+0+0564 <[^>]*> addu \$a0,\$a0,\$a1
+0+0568 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0568 R_MIPS_GOT16 .bss
+...
+0+0570 <[^>]*> addiu \$a0,\$a0,-32768
+[ ]*RELOC: 0+0570 R_MIPS_LO16 .bss
+0+0574 <[^>]*> addu \$a0,\$a0,\$a1
+0+0578 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0578 R_MIPS_GOT16 .bss
+...
+0+0580 <[^>]*> addiu \$a0,\$a0,-31768
+[ ]*RELOC: 0+0580 R_MIPS_LO16 .bss
+0+0584 <[^>]*> addu \$a0,\$a0,\$a1
+0+0588 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0588 R_MIPS_GOT16 .data
+0+058c <[^>]*> lui \$at,0x1
+0+0590 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0590 R_MIPS_LO16 .data
+0+0594 <[^>]*> addu \$a0,\$a0,\$at
+0+0598 <[^>]*> addu \$a0,\$a0,\$a1
+0+059c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+059c R_MIPS_GOT_HI16 big_external_data_label
+0+05a0 <[^>]*> addu \$a0,\$a0,\$gp
+0+05a4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+05a4 R_MIPS_GOT_LO16 big_external_data_label
+0+05a8 <[^>]*> lui \$at,0x1
+0+05ac <[^>]*> addiu \$at,\$at,0
+0+05b0 <[^>]*> addu \$a0,\$a0,\$at
+0+05b4 <[^>]*> addu \$a0,\$a0,\$a1
+0+05b8 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+05b8 R_MIPS_GOT_HI16 small_external_data_label
+0+05bc <[^>]*> addu \$a0,\$a0,\$gp
+0+05c0 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+05c0 R_MIPS_GOT_LO16 small_external_data_label
+0+05c4 <[^>]*> lui \$at,0x1
+0+05c8 <[^>]*> addiu \$at,\$at,0
+0+05cc <[^>]*> addu \$a0,\$a0,\$at
+0+05d0 <[^>]*> addu \$a0,\$a0,\$a1
+0+05d4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+05d4 R_MIPS_GOT_HI16 big_external_common
+0+05d8 <[^>]*> addu \$a0,\$a0,\$gp
+0+05dc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+05dc R_MIPS_GOT_LO16 big_external_common
+0+05e0 <[^>]*> lui \$at,0x1
+0+05e4 <[^>]*> addiu \$at,\$at,0
+0+05e8 <[^>]*> addu \$a0,\$a0,\$at
+0+05ec <[^>]*> addu \$a0,\$a0,\$a1
+0+05f0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+05f0 R_MIPS_GOT_HI16 small_external_common
+0+05f4 <[^>]*> addu \$a0,\$a0,\$gp
+0+05f8 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+05f8 R_MIPS_GOT_LO16 small_external_common
+0+05fc <[^>]*> lui \$at,0x1
+0+0600 <[^>]*> addiu \$at,\$at,0
+0+0604 <[^>]*> addu \$a0,\$a0,\$at
+0+0608 <[^>]*> addu \$a0,\$a0,\$a1
+0+060c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+060c R_MIPS_GOT16 .bss
+0+0610 <[^>]*> lui \$at,0x1
+0+0614 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0614 R_MIPS_LO16 .bss
+0+0618 <[^>]*> addu \$a0,\$a0,\$at
+0+061c <[^>]*> addu \$a0,\$a0,\$a1
+0+0620 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0620 R_MIPS_GOT16 .bss
+0+0624 <[^>]*> lui \$at,0x1
+0+0628 <[^>]*> addiu \$at,\$at,1000
+[ ]*RELOC: 0+0628 R_MIPS_LO16 .bss
+0+062c <[^>]*> addu \$a0,\$a0,\$at
+0+0630 <[^>]*> addu \$a0,\$a0,\$a1
+0+0634 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0634 R_MIPS_GOT16 .data
+0+0638 <[^>]*> lui \$at,0x2
+0+063c <[^>]*> addiu \$at,\$at,-23131
+[ ]*RELOC: 0+063c R_MIPS_LO16 .data
+0+0640 <[^>]*> addu \$a0,\$a0,\$at
+0+0644 <[^>]*> addu \$a0,\$a0,\$a1
+0+0648 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0648 R_MIPS_GOT_HI16 big_external_data_label
+0+064c <[^>]*> addu \$a0,\$a0,\$gp
+0+0650 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0650 R_MIPS_GOT_LO16 big_external_data_label
+0+0654 <[^>]*> lui \$at,0x2
+0+0658 <[^>]*> addiu \$at,\$at,-23131
+0+065c <[^>]*> addu \$a0,\$a0,\$at
+0+0660 <[^>]*> addu \$a0,\$a0,\$a1
+0+0664 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0664 R_MIPS_GOT_HI16 small_external_data_label
+0+0668 <[^>]*> addu \$a0,\$a0,\$gp
+0+066c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+066c R_MIPS_GOT_LO16 small_external_data_label
+0+0670 <[^>]*> lui \$at,0x2
+0+0674 <[^>]*> addiu \$at,\$at,-23131
+0+0678 <[^>]*> addu \$a0,\$a0,\$at
+0+067c <[^>]*> addu \$a0,\$a0,\$a1
+0+0680 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0680 R_MIPS_GOT_HI16 big_external_common
+0+0684 <[^>]*> addu \$a0,\$a0,\$gp
+0+0688 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0688 R_MIPS_GOT_LO16 big_external_common
+0+068c <[^>]*> lui \$at,0x2
+0+0690 <[^>]*> addiu \$at,\$at,-23131
+0+0694 <[^>]*> addu \$a0,\$a0,\$at
+0+0698 <[^>]*> addu \$a0,\$a0,\$a1
+0+069c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+069c R_MIPS_GOT_HI16 small_external_common
+0+06a0 <[^>]*> addu \$a0,\$a0,\$gp
+0+06a4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+06a4 R_MIPS_GOT_LO16 small_external_common
+0+06a8 <[^>]*> lui \$at,0x2
+0+06ac <[^>]*> addiu \$at,\$at,-23131
+0+06b0 <[^>]*> addu \$a0,\$a0,\$at
+0+06b4 <[^>]*> addu \$a0,\$a0,\$a1
+0+06b8 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+06b8 R_MIPS_GOT16 .bss
+0+06bc <[^>]*> lui \$at,0x2
+0+06c0 <[^>]*> addiu \$at,\$at,-23131
+[ ]*RELOC: 0+06c0 R_MIPS_LO16 .bss
+0+06c4 <[^>]*> addu \$a0,\$a0,\$at
+0+06c8 <[^>]*> addu \$a0,\$a0,\$a1
+0+06cc <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+06cc R_MIPS_GOT16 .bss
+0+06d0 <[^>]*> lui \$at,0x2
+0+06d4 <[^>]*> addiu \$at,\$at,-22131
+[ ]*RELOC: 0+06d4 R_MIPS_LO16 .bss
+0+06d8 <[^>]*> addu \$a0,\$a0,\$at
+0+06dc <[^>]*> addu \$a0,\$a0,\$a1
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-xgot.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-xgot.d
new file mode 100644
index 00000000000..f42d3139ff4
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-xgot.d
@@ -0,0 +1,242 @@
+#objdump: -dr
+#name: MIPS lb-xgot
+#as: -mips1 -KPIC -xgot
+#source: lb-pic.s
+
+# Test the lb macro with -KPIC -xgot.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lb \$a0,0\(\$zero\)
+0+0004 <[^>]*> lb \$a0,1\(\$zero\)
+0+0008 <[^>]*> lui \$a0,0x1
+0+000c <[^>]*> lb \$a0,-32768\(\$a0\)
+0+0010 <[^>]*> lb \$a0,-32768\(\$zero\)
+0+0014 <[^>]*> lui \$a0,0x1
+0+0018 <[^>]*> lb \$a0,0\(\$a0\)
+0+001c <[^>]*> lui \$a0,0x2
+0+0020 <[^>]*> lb \$a0,-23131\(\$a0\)
+0+0024 <[^>]*> lb \$a0,0\(\$a1\)
+0+0028 <[^>]*> lb \$a0,1\(\$a1\)
+0+002c <[^>]*> lui \$a0,0x1
+0+0030 <[^>]*> addu \$a0,\$a0,\$a1
+0+0034 <[^>]*> lb \$a0,-32768\(\$a0\)
+0+0038 <[^>]*> lb \$a0,-32768\(\$a1\)
+0+003c <[^>]*> lui \$a0,0x1
+0+0040 <[^>]*> addu \$a0,\$a0,\$a1
+0+0044 <[^>]*> lb \$a0,0\(\$a0\)
+0+0048 <[^>]*> lui \$a0,0x2
+0+004c <[^>]*> addu \$a0,\$a0,\$a1
+0+0050 <[^>]*> lb \$a0,-23131\(\$a0\)
+0+0054 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0054 R_MIPS_GOT16 .data
+...
+0+005c <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+005c R_MIPS_LO16 .data
+...
+0+0064 <[^>]*> lb \$a0,0\(\$a0\)
+0+0068 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0068 R_MIPS_GOT_HI16 big_external_data_label
+0+006c <[^>]*> addu \$a0,\$a0,\$gp
+0+0070 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0070 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0078 <[^>]*> lb \$a0,0\(\$a0\)
+0+007c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+007c R_MIPS_GOT_HI16 small_external_data_label
+0+0080 <[^>]*> addu \$a0,\$a0,\$gp
+0+0084 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0084 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+008c <[^>]*> lb \$a0,0\(\$a0\)
+0+0090 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0090 R_MIPS_GOT_HI16 big_external_common
+0+0094 <[^>]*> addu \$a0,\$a0,\$gp
+0+0098 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0098 R_MIPS_GOT_LO16 big_external_common
+...
+0+00a0 <[^>]*> lb \$a0,0\(\$a0\)
+0+00a4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00a4 R_MIPS_GOT_HI16 small_external_common
+0+00a8 <[^>]*> addu \$a0,\$a0,\$gp
+0+00ac <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00ac R_MIPS_GOT_LO16 small_external_common
+...
+0+00b4 <[^>]*> lb \$a0,0\(\$a0\)
+0+00b8 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+00b8 R_MIPS_GOT16 .bss
+...
+0+00c0 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+00c0 R_MIPS_LO16 .bss
+...
+0+00c8 <[^>]*> lb \$a0,0\(\$a0\)
+0+00cc <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+00cc R_MIPS_GOT16 .bss
+...
+0+00d4 <[^>]*> addiu \$a0,\$a0,1000
+[ ]*RELOC: 0+00d4 R_MIPS_LO16 .bss
+...
+0+00dc <[^>]*> lb \$a0,0\(\$a0\)
+0+00e0 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+00e0 R_MIPS_GOT16 .data
+...
+0+00e8 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+00e8 R_MIPS_LO16 .data
+...
+0+00f0 <[^>]*> lb \$a0,1\(\$a0\)
+0+00f4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00f4 R_MIPS_GOT_HI16 big_external_data_label
+0+00f8 <[^>]*> addu \$a0,\$a0,\$gp
+0+00fc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00fc R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0104 <[^>]*> lb \$a0,1\(\$a0\)
+0+0108 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0108 R_MIPS_GOT_HI16 small_external_data_label
+0+010c <[^>]*> addu \$a0,\$a0,\$gp
+0+0110 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0110 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0118 <[^>]*> lb \$a0,1\(\$a0\)
+0+011c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+011c R_MIPS_GOT_HI16 big_external_common
+0+0120 <[^>]*> addu \$a0,\$a0,\$gp
+0+0124 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0124 R_MIPS_GOT_LO16 big_external_common
+...
+0+012c <[^>]*> lb \$a0,1\(\$a0\)
+0+0130 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0130 R_MIPS_GOT_HI16 small_external_common
+0+0134 <[^>]*> addu \$a0,\$a0,\$gp
+0+0138 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0138 R_MIPS_GOT_LO16 small_external_common
+...
+0+0140 <[^>]*> lb \$a0,1\(\$a0\)
+0+0144 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0144 R_MIPS_GOT16 .bss
+...
+0+014c <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+014c R_MIPS_LO16 .bss
+...
+0+0154 <[^>]*> lb \$a0,1\(\$a0\)
+0+0158 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0158 R_MIPS_GOT16 .bss
+...
+0+0160 <[^>]*> addiu \$a0,\$a0,1000
+[ ]*RELOC: 0+0160 R_MIPS_LO16 .bss
+...
+0+0168 <[^>]*> lb \$a0,1\(\$a0\)
+0+016c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+016c R_MIPS_GOT16 .data
+...
+0+0174 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0174 R_MIPS_LO16 .data
+...
+0+017c <[^>]*> addu \$a0,\$a0,\$a1
+0+0180 <[^>]*> lb \$a0,0\(\$a0\)
+0+0184 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0184 R_MIPS_GOT_HI16 big_external_data_label
+0+0188 <[^>]*> addu \$a0,\$a0,\$gp
+0+018c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+018c R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0194 <[^>]*> addu \$a0,\$a0,\$a1
+0+0198 <[^>]*> lb \$a0,0\(\$a0\)
+0+019c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+019c R_MIPS_GOT_HI16 small_external_data_label
+0+01a0 <[^>]*> addu \$a0,\$a0,\$gp
+0+01a4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01a4 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+01ac <[^>]*> addu \$a0,\$a0,\$a1
+0+01b0 <[^>]*> lb \$a0,0\(\$a0\)
+0+01b4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01b4 R_MIPS_GOT_HI16 big_external_common
+0+01b8 <[^>]*> addu \$a0,\$a0,\$gp
+0+01bc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01bc R_MIPS_GOT_LO16 big_external_common
+...
+0+01c4 <[^>]*> addu \$a0,\$a0,\$a1
+0+01c8 <[^>]*> lb \$a0,0\(\$a0\)
+0+01cc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01cc R_MIPS_GOT_HI16 small_external_common
+0+01d0 <[^>]*> addu \$a0,\$a0,\$gp
+0+01d4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01d4 R_MIPS_GOT_LO16 small_external_common
+...
+0+01dc <[^>]*> addu \$a0,\$a0,\$a1
+0+01e0 <[^>]*> lb \$a0,0\(\$a0\)
+0+01e4 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+01e4 R_MIPS_GOT16 .bss
+...
+0+01ec <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+01ec R_MIPS_LO16 .bss
+...
+0+01f4 <[^>]*> addu \$a0,\$a0,\$a1
+0+01f8 <[^>]*> lb \$a0,0\(\$a0\)
+0+01fc <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+01fc R_MIPS_GOT16 .bss
+...
+0+0204 <[^>]*> addiu \$a0,\$a0,1000
+[ ]*RELOC: 0+0204 R_MIPS_LO16 .bss
+...
+0+020c <[^>]*> addu \$a0,\$a0,\$a1
+0+0210 <[^>]*> lb \$a0,0\(\$a0\)
+0+0214 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0214 R_MIPS_GOT16 .data
+...
+0+021c <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+021c R_MIPS_LO16 .data
+...
+0+0224 <[^>]*> addu \$a0,\$a0,\$a1
+0+0228 <[^>]*> lb \$a0,1\(\$a0\)
+0+022c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+022c R_MIPS_GOT_HI16 big_external_data_label
+0+0230 <[^>]*> addu \$a0,\$a0,\$gp
+0+0234 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0234 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+023c <[^>]*> addu \$a0,\$a0,\$a1
+0+0240 <[^>]*> lb \$a0,1\(\$a0\)
+0+0244 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0244 R_MIPS_GOT_HI16 small_external_data_label
+0+0248 <[^>]*> addu \$a0,\$a0,\$gp
+0+024c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+024c R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0254 <[^>]*> addu \$a0,\$a0,\$a1
+0+0258 <[^>]*> lb \$a0,1\(\$a0\)
+0+025c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+025c R_MIPS_GOT_HI16 big_external_common
+0+0260 <[^>]*> addu \$a0,\$a0,\$gp
+0+0264 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0264 R_MIPS_GOT_LO16 big_external_common
+...
+0+026c <[^>]*> addu \$a0,\$a0,\$a1
+0+0270 <[^>]*> lb \$a0,1\(\$a0\)
+0+0274 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0274 R_MIPS_GOT_HI16 small_external_common
+0+0278 <[^>]*> addu \$a0,\$a0,\$gp
+0+027c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+027c R_MIPS_GOT_LO16 small_external_common
+...
+0+0284 <[^>]*> addu \$a0,\$a0,\$a1
+0+0288 <[^>]*> lb \$a0,1\(\$a0\)
+0+028c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+028c R_MIPS_GOT16 .bss
+...
+0+0294 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0294 R_MIPS_LO16 .bss
+...
+0+029c <[^>]*> addu \$a0,\$a0,\$a1
+0+02a0 <[^>]*> lb \$a0,1\(\$a0\)
+0+02a4 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+02a4 R_MIPS_GOT16 .bss
+...
+0+02ac <[^>]*> addiu \$a0,\$a0,1000
+[ ]*RELOC: 0+02ac R_MIPS_LO16 .bss
+...
+0+02b4 <[^>]*> addu \$a0,\$a0,\$a1
+0+02b8 <[^>]*> lb \$a0,1\(\$a0\)
+...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-xgot.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-xgot.d
new file mode 100644
index 00000000000..822f033d9fe
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-xgot.d
@@ -0,0 +1,273 @@
+#objdump: -dr
+#name: MIPS ld-xgot
+#as: -mips1 -KPIC -xgot
+#source: ld-pic.s
+
+# Test the ld macro with -KPIC -xgot.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lw \$a0,0\(\$zero\)
+0+0004 <[^>]*> lw \$a1,4\(\$zero\)
+0+0008 <[^>]*> lw \$a0,1\(\$zero\)
+0+000c <[^>]*> lw \$a1,5\(\$zero\)
+0+0010 <[^>]*> lui \$at,0x1
+0+0014 <[^>]*> lw \$a0,-32768\(\$at\)
+0+0018 <[^>]*> lw \$a1,-32764\(\$at\)
+0+001c <[^>]*> lw \$a0,-32768\(\$zero\)
+0+0020 <[^>]*> lw \$a1,-32764\(\$zero\)
+0+0024 <[^>]*> lui \$at,0x1
+0+0028 <[^>]*> lw \$a0,0\(\$at\)
+0+002c <[^>]*> lw \$a1,4\(\$at\)
+0+0030 <[^>]*> lui \$at,0x2
+0+0034 <[^>]*> lw \$a0,-23131\(\$at\)
+0+0038 <[^>]*> lw \$a1,-23127\(\$at\)
+...
+0+0040 <[^>]*> lw \$a0,0\(\$a1\)
+0+0044 <[^>]*> lw \$a1,4\(\$a1\)
+...
+0+004c <[^>]*> lw \$a0,1\(\$a1\)
+0+0050 <[^>]*> lw \$a1,5\(\$a1\)
+0+0054 <[^>]*> lui \$at,0x1
+0+0058 <[^>]*> addu \$at,\$a1,\$at
+0+005c <[^>]*> lw \$a0,-32768\(\$at\)
+0+0060 <[^>]*> lw \$a1,-32764\(\$at\)
+...
+0+0068 <[^>]*> lw \$a0,-32768\(\$a1\)
+0+006c <[^>]*> lw \$a1,-32764\(\$a1\)
+0+0070 <[^>]*> lui \$at,0x1
+0+0074 <[^>]*> addu \$at,\$a1,\$at
+0+0078 <[^>]*> lw \$a0,0\(\$at\)
+0+007c <[^>]*> lw \$a1,4\(\$at\)
+0+0080 <[^>]*> lui \$at,0x2
+0+0084 <[^>]*> addu \$at,\$a1,\$at
+0+0088 <[^>]*> lw \$a0,-23131\(\$at\)
+0+008c <[^>]*> lw \$a1,-23127\(\$at\)
+0+0090 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0090 R_MIPS_GOT16 .data
+...
+0+0098 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0098 R_MIPS_LO16 .data
+0+009c <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+009c R_MIPS_LO16 .data
+0+00a0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00a0 R_MIPS_GOT_HI16 big_external_data_label
+0+00a4 <[^>]*> addu \$at,\$at,\$gp
+0+00a8 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+00a8 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+00b0 <[^>]*> lw \$a0,0\(\$at\)
+0+00b4 <[^>]*> lw \$a1,4\(\$at\)
+0+00b8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00b8 R_MIPS_GOT_HI16 small_external_data_label
+0+00bc <[^>]*> addu \$at,\$at,\$gp
+0+00c0 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+00c0 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+00c8 <[^>]*> lw \$a0,0\(\$at\)
+0+00cc <[^>]*> lw \$a1,4\(\$at\)
+0+00d0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00d0 R_MIPS_GOT_HI16 big_external_common
+0+00d4 <[^>]*> addu \$at,\$at,\$gp
+0+00d8 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+00d8 R_MIPS_GOT_LO16 big_external_common
+...
+0+00e0 <[^>]*> lw \$a0,0\(\$at\)
+0+00e4 <[^>]*> lw \$a1,4\(\$at\)
+0+00e8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00e8 R_MIPS_GOT_HI16 small_external_common
+0+00ec <[^>]*> addu \$at,\$at,\$gp
+0+00f0 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+00f0 R_MIPS_GOT_LO16 small_external_common
+...
+0+00f8 <[^>]*> lw \$a0,0\(\$at\)
+0+00fc <[^>]*> lw \$a1,4\(\$at\)
+0+0100 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0100 R_MIPS_GOT16 .bss
+...
+0+0108 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0108 R_MIPS_LO16 .bss
+0+010c <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+010c R_MIPS_LO16 .bss
+0+0110 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0110 R_MIPS_GOT16 .bss
+...
+0+0118 <[^>]*> lw \$a0,1000\(\$at\)
+[ ]*RELOC: 0+0118 R_MIPS_LO16 .bss
+0+011c <[^>]*> lw \$a1,1004\(\$at\)
+[ ]*RELOC: 0+011c R_MIPS_LO16 .bss
+0+0120 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0120 R_MIPS_GOT16 .data
+...
+0+0128 <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+0128 R_MIPS_LO16 .data
+0+012c <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+012c R_MIPS_LO16 .data
+0+0130 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0130 R_MIPS_GOT_HI16 big_external_data_label
+0+0134 <[^>]*> addu \$at,\$at,\$gp
+0+0138 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0138 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0140 <[^>]*> lw \$a0,1\(\$at\)
+0+0144 <[^>]*> lw \$a1,5\(\$at\)
+0+0148 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0148 R_MIPS_GOT_HI16 small_external_data_label
+0+014c <[^>]*> addu \$at,\$at,\$gp
+0+0150 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0150 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0158 <[^>]*> lw \$a0,1\(\$at\)
+0+015c <[^>]*> lw \$a1,5\(\$at\)
+0+0160 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0160 R_MIPS_GOT_HI16 big_external_common
+0+0164 <[^>]*> addu \$at,\$at,\$gp
+0+0168 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0168 R_MIPS_GOT_LO16 big_external_common
+...
+0+0170 <[^>]*> lw \$a0,1\(\$at\)
+0+0174 <[^>]*> lw \$a1,5\(\$at\)
+0+0178 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0178 R_MIPS_GOT_HI16 small_external_common
+0+017c <[^>]*> addu \$at,\$at,\$gp
+0+0180 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0180 R_MIPS_GOT_LO16 small_external_common
+...
+0+0188 <[^>]*> lw \$a0,1\(\$at\)
+0+018c <[^>]*> lw \$a1,5\(\$at\)
+0+0190 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0190 R_MIPS_GOT16 .bss
+...
+0+0198 <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+0198 R_MIPS_LO16 .bss
+0+019c <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+019c R_MIPS_LO16 .bss
+0+01a0 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+01a0 R_MIPS_GOT16 .bss
+...
+0+01a8 <[^>]*> lw \$a0,1001\(\$at\)
+[ ]*RELOC: 0+01a8 R_MIPS_LO16 .bss
+0+01ac <[^>]*> lw \$a1,1005\(\$at\)
+[ ]*RELOC: 0+01ac R_MIPS_LO16 .bss
+0+01b0 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+01b0 R_MIPS_GOT16 .data
+...
+0+01b8 <[^>]*> addu \$at,\$a1,\$at
+0+01bc <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+01bc R_MIPS_LO16 .data
+0+01c0 <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+01c0 R_MIPS_LO16 .data
+0+01c4 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01c4 R_MIPS_GOT_HI16 big_external_data_label
+0+01c8 <[^>]*> addu \$at,\$at,\$gp
+0+01cc <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+01cc R_MIPS_GOT_LO16 big_external_data_label
+...
+0+01d4 <[^>]*> addu \$at,\$a1,\$at
+0+01d8 <[^>]*> lw \$a0,0\(\$at\)
+0+01dc <[^>]*> lw \$a1,4\(\$at\)
+0+01e0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01e0 R_MIPS_GOT_HI16 small_external_data_label
+0+01e4 <[^>]*> addu \$at,\$at,\$gp
+0+01e8 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+01e8 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+01f0 <[^>]*> addu \$at,\$a1,\$at
+0+01f4 <[^>]*> lw \$a0,0\(\$at\)
+0+01f8 <[^>]*> lw \$a1,4\(\$at\)
+0+01fc <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01fc R_MIPS_GOT_HI16 big_external_common
+0+0200 <[^>]*> addu \$at,\$at,\$gp
+0+0204 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0204 R_MIPS_GOT_LO16 big_external_common
+...
+0+020c <[^>]*> addu \$at,\$a1,\$at
+0+0210 <[^>]*> lw \$a0,0\(\$at\)
+0+0214 <[^>]*> lw \$a1,4\(\$at\)
+0+0218 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0218 R_MIPS_GOT_HI16 small_external_common
+0+021c <[^>]*> addu \$at,\$at,\$gp
+0+0220 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0220 R_MIPS_GOT_LO16 small_external_common
+...
+0+0228 <[^>]*> addu \$at,\$a1,\$at
+0+022c <[^>]*> lw \$a0,0\(\$at\)
+0+0230 <[^>]*> lw \$a1,4\(\$at\)
+0+0234 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0234 R_MIPS_GOT16 .bss
+...
+0+023c <[^>]*> addu \$at,\$a1,\$at
+0+0240 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0240 R_MIPS_LO16 .bss
+0+0244 <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+0244 R_MIPS_LO16 .bss
+0+0248 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0248 R_MIPS_GOT16 .bss
+...
+0+0250 <[^>]*> addu \$at,\$a1,\$at
+0+0254 <[^>]*> lw \$a0,1000\(\$at\)
+[ ]*RELOC: 0+0254 R_MIPS_LO16 .bss
+0+0258 <[^>]*> lw \$a1,1004\(\$at\)
+[ ]*RELOC: 0+0258 R_MIPS_LO16 .bss
+0+025c <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+025c R_MIPS_GOT16 .data
+...
+0+0264 <[^>]*> addu \$at,\$a1,\$at
+0+0268 <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+0268 R_MIPS_LO16 .data
+0+026c <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+026c R_MIPS_LO16 .data
+0+0270 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0270 R_MIPS_GOT_HI16 big_external_data_label
+0+0274 <[^>]*> addu \$at,\$at,\$gp
+0+0278 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0278 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0280 <[^>]*> addu \$at,\$a1,\$at
+0+0284 <[^>]*> lw \$a0,1\(\$at\)
+0+0288 <[^>]*> lw \$a1,5\(\$at\)
+0+028c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+028c R_MIPS_GOT_HI16 small_external_data_label
+0+0290 <[^>]*> addu \$at,\$at,\$gp
+0+0294 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0294 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+029c <[^>]*> addu \$at,\$a1,\$at
+0+02a0 <[^>]*> lw \$a0,1\(\$at\)
+0+02a4 <[^>]*> lw \$a1,5\(\$at\)
+0+02a8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02a8 R_MIPS_GOT_HI16 big_external_common
+0+02ac <[^>]*> addu \$at,\$at,\$gp
+0+02b0 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+02b0 R_MIPS_GOT_LO16 big_external_common
+...
+0+02b8 <[^>]*> addu \$at,\$a1,\$at
+0+02bc <[^>]*> lw \$a0,1\(\$at\)
+0+02c0 <[^>]*> lw \$a1,5\(\$at\)
+0+02c4 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02c4 R_MIPS_GOT_HI16 small_external_common
+0+02c8 <[^>]*> addu \$at,\$at,\$gp
+0+02cc <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+02cc R_MIPS_GOT_LO16 small_external_common
+...
+0+02d4 <[^>]*> addu \$at,\$a1,\$at
+0+02d8 <[^>]*> lw \$a0,1\(\$at\)
+0+02dc <[^>]*> lw \$a1,5\(\$at\)
+0+02e0 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+02e0 R_MIPS_GOT16 .bss
+...
+0+02e8 <[^>]*> addu \$at,\$a1,\$at
+0+02ec <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+02ec R_MIPS_LO16 .bss
+0+02f0 <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+02f0 R_MIPS_LO16 .bss
+0+02f4 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+02f4 R_MIPS_GOT16 .bss
+...
+0+02fc <[^>]*> addu \$at,\$a1,\$at
+0+0300 <[^>]*> lw \$a0,1001\(\$at\)
+[ ]*RELOC: 0+0300 R_MIPS_LO16 .bss
+0+0304 <[^>]*> lw \$a1,1005\(\$at\)
+[ ]*RELOC: 0+0304 R_MIPS_LO16 .bss
+...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-xgot.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-xgot.d
new file mode 100644
index 00000000000..156a58e22d4
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-xgot.d
@@ -0,0 +1,28 @@
+#objdump: -dr
+#name: MIPS lifloat-xgot
+#as: -mips1 -KPIC -xgot
+#source: lifloat.s
+
+# Test the li.d and li.s macros with -KPIC -xgot.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0000 R_MIPS_GOT16 .rodata
+...
+0+0008 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0008 R_MIPS_LO16 .rodata
+0+000c <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+000c R_MIPS_LO16 .rodata
+0+0010 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0010 R_MIPS_GOT16 .rodata
+...
+0+0018 <[^>]*> lwc1 \$f5,8\(\$at\)
+[ ]*RELOC: 0+0018 R_MIPS_LO16 .rodata
+0+001c <[^>]*> lwc1 \$f4,12\(\$at\)
+[ ]*RELOC: 0+001c R_MIPS_LO16 .rodata
+0+0020 <[^>]*> lui \$a0,0x3f80
+0+0024 <[^>]*> lui \$at,0x3f80
+0+0028 <[^>]*> mtc1 \$at,\$f4
+...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-xgot.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-xgot.d
new file mode 100644
index 00000000000..dfa749805fb
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-xgot.d
@@ -0,0 +1,154 @@
+#objdump: -dr
+#name: MIPS ulh-xgot
+#as: -mips1 -KPIC -xgot
+#source: ulh-pic.s
+
+# Test the unaligned load and store macros with -KPIC -xgot.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0000 R_MIPS_GOT16 .data
+...
+0+0008 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0008 R_MIPS_LO16 .data
+...
+0+0010 <[^>]*> lb \$a0,0\(\$at\)
+0+0014 <[^>]*> lbu \$at,1\(\$at\)
+0+0018 <[^>]*> sll \$a0,\$a0,0x8
+0+001c <[^>]*> or \$a0,\$a0,\$at
+0+0020 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0020 R_MIPS_GOT_HI16 big_external_data_label
+0+0024 <[^>]*> addu \$at,\$at,\$gp
+0+0028 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0028 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0030 <[^>]*> lbu \$a0,0\(\$at\)
+0+0034 <[^>]*> lbu \$at,1\(\$at\)
+0+0038 <[^>]*> sll \$a0,\$a0,0x8
+0+003c <[^>]*> or \$a0,\$a0,\$at
+0+0040 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0040 R_MIPS_GOT_HI16 small_external_data_label
+0+0044 <[^>]*> addu \$at,\$at,\$gp
+0+0048 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0048 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0050 <[^>]*> lwl \$a0,0\(\$at\)
+0+0054 <[^>]*> lwr \$a0,3\(\$at\)
+0+0058 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0058 R_MIPS_GOT_HI16 big_external_common
+0+005c <[^>]*> addu \$at,\$at,\$gp
+0+0060 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0060 R_MIPS_GOT_LO16 big_external_common
+...
+0+0068 <[^>]*> sb \$a0,1\(\$at\)
+0+006c <[^>]*> srl \$a0,\$a0,0x8
+0+0070 <[^>]*> sb \$a0,0\(\$at\)
+0+0074 <[^>]*> lbu \$at,1\(\$at\)
+0+0078 <[^>]*> sll \$a0,\$a0,0x8
+0+007c <[^>]*> or \$a0,\$a0,\$at
+0+0080 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0080 R_MIPS_GOT_HI16 small_external_common
+0+0084 <[^>]*> addu \$at,\$at,\$gp
+0+0088 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0088 R_MIPS_GOT_LO16 small_external_common
+...
+0+0090 <[^>]*> swl \$a0,0\(\$at\)
+0+0094 <[^>]*> swr \$a0,3\(\$at\)
+0+0098 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0098 R_MIPS_GOT16 .bss
+...
+0+00a0 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+00a0 R_MIPS_LO16 .bss
+...
+0+00a8 <[^>]*> lb \$a0,0\(\$at\)
+0+00ac <[^>]*> lbu \$at,1\(\$at\)
+0+00b0 <[^>]*> sll \$a0,\$a0,0x8
+0+00b4 <[^>]*> or \$a0,\$a0,\$at
+0+00b8 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+00b8 R_MIPS_GOT16 .bss
+...
+0+00c0 <[^>]*> addiu \$at,\$at,1000
+[ ]*RELOC: 0+00c0 R_MIPS_LO16 .bss
+...
+0+00c8 <[^>]*> lbu \$a0,0\(\$at\)
+0+00cc <[^>]*> lbu \$at,1\(\$at\)
+0+00d0 <[^>]*> sll \$a0,\$a0,0x8
+0+00d4 <[^>]*> or \$a0,\$a0,\$at
+0+00d8 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+00d8 R_MIPS_GOT16 .data
+...
+0+00e0 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+00e0 R_MIPS_LO16 .data
+...
+0+00e8 <[^>]*> addiu \$at,\$at,1
+0+00ec <[^>]*> lwl \$a0,0\(\$at\)
+0+00f0 <[^>]*> lwr \$a0,3\(\$at\)
+0+00f4 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00f4 R_MIPS_GOT_HI16 big_external_data_label
+0+00f8 <[^>]*> addu \$at,\$at,\$gp
+0+00fc <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+00fc R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0104 <[^>]*> addiu \$at,\$at,1
+0+0108 <[^>]*> sb \$a0,1\(\$at\)
+0+010c <[^>]*> srl \$a0,\$a0,0x8
+0+0110 <[^>]*> sb \$a0,0\(\$at\)
+0+0114 <[^>]*> lbu \$at,1\(\$at\)
+0+0118 <[^>]*> sll \$a0,\$a0,0x8
+0+011c <[^>]*> or \$a0,\$a0,\$at
+0+0120 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0120 R_MIPS_GOT_HI16 small_external_data_label
+0+0124 <[^>]*> addu \$at,\$at,\$gp
+0+0128 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0128 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0130 <[^>]*> addiu \$at,\$at,1
+0+0134 <[^>]*> swl \$a0,0\(\$at\)
+0+0138 <[^>]*> swr \$a0,3\(\$at\)
+0+013c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+013c R_MIPS_GOT_HI16 big_external_common
+0+0140 <[^>]*> addu \$at,\$at,\$gp
+0+0144 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0144 R_MIPS_GOT_LO16 big_external_common
+...
+0+014c <[^>]*> addiu \$at,\$at,1
+0+0150 <[^>]*> lb \$a0,0\(\$at\)
+0+0154 <[^>]*> lbu \$at,1\(\$at\)
+0+0158 <[^>]*> sll \$a0,\$a0,0x8
+0+015c <[^>]*> or \$a0,\$a0,\$at
+0+0160 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0160 R_MIPS_GOT_HI16 small_external_common
+0+0164 <[^>]*> addu \$at,\$at,\$gp
+0+0168 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0168 R_MIPS_GOT_LO16 small_external_common
+...
+0+0170 <[^>]*> addiu \$at,\$at,1
+0+0174 <[^>]*> lbu \$a0,0\(\$at\)
+0+0178 <[^>]*> lbu \$at,1\(\$at\)
+0+017c <[^>]*> sll \$a0,\$a0,0x8
+0+0180 <[^>]*> or \$a0,\$a0,\$at
+0+0184 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0184 R_MIPS_GOT16 .bss
+...
+0+018c <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+018c R_MIPS_LO16 .bss
+...
+0+0194 <[^>]*> addiu \$at,\$at,1
+0+0198 <[^>]*> lwl \$a0,0\(\$at\)
+0+019c <[^>]*> lwr \$a0,3\(\$at\)
+0+01a0 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+01a0 R_MIPS_GOT16 .bss
+...
+0+01a8 <[^>]*> addiu \$at,\$at,1000
+[ ]*RELOC: 0+01a8 R_MIPS_LO16 .bss
+...
+0+01b0 <[^>]*> addiu \$at,\$at,1
+0+01b4 <[^>]*> sb \$a0,1\(\$at\)
+0+01b8 <[^>]*> srl \$a0,\$a0,0x8
+0+01bc <[^>]*> sb \$a0,0\(\$at\)
+0+01c0 <[^>]*> lbu \$at,1\(\$at\)
+0+01c4 <[^>]*> sll \$a0,\$a0,0x8
+0+01c8 <[^>]*> or \$a0,\$a0,\$at
+...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mri/immconst.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mri/immconst.d
new file mode 100644
index 00000000000..531affdf7c7
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mri/immconst.d
@@ -0,0 +1,22 @@
+#objdump: -d
+#name: MRI immediate constants
+#as: -M
+#source: constants.s
+
+# Test MRI immediate constants
+
+.*: file format .*
+
+Disassembly of section .text:
+0+000 <foo> moveq #10,%d0
+0+002 <foo\+2> moveq #10,%d0
+0+004 <foo\+4> moveq #10,%d0
+0+006 <foo\+6> moveq #10,%d0
+0+008 <foo\+8> moveq #10,%d0
+0+00a <foo\+a> moveq #10,%d0
+0+00c <foo\+c> moveq #10,%d0
+0+00e <foo\+e> moveq #10,%d0
+0+010 <foo\+10> moveq #10,%d0
+0+012 <foo\+12> moveq #97,%d0
+0+014 <foo\+14> moveq #97,%d0
+0+016 <foo\+16> nop
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mism-1.s b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mism-1.s
new file mode 100644
index 00000000000..fac5e482704
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mism-1.s
@@ -0,0 +1,22 @@
+! Test architecture mismatch warnings.
+! We don't test every possible mismatch, we just want to be reasonable sure
+! the mismatch checking code works.
+!
+! { dg-do assemble { target sparc*-*-* } }
+! { dg-options -Av6 }
+
+! sparclite
+
+ divscc %g1,%g2,%g3 ! { dg-error "mismatch|sparclite" "sparclite divscc mismatch" }
+
+ scan %g1,%g2,%g3 ! { dg-error "mismatch|sparclite" "sparclite scan mismatch" }
+
+! v9
+
+ movrz %g1,%g2,%g3 ! { dg-error "mismatch|v9" "v9 fp reg mismatch" }
+
+! v9a
+
+ shutdown ! { dg-error "mismatch|v9a" "v9a shutdown mismatch" }
+
+foo:
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mismatch.exp b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mismatch.exp
new file mode 100644
index 00000000000..6f89de2a244
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mismatch.exp
@@ -0,0 +1,20 @@
+# Test architecture mismatch errors.
+#
+# GAS issues two lines of error text for each mismatch:
+#
+# mm-lite.s:7: Error: Architecture mismatch on "divscc".
+# mm-lite.s:7: (Requires sparclite; requested architecture is v8.)
+#
+# The suggested regexp argument to dg-error is "mismatch|<arch>".
+
+if [istarget sparc*-*-*] {
+
+ load_lib gas-dg.exp
+
+ dg-init
+
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/mism-*.s]] "" ""
+
+ dg-finish
+
+}
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.d b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.d
new file mode 100644
index 00000000000..cee258eeaac
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.d
@@ -0,0 +1,169 @@
+#as: -Asparclet
+#objdump: -dr
+#name: sparclet extensions
+
+.*: +file format .*
+
+Disassembly of section .text:
+0+0000 <start> rd %y, %l0
+0+0004 <start\+4> rd %asr1, %l0
+0+0008 <start\+8> rd %asr15, %l0
+0+000c <start\+c> rd %asr17, %l0
+0+0010 <start\+10> rd %asr18, %l0
+0+0014 <start\+14> rd %asr19, %l0
+0+0018 <start\+18> rd %asr20, %l0
+0+001c <start\+1c> rd %asr21, %l0
+0+0020 <start\+20> rd %asr22, %l0
+0+0024 <start\+24> mov %l0, %y
+0+0028 <start\+28> mov %l0, %asr1
+0+002c <start\+2c> mov %l0, %asr15
+0+0030 <start\+30> mov %l0, %asr17
+0+0034 <start\+34> mov %l0, %asr18
+0+0038 <start\+38> mov %l0, %asr19
+0+003c <start\+3c> mov %l0, %asr20
+0+0040 <start\+40> mov %l0, %asr21
+0+0044 <start\+44> mov %l0, %asr22
+0+0048 <test_umul> umul %g1, %g2, %g3
+0+004c <test_umul\+4> umul %g1, %g2, %g3
+0+0050 <test_smul> smul %g1, %g2, %g3
+0+0054 <test_smul\+4> smul %g1, %g2, %g3
+0+0058 <test_stbar> stbar
+0+005c <test_stbar\+4> stbar
+0+0060 <test_stbar\+8> unimp 0x1
+0+0064 <test_stbar\+c> flush %l1
+0+0068 <test_scan> scan %l1, -1, %l3
+0+006c <test_scan\+4> scan %l1, 0, %l3
+0+0070 <test_scan\+8> scan %l1, %l1, %l3
+0+0074 <test_shuffle> shuffle %l0, 1, %l1
+0+0078 <test_shuffle\+4> shuffle %l0, 2, %l1
+0+007c <test_shuffle\+8> shuffle %l0, 4, %l1
+0+0080 <test_shuffle\+c> shuffle %l0, 8, %l1
+0+0084 <test_shuffle\+10> shuffle %l0, 0x10, %l1
+0+0088 <test_shuffle\+14> shuffle %l0, 0x18, %l1
+0+008c <test_umac> umac %l1, %l2, %l0
+0+0090 <test_umac\+4> umac %l1, 2, %l0
+0+0094 <test_umac\+8> umac %l1, 2, %l0
+0+0098 <test_umacd> umacd %l2, %l4, %l0
+0+009c <test_umacd\+4> umacd %l2, 3, %l0
+0+00a0 <test_umacd\+8> umacd %l2, 3, %l0
+0+00a4 <test_smac> smac %l1, %l2, %l0
+0+00a8 <test_smac\+4> smac %l1, -42, %l0
+0+00ac <test_smac\+8> smac %l1, -42, %l0
+0+00b0 <test_smacd> smacd %l2, %l4, %l0
+0+00b4 <test_smacd\+4> smacd %l2, 0x7b, %l0
+0+00b8 <test_smacd\+8> smacd %l2, 0x7b, %l0
+0+00bc <test_umuld> umuld %o2, %o4, %o0
+0+00c0 <test_umuld\+4> umuld %o2, 0x234, %o0
+0+00c4 <test_umuld\+8> umuld %o2, 0x567, %o0
+0+00c8 <test_smuld> smuld %i2, %i4, %i0
+0+00cc <test_smuld\+4> smuld %i2, -4096, %i0
+0+00d0 <test_smuld\+8> smuld %i4, 0xfff, %i0
+0+00d4 <test_coprocessor> cpush %l0, %l1
+0+00d8 <test_coprocessor\+4> cpush %l0, 1
+0+00dc <test_coprocessor\+8> cpusha %l0, %l1
+0+00e0 <test_coprocessor\+c> cpush %l0, 1
+0+00e4 <test_coprocessor\+10> cpull %l0
+0+00e8 <test_coprocessor\+14> crdcxt %ccsr, %l0
+0+00ec <test_coprocessor\+18> crdcxt %ccfr, %l0
+0+00f0 <test_coprocessor\+1c> crdcxt %ccpr, %l0
+0+00f4 <test_coprocessor\+20> crdcxt %cccrcr, %l0
+0+00f8 <test_coprocessor\+24> cwrcxt %l0, %ccsr
+0+00fc <test_coprocessor\+28> cwrcxt %l0, %ccfr
+0+0100 <test_coprocessor\+2c> cwrcxt %l0, %ccpr
+0+0104 <test_coprocessor\+30> cwrcxt %l0, %cccrcr
+0+0108 <test_coprocessor\+34> cbn 0000010c <test_coprocessor\+38>
+.*RELOC: 0+0108 WDISP22 stop\+0xfffffef8
+0+010c <test_coprocessor\+38> nop
+0+0110 <test_coprocessor\+3c> cbn,a 00000114 <test_coprocessor\+40>
+.*RELOC: 0+0110 WDISP22 stop\+0xfffffef0
+0+0114 <test_coprocessor\+40> nop
+0+0118 <test_coprocessor\+44> cbe 0000011c <test_coprocessor\+48>
+.*RELOC: 0+0118 WDISP22 stop\+0xfffffee8
+0+011c <test_coprocessor\+48> nop
+0+0120 <test_coprocessor\+4c> cbe,a 00000124 <test_coprocessor\+50>
+.*RELOC: 0+0120 WDISP22 stop\+0xfffffee0
+0+0124 <test_coprocessor\+50> nop
+0+0128 <test_coprocessor\+54> cbf 0000012c <test_coprocessor\+58>
+.*RELOC: 0+0128 WDISP22 stop\+0xfffffed8
+0+012c <test_coprocessor\+58> nop
+0+0130 <test_coprocessor\+5c> cbf,a 00000134 <test_coprocessor\+60>
+.*RELOC: 0+0130 WDISP22 stop\+0xfffffed0
+0+0134 <test_coprocessor\+60> nop
+0+0138 <test_coprocessor\+64> cbef 0000013c <test_coprocessor\+68>
+.*RELOC: 0+0138 WDISP22 stop\+0xfffffec8
+0+013c <test_coprocessor\+68> nop
+0+0140 <test_coprocessor\+6c> cbef,a 00000144 <test_coprocessor\+70>
+.*RELOC: 0+0140 WDISP22 stop\+0xfffffec0
+0+0144 <test_coprocessor\+70> nop
+0+0148 <test_coprocessor\+74> cbr 0000014c <test_coprocessor\+78>
+.*RELOC: 0+0148 WDISP22 stop\+0xfffffeb8
+0+014c <test_coprocessor\+78> nop
+0+0150 <test_coprocessor\+7c> cbr,a 00000154 <test_coprocessor\+80>
+.*RELOC: 0+0150 WDISP22 stop\+0xfffffeb0
+0+0154 <test_coprocessor\+80> nop
+0+0158 <test_coprocessor\+84> cber 0000015c <test_coprocessor\+88>
+.*RELOC: 0+0158 WDISP22 stop\+0xfffffea8
+0+015c <test_coprocessor\+88> nop
+0+0160 <test_coprocessor\+8c> cber,a 00000164 <test_coprocessor\+90>
+.*RELOC: 0+0160 WDISP22 stop\+0xfffffea0
+0+0164 <test_coprocessor\+90> nop
+0+0168 <test_coprocessor\+94> cbfr 0000016c <test_coprocessor\+98>
+.*RELOC: 0+0168 WDISP22 stop\+0xfffffe98
+0+016c <test_coprocessor\+98> nop
+0+0170 <test_coprocessor\+9c> cbfr,a 00000174 <test_coprocessor\+a0>
+.*RELOC: 0+0170 WDISP22 stop\+0xfffffe90
+0+0174 <test_coprocessor\+a0> nop
+0+0178 <test_coprocessor\+a4> cbefr 0000017c <test_coprocessor\+a8>
+.*RELOC: 0+0178 WDISP22 stop\+0xfffffe88
+0+017c <test_coprocessor\+a8> nop
+0+0180 <test_coprocessor\+ac> cbefr,a 00000184 <test_coprocessor\+b0>
+.*RELOC: 0+0180 WDISP22 stop\+0xfffffe80
+0+0184 <test_coprocessor\+b0> nop
+0+0188 <test_coprocessor\+b4> cba 0000018c <test_coprocessor\+b8>
+.*RELOC: 0+0188 WDISP22 stop\+0xfffffe78
+0+018c <test_coprocessor\+b8> nop
+0+0190 <test_coprocessor\+bc> cba,a 00000194 <test_coprocessor\+c0>
+.*RELOC: 0+0190 WDISP22 stop\+0xfffffe70
+0+0194 <test_coprocessor\+c0> nop
+0+0198 <test_coprocessor\+c4> cbne 0000019c <test_coprocessor\+c8>
+.*RELOC: 0+0198 WDISP22 stop\+0xfffffe68
+0+019c <test_coprocessor\+c8> nop
+0+01a0 <test_coprocessor\+cc> cbne,a 000001a4 <test_coprocessor\+d0>
+.*RELOC: 0+01a0 WDISP22 stop\+0xfffffe60
+0+01a4 <test_coprocessor\+d0> nop
+0+01a8 <test_coprocessor\+d4> cbnf 000001ac <test_coprocessor\+d8>
+.*RELOC: 0+01a8 WDISP22 stop\+0xfffffe58
+0+01ac <test_coprocessor\+d8> nop
+0+01b0 <test_coprocessor\+dc> cbnf,a 000001b4 <test_coprocessor\+e0>
+.*RELOC: 0+01b0 WDISP22 stop\+0xfffffe50
+0+01b4 <test_coprocessor\+e0> nop
+0+01b8 <test_coprocessor\+e4> cbnef 000001bc <test_coprocessor\+e8>
+.*RELOC: 0+01b8 WDISP22 stop\+0xfffffe48
+0+01bc <test_coprocessor\+e8> nop
+0+01c0 <test_coprocessor\+ec> cbnef,a 000001c4 <test_coprocessor\+f0>
+.*RELOC: 0+01c0 WDISP22 stop\+0xfffffe40
+0+01c4 <test_coprocessor\+f0> nop
+0+01c8 <test_coprocessor\+f4> cbnr 000001cc <test_coprocessor\+f8>
+.*RELOC: 0+01c8 WDISP22 stop\+0xfffffe38
+0+01cc <test_coprocessor\+f8> nop
+0+01d0 <test_coprocessor\+fc> cbnr,a 000001d4 <test_coprocessor\+100>
+.*RELOC: 0+01d0 WDISP22 stop\+0xfffffe30
+0+01d4 <test_coprocessor\+100> nop
+0+01d8 <test_coprocessor\+104> cbner 000001dc <test_coprocessor\+108>
+.*RELOC: 0+01d8 WDISP22 stop\+0xfffffe28
+0+01dc <test_coprocessor\+108> nop
+0+01e0 <test_coprocessor\+10c> cbner,a 000001e4 <test_coprocessor\+110>
+.*RELOC: 0+01e0 WDISP22 stop\+0xfffffe20
+0+01e4 <test_coprocessor\+110> nop
+0+01e8 <test_coprocessor\+114> cbnfr 000001ec <test_coprocessor\+118>
+.*RELOC: 0+01e8 WDISP22 stop\+0xfffffe18
+0+01ec <test_coprocessor\+118> nop
+0+01f0 <test_coprocessor\+11c> cbnfr,a 000001f4 <test_coprocessor\+120>
+.*RELOC: 0+01f0 WDISP22 stop\+0xfffffe10
+0+01f4 <test_coprocessor\+120> nop
+0+01f8 <test_coprocessor\+124> cbnefr 000001fc <test_coprocessor\+128>
+.*RELOC: 0+01f8 WDISP22 stop\+0xfffffe08
+0+01fc <test_coprocessor\+128> nop
+0+0200 <test_coprocessor\+12c> cbnefr,a 00000204 <test_coprocessor\+130>
+.*RELOC: 0+0200 WDISP22 stop\+0xfffffe00
+0+0204 <test_coprocessor\+130> nop
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.s b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.s
new file mode 100644
index 00000000000..0dfd5074bde
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.s
@@ -0,0 +1,211 @@
+ .text
+ .global start
+
+! Starting point
+start:
+
+! test all ASRs
+
+ rd %asr0, %l0
+ rd %asr1, %l0
+ rd %asr15, %l0
+ rd %asr17, %l0
+ rd %asr18, %l0
+ rd %asr19, %l0 ! should stop the processor
+ rd %asr20, %l0
+ rd %asr21, %l0
+ rd %asr22, %l0
+
+ wr %l0, 0, %asr0
+ wr %l0, 0, %asr1
+ wr %l0, 0, %asr15
+ wr %l0, 0, %asr17
+ wr %l0, 0, %asr18
+ wr %l0, 0, %asr19
+ wr %l0, 0, %asr20
+ wr %l0, 0, %asr21
+ wr %l0, 0, %asr22
+
+! test UMUL with no overflow inside Y
+test_umul:
+ umul %g1, %g2, %g3
+
+! test UMUL with an overflow inside Y
+
+ umul %g1, %g2, %g3 ! %g3 must be equal to 0
+
+! test SMUL with negative result
+test_smul:
+ smul %g1, %g2, %g3
+
+! test SMUL with positive result
+
+ smul %g1, %g2, %g3
+
+! test STBAR: there are two possible syntaxes
+test_stbar:
+ stbar ! is a valid V8 syntax, at least a synthetic
+ ! instruction
+ rd %asr15, %g0 ! other solution
+
+! test UNIMP
+ unimp 1
+
+! test FLUSH
+ flush %l1 ! is the official V8 syntax
+
+! test SCAN: find first 0
+test_scan:
+ scan %l1, 0xffffffff, %l3
+
+! test scan: find first 1
+
+ scan %l1, 0, %l3
+
+! test scan: find first bit != bit-0
+
+ scan %l1, %l1, %l3
+
+! test SHUFFLE
+test_shuffle:
+ shuffle %l0, 0x1, %l1
+ shuffle %l0, 0x2, %l1
+ shuffle %l0, 0x4, %l1
+ shuffle %l0, 0x8, %l1
+ shuffle %l0, 0x10, %l1
+ shuffle %l0, 0x18, %l1
+
+! test UMAC
+test_umac:
+ umac %l1, %l2, %l0
+ umac %l1, 2, %l0
+ umac 2, %l1, %l0
+
+! test UMACD
+test_umacd:
+ umacd %l2, %l4, %l0
+ umacd %l2, 3, %l0
+ umacd 3, %l2, %l0
+
+! test SMAC
+test_smac:
+ smac %l1, %l2, %l0
+ smac %l1, -42, %l0
+ smac -42, %l1, %l0
+
+! test SMACD
+test_smacd:
+ smacd %l2, %l4, %l0
+ smacd %l2, 123, %l0
+ smacd 123, %l2, %l0
+
+! test UMULD
+test_umuld:
+ umuld %o2, %o4, %o0
+ umuld %o2, 0x234, %o0
+ umuld 0x567, %o2, %o0
+
+! test SMULD
+test_smuld:
+ smuld %i2, %i4, %i0
+ smuld %i2, -4096, %i0
+ smuld 4095, %i4, %i0
+
+! Coprocessor instructions
+test_coprocessor:
+! %ccsr is register # 0
+! %ccfr is register # 1
+! %ccpr is register # 3
+! %cccrcr is register # 2
+
+! test CPUSH: just syntax
+
+ cpush %l0, %l1
+ cpush %l0, 1
+ cpusha %l0, %l1
+ cpusha %l0, 1
+
+! test CPULL: just syntax
+
+ cpull %l0
+
+! test CPRDCXT: just syntax
+
+ crdcxt %ccsr, %l0
+ crdcxt %ccfr, %l0
+ crdcxt %ccpr, %l0
+ crdcxt %cccrcr, %l0
+
+! test CPWRCXT: just syntax
+
+ cwrcxt %l0, %ccsr
+ cwrcxt %l0, %ccfr
+ cwrcxt %l0, %ccpr
+ cwrcxt %l0, %cccrcr
+
+! test CBccc: just syntax
+
+ cbn stop
+ nop
+ cbn,a stop
+ nop
+ cbe stop
+ nop
+ cbe,a stop
+ nop
+ cbf stop
+ nop
+ cbf,a stop
+ nop
+ cbef stop
+ nop
+ cbef,a stop
+ nop
+ cbr stop
+ nop
+ cbr,a stop
+ nop
+ cber stop
+ nop
+ cber,a stop
+ nop
+ cbfr stop
+ nop
+ cbfr,a stop
+ nop
+ cbefr stop
+ nop
+ cbefr,a stop
+ nop
+ cba stop
+ nop
+ cba,a stop
+ nop
+ cbne stop
+ nop
+ cbne,a stop
+ nop
+ cbnf stop
+ nop
+ cbnf,a stop
+ nop
+ cbnef stop
+ nop
+ cbnef,a stop
+ nop
+ cbnr stop
+ nop
+ cbnr,a stop
+ nop
+ cbner stop
+ nop
+ cbner,a stop
+ nop
+ cbnfr stop
+ nop
+ cbnfr,a stop
+ nop
+ cbnefr stop
+ nop
+ cbnefr,a stop
+ nop
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.d b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.d
new file mode 100644
index 00000000000..5fc1be8817a
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.d
@@ -0,0 +1,11 @@
+#as: -Av7
+#objdump: -dr
+#name: sparc synth
+
+.*: +file format .*
+
+Disassembly of section .text:
+0+0000 <foo> xnor %g1, %g0, %g2
+0+0004 <foo\+4> xnor %g1, %g0, %g1
+0+0008 <foo\+8> neg %g1, %g2
+0+000c <foo\+c> neg %g1
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.s b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.s
new file mode 100644
index 00000000000..9e066289487
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.s
@@ -0,0 +1,7 @@
+# common (v8 or v9) synthetic insns
+ .text
+foo:
+ not %g1,%g2
+ not %g1
+ neg %g1,%g2
+ neg %g1