This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] MIPS16/GAS: Restore unsupported relocation diagnostics


Correct a MIPS16 relocation handling regression in GAS introduced with:

commit 177b4a6ad0047c8995fbc55016bc4f4b68d53b4a
Author: Alexandre Oliva <aoliva@redhat.com>
Date:   Mon Mar 18 18:56:18 2002 +0000

discussed at <https://sourceware.org/ml/binutils/2002-03/msg00345.html>, 
which removed a preparatory call to `mips16_extended_frag' previously 
made from `md_estimate_size_before_relax'.  As a result the function is 
never called with its `sec' parameter non-NULL and consequently all the 
unsupported relocation checks within are dead and never trigger, causing 
any unhandled relocations to silently resolve to 0.  Unfortunately there
was no sufficient test suite coverage back then to catch this.

Remove all dead code then, and all the associated comments.  Update the 
remaining call to `mips16_extended_frag' from `mips_relax_frag' to pass 
the relocation section as the `sec' parameter and use it to mark frags 
which require an external relocation, as extended.  Finally handle any 
outstanding MIPS16 relocations in `md_convert_frag' and report an error 
since we don't support any except with percent operators.

	gas/
	* config/tc-mips.c (append_insn): Use any `O_symbol' expression 
	unchanged with relaxed MIPS16 instructions.
	(mips16_extended_frag): Adjust accordingly.  Return 1 right
	away if a relocation will be required for the symbol requested.
	Remove dead first relaxation pass code.
	(mips_relax_frag): Pass `sec' down to `mips16_extended_frag'.
	(md_convert_frag): Adjust symbol value calculation.  Raise an 
	error if a relocation is required for the symbol requested.
	* testsuite/gas/mips/mips16@relax-swap3.d: Remove dump patterns,
	add error output.
	* testsuite/gas/mips/mips16@relax-swap3.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-relax-0.d: New test.
	* testsuite/gas/mips/mips16-pcrel-relax-1.d: New test.
	* testsuite/gas/mips/mips16-pcrel-relax-2.d: New test.
	* testsuite/gas/mips/mips16-pcrel-relax-3.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-0.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-1.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-2.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-3.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-4.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-5.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-6.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-7.d: New test.
	* testsuite/gas/mips/mips16-pcrel-addend-0.d: New test.
	* testsuite/gas/mips/mips16-pcrel-addend-1.d: New test.
	* testsuite/gas/mips/mips16-pcrel-addend-2.d: New test.
	* testsuite/gas/mips/mips16-pcrel-addend-3.d: New test.
	* testsuite/gas/mips/mips16-pcrel-absolute.d: New test.
	* testsuite/gas/mips/mips16-branch-reloc-0.d: New test.
	* testsuite/gas/mips/mips16-branch-reloc-1.d: New test.
	* testsuite/gas/mips/mips16-branch-reloc-2.d: New test.
	* testsuite/gas/mips/mips16-branch-reloc-3.d: New test.
	* testsuite/gas/mips/mips16-branch-addend-0.d: New test.
	* testsuite/gas/mips/mips16-branch-addend-1.d: New test.
	* testsuite/gas/mips/mips16-branch-addend-2.d: New test.
	* testsuite/gas/mips/mips16-branch-addend-3.d: New test.
	* testsuite/gas/mips/mips16-branch-absolute.d: New test.
	* testsuite/gas/mips/mips16-absolute-reloc-0.d: New test.
	* testsuite/gas/mips/mips16-absolute-reloc-1.d: New test.
	* testsuite/gas/mips/mips16-absolute-reloc-2.d: New test.
	* testsuite/gas/mips/mips16-absolute-reloc-3.d: New test.
	* testsuite/gas/mips/mips16-pcrel-reloc-2.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-reloc-3.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-reloc-6.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-reloc-7.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-addend-2.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-addend-3.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-absolute.l: New error output.
	* testsuite/gas/mips/mips16-branch-reloc-2.l: New error output.
	* testsuite/gas/mips/mips16-branch-reloc-3.l: New error output.
	* testsuite/gas/mips/mips16-branch-addend-2.l: New error output.
	* testsuite/gas/mips/mips16-branch-addend-3.l: New error output.
	* testsuite/gas/mips/mips16-branch-absolute.l: New error output.
	* testsuite/gas/mips/mips16-absolute-reloc-2.l: New error output.
	* testsuite/gas/mips/mips16-absolute-reloc-3.l: New error output.
	* testsuite/gas/mips/mips16-pcrel-relax-0.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-relax-2.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-0.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-1.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-2.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-3.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-4.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-5.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-6.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-reloc-7.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-addend-0.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-addend-1.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-addend-2.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-addend-3.s: New test source.
	* testsuite/gas/mips/mips16-pcrel-absolute.s: New test source.
	* testsuite/gas/mips/mips16-branch-reloc-0.s: New test source.
	* testsuite/gas/mips/mips16-branch-reloc-1.s: New test source.
	* testsuite/gas/mips/mips16-branch-reloc-2.s: New test source.
	* testsuite/gas/mips/mips16-branch-reloc-3.s: New test source.
	* testsuite/gas/mips/mips16-branch-addend-0.s: New test source.
	* testsuite/gas/mips/mips16-branch-addend-1.s: New test source.
	* testsuite/gas/mips/mips16-branch-addend-2.s: New test source.
	* testsuite/gas/mips/mips16-branch-addend-3.s: New test source.
	* testsuite/gas/mips/mips16-branch-absolute.s: New test source.
	* testsuite/gas/mips/mips16-absolute-reloc-0.s: New test source.
	* testsuite/gas/mips/mips16-absolute-reloc-1.s: New test source.
	* testsuite/gas/mips/mips16-absolute-reloc-2.s: New test source.
	* testsuite/gas/mips/mips16-absolute-reloc-3.s: New test source.
	* testsuite/gas/mips/mips.exp: Run the new tests.
---
binutils-mips16-gas-reloc-err.diff
Index: binutils/gas/config/tc-mips.c
===================================================================
--- binutils.orig/gas/config/tc-mips.c	2016-06-24 21:46:00.749958544 +0100
+++ binutils/gas/config/tc-mips.c	2016-06-25 00:27:09.811749795 +0100
@@ -7307,15 +7307,31 @@ append_insn (struct mips_cl_insn *ip, ex
     }
   else if (mips_opts.mips16 && *reloc_type > BFD_RELOC_UNUSED)
     {
+      symbolS *symbol;
+      offsetT offset;
+
       /* We need to set up a variant frag.  */
       gas_assert (address_expr != NULL);
+      /* Pass any `O_symbol' expression unchanged as an `expr_section'
+         symbol created by `make_expr_symbol' may not get a necessary
+         external relocation produced.  */
+      if (address_expr->X_op == O_symbol)
+	{
+	  symbol = address_expr->X_add_symbol;
+	  offset = address_expr->X_add_number;
+	}
+      else
+	{
+	  symbol = make_expr_symbol (address_expr);
+	  offset = 0;
+	}
       add_relaxed_insn (ip, 4, 0,
 			RELAX_MIPS16_ENCODE
 			(*reloc_type - BFD_RELOC_UNUSED,
 			 forced_insn_length == 2, forced_insn_length == 4,
 			 delayed_branch_p (&history[0]),
 			 history[0].mips16_absolute_jump_p),
-			make_expr_symbol (address_expr), 0);
+			symbol, offset);
     }
   else if (mips_opts.mips16 && insn_length (ip) == 2)
     {
@@ -16731,12 +16747,17 @@ mips16_extended_frag (fragS *fragp, asec
   if (RELAX_MIPS16_USER_EXT (fragp->fr_subtype))
     return 1;
 
+  symsec = S_GET_SEGMENT (fragp->fr_symbol);
   type = RELAX_MIPS16_TYPE (fragp->fr_subtype);
   operand = mips16_immed_operand (type, FALSE);
+  if (S_FORCE_RELOC (fragp->fr_symbol, TRUE)
+      || (operand->root.type == OP_PCREL
+	  ? sec != symsec
+	  : !bfd_is_abs_section (symsec)))
+    return 1;
 
   sym_frag = symbol_get_frag (fragp->fr_symbol);
-  val = S_GET_VALUE (fragp->fr_symbol);
-  symsec = S_GET_SEGMENT (fragp->fr_symbol);
+  val = S_GET_VALUE (fragp->fr_symbol) + fragp->fr_offset;
 
   if (operand->root.type == OP_PCREL)
     {
@@ -16744,47 +16765,16 @@ mips16_extended_frag (fragS *fragp, asec
       addressT addr;
       offsetT maxtiny;
 
-      /* We won't have the section when we are called from
-         mips_relax_frag.  However, we will always have been called
-         from md_estimate_size_before_relax first.  If this is a
-         branch to a different section, we mark it as such.  If SEC is
-         NULL, and the frag is not marked, then it must be a branch to
-         the same section.  */
-      pcrel_op = (const struct mips_pcrel_operand *) operand;
-      if (sec == NULL)
-	{
-	  if (RELAX_MIPS16_LONG_BRANCH (fragp->fr_subtype))
-	    return 1;
-	}
-      else
-	{
-	  /* Must have been called from md_estimate_size_before_relax.  */
-	  if (symsec != sec)
-	    {
-	      fragp->fr_subtype =
-		RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype);
-
-	      /* FIXME: We should support this, and let the linker
-                 catch branches and loads that are out of range.  */
-	      as_bad_where (fragp->fr_file, fragp->fr_line,
-			    _("unsupported PC relative reference to different section"));
+      if (RELAX_MIPS16_LONG_BRANCH (fragp->fr_subtype))
+	return 1;
 
-	      return 1;
-	    }
-	  if (fragp != sym_frag && sym_frag->fr_address == 0)
-	    /* Assume non-extended on the first relaxation pass.
-	       The address we have calculated will be bogus if this is
-	       a forward branch to another frag, as the forward frag
-	       will have fr_address == 0.  */
-	    return 0;
-	}
+      pcrel_op = (const struct mips_pcrel_operand *) operand;
 
-      /* In this case, we know for sure that the symbol fragment is in
-	 the same section.  If the relax_marker of the symbol fragment
-	 differs from the relax_marker of this fragment, we have not
-	 yet adjusted the symbol fragment fr_address.  We want to add
-	 in STRETCH in order to get a better estimate of the address.
-	 This particularly matters because of the shift bits.  */
+      /* If the relax_marker of the symbol fragment differs from the
+	 relax_marker of this fragment, we have not yet adjusted the
+	 symbol fragment fr_address.  We want to add in STRETCH in
+	 order to get a better estimate of the address.  This
+	 particularly matters because of the shift bits.  */
       if (stretch != 0
 	  && sym_frag->relax_marker != fragp->relax_marker)
 	{
@@ -16844,9 +16834,8 @@ mips16_extended_frag (fragS *fragp, asec
       /* If any of the shifted bits are set, we must use an extended
          opcode.  If the address depends on the size of this
          instruction, this can lead to a loop, so we arrange to always
-         use an extended opcode.  We only check this when we are in
-         the main relaxation loop, when SEC is NULL.  */
-      if ((val & ((1 << operand->shift) - 1)) != 0 && sec == NULL)
+         use an extended opcode.  */
+      if ((val & ((1 << operand->shift) - 1)) != 0)
 	{
 	  fragp->fr_subtype =
 	    RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype);
@@ -16867,16 +16856,13 @@ mips16_extended_frag (fragS *fragp, asec
 	 extended with the next value above maxtiny.  */
       maxtiny = mips_int_operand_max (operand);
       if (val == maxtiny + (1 << operand->shift)
-	  && ! RELAX_MIPS16_EXTENDED (fragp->fr_subtype)
-	  && sec == NULL)
+	  && ! RELAX_MIPS16_EXTENDED (fragp->fr_subtype))
 	{
 	  fragp->fr_subtype =
 	    RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype);
 	  return 1;
 	}
     }
-  else if (symsec != absolute_section && sec != NULL)
-    as_bad_where (fragp->fr_file, fragp->fr_line, _("unsupported relocation"));
 
   return !mips16_immed_in_range_p (operand, BFD_RELOC_UNUSED, val);
 }
@@ -17367,7 +17353,7 @@ mips_relax_frag (asection *sec, fragS *f
   if (! RELAX_MIPS16_P (fragp->fr_subtype))
     return 0;
 
-  if (mips16_extended_frag (fragp, NULL, stretch))
+  if (mips16_extended_frag (fragp, sec, stretch))
     {
       if (RELAX_MIPS16_EXTENDED (fragp->fr_subtype))
 	return 0;
@@ -17820,12 +17806,13 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNU
       unsigned int user_length, length;
       unsigned long insn;
       bfd_boolean ext;
+      segT symsec;
 
       type = RELAX_MIPS16_TYPE (fragp->fr_subtype);
       operand = mips16_immed_operand (type, FALSE);
 
       ext = RELAX_MIPS16_EXTENDED (fragp->fr_subtype);
-      val = resolve_symbol_value (fragp->fr_symbol);
+      val = resolve_symbol_value (fragp->fr_symbol) + fragp->fr_offset;
       if (operand->root.type == OP_PCREL)
 	{
 	  const struct mips_pcrel_operand *pcrel_op;
@@ -17878,8 +17865,16 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNU
       else
 	user_length = 0;
 
-      mips16_immed (fragp->fr_file, fragp->fr_line, type,
-		    BFD_RELOC_UNUSED, val, user_length, &insn);
+      symsec = S_GET_SEGMENT (fragp->fr_symbol);
+      if (S_FORCE_RELOC (fragp->fr_symbol, TRUE)
+	  || (operand->root.type == OP_PCREL
+	      ? asec != symsec
+	      : !bfd_is_abs_section (symsec)))
+	as_bad_where (fragp->fr_file, fragp->fr_line,
+		      _("unsupported relocation"));
+      else
+	mips16_immed (fragp->fr_file, fragp->fr_line, type,
+		      BFD_RELOC_UNUSED, val, user_length, &insn);
 
       length = (ext ? 4 : 2);
       gas_assert (mips16_opcode_length (insn) == length);
Index: binutils/gas/testsuite/gas/mips/mips.exp
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/mips.exp	2016-06-25 00:37:34.498279199 +0100
+++ binutils/gas/testsuite/gas/mips/mips.exp	2016-06-25 00:37:39.377497484 +0100
@@ -1335,6 +1335,37 @@ if { [istarget mips*-*-vxworks*] } {
     run_list_test "pcrel-reloc-6" "-32 --defsym offset=4" \
 	"MIPS local PC-relative relocations 6b"
 
+    run_dump_test "mips16-pcrel-relax-0"
+    run_dump_test "mips16-pcrel-relax-1"
+    run_dump_test "mips16-pcrel-relax-2"
+    run_dump_test "mips16-pcrel-relax-3"
+    run_dump_test "mips16-pcrel-reloc-0"
+    run_dump_test "mips16-pcrel-reloc-1"
+    run_dump_test "mips16-pcrel-reloc-2"
+    run_dump_test "mips16-pcrel-reloc-3"
+    run_dump_test "mips16-pcrel-reloc-4"
+    run_dump_test "mips16-pcrel-reloc-5"
+    run_dump_test "mips16-pcrel-reloc-6"
+    run_dump_test "mips16-pcrel-reloc-7"
+    run_dump_test "mips16-pcrel-addend-0"
+    run_dump_test "mips16-pcrel-addend-1"
+    run_dump_test "mips16-pcrel-addend-2"
+    run_dump_test "mips16-pcrel-addend-3"
+    run_dump_test "mips16-pcrel-absolute"
+    run_dump_test "mips16-branch-reloc-0"
+    run_dump_test "mips16-branch-reloc-1"
+    run_dump_test "mips16-branch-reloc-2"
+    run_dump_test "mips16-branch-reloc-3"
+    run_dump_test "mips16-branch-addend-0"
+    run_dump_test "mips16-branch-addend-1"
+    run_dump_test "mips16-branch-addend-2"
+    run_dump_test "mips16-branch-addend-3"
+    run_dump_test "mips16-branch-absolute"
+    run_dump_test "mips16-absolute-reloc-0"
+    run_dump_test "mips16-absolute-reloc-1"
+    run_dump_test "mips16-absolute-reloc-2"
+    run_dump_test "mips16-absolute-reloc-3"
+
     run_dump_test_arches "attr-gnu-4-0" "-32" \
 				    [mips_arch_list_matching mips1]
     run_dump_test_arches "attr-gnu-4-0" "-64" \
Index: binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-0.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-0.d	2016-06-25 00:37:39.396659391 +0100
@@ -0,0 +1,12 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 absolute relocation 0
+#as: -32
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> 6806      	li	s0,6
+[0-9a-f]+ <[^>]*> f222 0414 	addiu	a0,sp,4660
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-0.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-0.s	2016-06-25 00:37:39.418864298 +0100
@@ -0,0 +1,17 @@
+	.text
+
+	.space	0x1000
+
+	.globl	foo
+	.ent	foo
+	.set	mips16
+foo:
+	li	$16, 1f - .
+	addiu	$4, $29, 0x1234
+1:
+	nop
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-1.d	2016-06-25 00:37:39.445085057 +0100
@@ -0,0 +1,12 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 absolute relocation 1
+#as: -32 -mips3
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> fd06      	daddiu	s0,6
+[0-9a-f]+ <[^>]*> f222 ff94 	daddiu	a0,sp,4660
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-1.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-1.s	2016-06-25 00:37:39.460202077 +0100
@@ -0,0 +1,17 @@
+	.text
+
+	.space	0x1000
+
+	.globl	foo
+	.ent	foo
+	.set	mips16
+foo:
+	daddiu	$16, 1f - .
+	daddiu	$4, $29, 0x1234
+1:
+	nop
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-2.d	2016-06-25 00:37:39.500448047 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 absolute relocation 2
+#as: -32
+#error-output: mips16-absolute-reloc-2.l
Index: binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-2.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-2.l	2016-06-25 00:37:39.524569181 +0100
@@ -0,0 +1,25 @@
+.*: Assembler messages:
+.*:9: Error: unsupported relocation
+.*:10: Error: unsupported relocation
+.*:11: Error: unsupported relocation
+.*:12: Error: unsupported relocation
+.*:13: Error: unsupported relocation
+.*:14: Error: unsupported relocation
+.*:15: Error: unsupported relocation
+.*:16: Error: unsupported relocation
+.*:17: Error: unsupported relocation
+.*:18: Error: unsupported relocation
+.*:19: Error: unsupported relocation
+.*:20: Error: unsupported relocation
+.*:21: Error: unsupported relocation
+.*:22: Error: unsupported relocation
+.*:23: Error: unsupported relocation
+.*:24: Error: unsupported relocation
+.*:25: Error: unsupported relocation
+.*:26: Error: unsupported relocation
+.*:27: Error: unsupported relocation
+.*:28: Error: unsupported relocation
+.*:29: Error: unsupported relocation
+.*:30: Error: unsupported relocation
+.*:31: Error: unsupported relocation
+.*:32: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-2.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-2.s	2016-06-25 00:37:39.535635241 +0100
@@ -0,0 +1,37 @@
+	.text
+
+	.space	0x1000
+
+	.globl	foo
+	.ent	foo
+	.set	mips16
+foo:
+	addiu	$2, bar
+	addiu	$2, $3, bar
+	addiu	$2, $pc, bar
+	addiu	$sp, bar
+	addiu	$2, $sp, bar
+	cmpi	$2, bar
+	lb	$2, bar($3)
+	lbu	$2, bar($3)
+	lh	$2, bar($3)
+	lhu	$2, bar($3)
+	li	$2, bar
+	lw	$2, bar($3)
+	lw	$2, bar($pc)
+	lw	$2, bar($sp)
+	sb	$2, bar($3)
+	sh	$2, bar($3)
+	sll	$2, $3, bar
+	slti	$2, bar
+	sltiu	$2, bar
+	sra	$2, $3, bar
+	srl	$2, $3, bar
+	sw	$2, bar($3)
+	sw	$2, bar($sp)
+	sw	$ra, bar($sp)
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-3.d	2016-06-25 00:37:39.554710179 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 absolute relocation 3
+#as: -32 -mips3
+#error-output: mips16-absolute-reloc-3.l
Index: binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-3.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-3.l	2016-06-25 00:37:39.571819050 +0100
@@ -0,0 +1,16 @@
+.*: Assembler messages:
+.*:9: Error: unsupported relocation
+.*:10: Error: unsupported relocation
+.*:11: Error: unsupported relocation
+.*:12: Error: unsupported relocation
+.*:13: Error: unsupported relocation
+.*:14: Error: unsupported relocation
+.*:15: Error: unsupported relocation
+.*:16: Error: unsupported relocation
+.*:17: Error: unsupported relocation
+.*:18: Error: unsupported relocation
+.*:19: Error: unsupported relocation
+.*:20: Error: unsupported relocation
+.*:21: Error: unsupported relocation
+.*:22: Error: unsupported relocation
+.*:23: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-3.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-absolute-reloc-3.s	2016-06-25 00:37:39.586892615 +0100
@@ -0,0 +1,28 @@
+	.text
+
+	.space	0x1000
+
+	.globl	foo
+	.ent	foo
+	.set	mips16
+foo:
+	daddiu	$2, bar
+	daddiu	$2, $3, bar
+	daddiu	$2, $pc, bar
+	daddiu	$sp, bar
+	daddiu	$2, $sp, bar
+	dsll	$2, $3, bar
+	dsra	$2, bar
+	dsrl	$2, bar
+	ld	$2, bar($3)
+	ld	$2, bar($pc)
+	ld	$2, bar($sp)
+	lwu	$2, bar($3)
+	sd	$2, bar($3)
+	sd	$2, bar($sp)
+	sd	$ra, bar($sp)
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-branch-absolute.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-absolute.d	2016-06-25 00:37:39.607988198 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 branch to absolute expression
+#as: -32
+#error-output: mips16-branch-absolute.l
Index: binutils/gas/testsuite/gas/mips/mips16-branch-absolute.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-absolute.l	2016-06-25 00:37:39.639229654 +0100
@@ -0,0 +1,6 @@
+.*: Assembler messages:
+.*:8: Error: unsupported relocation
+.*:9: Error: unsupported relocation
+.*:10: Error: unsupported relocation
+.*:11: Error: unsupported relocation
+.*:12: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-branch-absolute.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-absolute.s	2016-06-25 00:37:39.656526216 +0100
@@ -0,0 +1,21 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	b	bar
+	bteqz	bar
+	btnez	bar
+	beqz	$2, bar
+	bnez	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.set	bar, 0x1234
Index: binutils/gas/testsuite/gas/mips/mips16-branch-addend-0.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-addend-0.d	2016-06-25 00:37:39.678013804 +0100
@@ -0,0 +1,17 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 branch relocation with addend 0
+#as: -32
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> f121 1010 	b	00002264 <bar\+0x1234>
+[0-9a-f]+ <[^>]*> f121 600e 	bteqz	00002264 <bar\+0x1234>
+[0-9a-f]+ <[^>]*> f121 610c 	btnez	00002264 <bar\+0x1234>
+[0-9a-f]+ <[^>]*> f121 220a 	beqz	v0,00002264 <bar\+0x1234>
+[0-9a-f]+ <[^>]*> f121 2a08 	bnez	v0,00002264 <bar\+0x1234>
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-branch-addend-0.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-addend-0.s	2016-06-25 00:37:39.694302772 +0100
@@ -0,0 +1,30 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	b	bar + 0x1234
+	bteqz	bar + 0x1234
+	btnez	bar + 0x1234
+	beqz	$2, bar + 0x1234
+	bnez	$2, bar + 0x1234
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.ent	bar
+	.set	mips16
+bar:
+	nop
+	.set	nomips16
+	.end	bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-branch-addend-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-addend-1.d	2016-06-25 00:37:39.720029932 +0100
@@ -0,0 +1,17 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 branch relocation with addend 1
+#as: -32
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
+[0-9a-f]+ <[^>]*> f101 1008 	b	00002234 <foo\+0x1214>
+[0-9a-f]+ <[^>]*> f101 6006 	bteqz	00002234 <foo\+0x1214>
+[0-9a-f]+ <[^>]*> f101 6104 	btnez	00002234 <foo\+0x1214>
+[0-9a-f]+ <[^>]*> f101 2202 	beqz	v0,00002234 <foo\+0x1214>
+[0-9a-f]+ <[^>]*> f101 2a00 	bnez	v0,00002234 <foo\+0x1214>
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-branch-addend-1.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-addend-1.s	2016-06-25 00:37:39.737494088 +0100
@@ -0,0 +1,30 @@
+	.text
+
+	.space	0x1000
+
+	.ent	bar
+	.set	mips16
+bar:
+	nop
+	.set	nomips16
+	.end	bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.ent	foo
+	.set	mips16
+foo:
+	b	bar + 0x1234
+	bteqz	bar + 0x1234
+	btnez	bar + 0x1234
+	beqz	$2, bar + 0x1234
+	bnez	$2, bar + 0x1234
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-branch-addend-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-addend-2.d	2016-06-25 00:37:39.751575951 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 branch relocation with addend 2
+#as: -32
+#error-output: mips16-branch-addend-2.l
Index: binutils/gas/testsuite/gas/mips/mips16-branch-addend-2.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-addend-2.l	2016-06-25 00:37:39.778737732 +0100
@@ -0,0 +1,6 @@
+.*: Assembler messages:
+.*:9: Error: unsupported relocation
+.*:10: Error: unsupported relocation
+.*:11: Error: unsupported relocation
+.*:12: Error: unsupported relocation
+.*:13: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-branch-addend-2.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-addend-2.s	2016-06-25 00:37:39.799022893 +0100
@@ -0,0 +1,31 @@
+	.text
+	.globl	bar
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	b	bar + 0x1234
+	bteqz	bar + 0x1234
+	btnez	bar + 0x1234
+	beqz	$2, bar + 0x1234
+	bnez	$2, bar + 0x1234
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.ent	bar
+	.set	mips16
+bar:
+	nop
+	.set	nomips16
+	.end	bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-branch-addend-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-addend-3.d	2016-06-25 00:37:39.818273851 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 branch relocation with addend 3
+#as: -32
+#error-output: mips16-branch-reloc-3.l
Index: binutils/gas/testsuite/gas/mips/mips16-branch-addend-3.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-addend-3.l	2016-06-25 00:37:39.834722672 +0100
@@ -0,0 +1,6 @@
+.*: Assembler messages:
+.*:8: Error: unsupported relocation
+.*:9: Error: unsupported relocation
+.*:10: Error: unsupported relocation
+.*:11: Error: unsupported relocation
+.*:12: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-branch-addend-3.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-addend-3.s	2016-06-25 00:37:39.849813266 +0100
@@ -0,0 +1,19 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	b	bar + 0x1234
+	bteqz	bar + 0x1234
+	btnez	bar + 0x1234
+	beqz	$2, bar + 0x1234
+	bnez	$2, bar + 0x1234
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-branch-reloc-0.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-reloc-0.d	2016-06-25 00:37:39.869987725 +0100
@@ -0,0 +1,17 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 branch relocation 0
+#as: -32
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> 100f      	b	00001020 <bar>
+[0-9a-f]+ <[^>]*> 600e      	bteqz	00001020 <bar>
+[0-9a-f]+ <[^>]*> 610d      	btnez	00001020 <bar>
+[0-9a-f]+ <[^>]*> 220c      	beqz	v0,00001020 <bar>
+[0-9a-f]+ <[^>]*> 2a0b      	bnez	v0,00001020 <bar>
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-branch-reloc-0.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-reloc-0.s	2016-06-25 00:37:39.883066451 +0100
@@ -0,0 +1,30 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	b	bar
+	bteqz	bar
+	btnez	bar
+	beqz	$2, bar
+	bnez	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.ent	bar
+	.set	mips16
+bar:
+	nop
+	.set	nomips16
+	.end	bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-branch-reloc-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-reloc-1.d	2016-06-25 00:37:39.894163122 +0100
@@ -0,0 +1,17 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 branch relocation 1
+#as: -32
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
+[0-9a-f]+ <[^>]*> 17ef      	b	00001000 <bar>
+[0-9a-f]+ <[^>]*> 60ee      	bteqz	00001000 <bar>
+[0-9a-f]+ <[^>]*> 61ed      	btnez	00001000 <bar>
+[0-9a-f]+ <[^>]*> 22ec      	beqz	v0,00001000 <bar>
+[0-9a-f]+ <[^>]*> 2aeb      	bnez	v0,00001000 <bar>
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-branch-reloc-1.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-reloc-1.s	2016-06-25 00:37:39.912261052 +0100
@@ -0,0 +1,30 @@
+	.text
+
+	.space	0x1000
+
+	.ent	bar
+	.set	mips16
+bar:
+	nop
+	.set	nomips16
+	.end	bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.ent	foo
+	.set	mips16
+foo:
+	b	bar
+	bteqz	bar
+	btnez	bar
+	beqz	$2, bar
+	bnez	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-branch-reloc-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-reloc-2.d	2016-06-25 00:37:39.938469274 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 branch relocation 2
+#as: -32
+#error-output: mips16-branch-reloc-2.l
Index: binutils/gas/testsuite/gas/mips/mips16-branch-reloc-2.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-reloc-2.l	2016-06-25 00:37:39.962611166 +0100
@@ -0,0 +1,6 @@
+.*: Assembler messages:
+.*:9: Error: unsupported relocation
+.*:10: Error: unsupported relocation
+.*:11: Error: unsupported relocation
+.*:12: Error: unsupported relocation
+.*:13: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-branch-reloc-2.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-reloc-2.s	2016-06-25 00:37:39.973713674 +0100
@@ -0,0 +1,31 @@
+	.text
+	.globl	bar
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	b	bar
+	bteqz	bar
+	btnez	bar
+	beqz	$2, bar
+	bnez	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.ent	bar
+	.set	mips16
+bar:
+	nop
+	.set	nomips16
+	.end	bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-branch-reloc-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-reloc-3.d	2016-06-25 00:37:39.986793549 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 branch relocation 3
+#as: -32
+#error-output: mips16-branch-reloc-3.l
Index: binutils/gas/testsuite/gas/mips/mips16-branch-reloc-3.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-reloc-3.l	2016-06-25 00:37:40.021993908 +0100
@@ -0,0 +1,6 @@
+.*: Assembler messages:
+.*:8: Error: unsupported relocation
+.*:9: Error: unsupported relocation
+.*:10: Error: unsupported relocation
+.*:11: Error: unsupported relocation
+.*:12: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-branch-reloc-3.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-branch-reloc-3.s	2016-06-25 00:37:40.038087530 +0100
@@ -0,0 +1,19 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	b	bar
+	bteqz	bar
+	btnez	bar
+	beqz	$2, bar
+	bnez	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-absolute.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-absolute.d	2016-06-25 00:37:40.061231933 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 PC-relative reference to absolute expression
+#as: -32
+#error-output: mips16-pcrel-absolute.l
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-absolute.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-absolute.l	2016-06-25 00:37:40.071292743 +0100
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:8: Error: unsupported relocation
+.*:9: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-absolute.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-absolute.s	2016-06-25 00:37:40.082436255 +0100
@@ -0,0 +1,18 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	la	$2, bar
+	lw	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.set	bar, 0x1234
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-0.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-0.d	2016-06-25 00:37:40.110028796 +0100
@@ -0,0 +1,13 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 PC-relative relocation with addend 0
+#as: -32
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> f242 0a14 	la	v0,00002254 <bar\+0x1234>
+[0-9a-f]+ <[^>]*> f242 b210 	lw	v0,00002254 <bar\+0x1234>
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-0.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-0.s	2016-06-25 00:37:40.123358927 +0100
@@ -0,0 +1,25 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	la	$2, bar + 0x1234
+	lw	$2, bar + 0x1234
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.type	bar, @object
+bar:
+	.long	0
+	.size	bar, . - bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-1.d	2016-06-25 00:37:40.138833812 +0100
@@ -0,0 +1,13 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 PC-relative relocation with addend 1
+#as: -32
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+	\.\.\.
+[0-9a-f]+ <[^>]*> f202 0a14 	la	v0,00002234 <foo\+0x1214>
+[0-9a-f]+ <[^>]*> f202 b210 	lw	v0,00002234 <foo\+0x1214>
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-1.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-1.s	2016-06-25 00:37:40.153150450 +0100
@@ -0,0 +1,25 @@
+	.text
+
+	.space	0x1000
+
+	.type	bar, @object
+bar:
+	.long	0
+	.size	bar, . - bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.ent	foo
+	.set	mips16
+foo:
+	la	$2, bar + 0x1234
+	lw	$2, bar + 0x1234
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-2.d	2016-06-25 00:37:40.173675905 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 PC-relative relocation with addend 2
+#as: -32
+#error-output: mips16-pcrel-addend-2.l
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-2.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-2.l	2016-06-25 00:37:40.196998842 +0100
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:9: Error: unsupported relocation
+.*:10: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-2.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-2.s	2016-06-25 00:37:40.225928365 +0100
@@ -0,0 +1,26 @@
+	.text
+	.globl	bar
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	la	$2, bar + 0x1234
+	lw	$2, bar + 0x1234
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.type	bar, @object
+bar:
+	.long	0
+	.size	bar, . - bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-3.d	2016-06-25 00:37:40.255752117 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 PC-relative relocation with addend 3
+#as: -32
+#error-output: mips16-pcrel-addend-3.l
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-3.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-3.l	2016-06-25 00:37:40.287393316 +0100
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:8: Error: unsupported relocation
+.*:9: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-3.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-addend-3.s	2016-06-25 00:37:40.301609667 +0100
@@ -0,0 +1,16 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	la	$2, bar + 0x1234
+	lw	$2, bar + 0x1234
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-relax-0.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-relax-0.d	2016-06-25 00:37:40.315794426 +0100
@@ -0,0 +1,16 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 PC-relative relaxation 0
+#as: -32
+
+# Check that PC-relative relaxation does not go into oscillation
+# where the address referred depends on the size of the instruction;
+# cf. RELAX_MIPS16_MARK_LONG_BRANCH.
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> f000 0a08 	la	v0,00001008 <foo\+0x8>
+[0-9a-f]+ <[^>]*> e820      	jr	ra
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-relax-0.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-relax-0.s	2016-06-25 00:37:40.331004453 +0100
@@ -0,0 +1,23 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+	.set	noreorder
+foo:
+	la	$2, 0f
+	jr	$ra
+	 nop
+	.ifdef	align
+	.align	2
+	.endif
+0:
+	.short	0
+	.set	reorder
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-relax-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-relax-1.d	2016-06-25 00:37:40.349133576 +0100
@@ -0,0 +1,18 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 PC-relative relaxation 1
+#as: -32 --defsym align=1
+#source: mips16-pcrel-relax-0.s
+
+# Check that PC-relative relaxation chooses the short encoding
+# where the address referred is fixed by an alignment directive
+# cf. RELAX_MIPS16_MARK_LONG_BRANCH.
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> 0a02      	la	v0,00001008 <foo\+0x8>
+[0-9a-f]+ <[^>]*> e820      	jr	ra
+[0-9a-f]+ <[^>]*> 6500      	nop
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-relax-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-relax-2.d	2016-06-25 00:37:40.361213585 +0100
@@ -0,0 +1,16 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 PC-relative relaxation 2
+#as: -32
+
+# Check that PC-relative relaxation does not go into oscillation
+# where the address referred depends on the size of the instruction;
+# cf. RELAX_MIPS16_MARK_LONG_BRANCH.
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> f000 0a08 	la	v0,00001008 <foo\+0x8>
+[0-9a-f]+ <[^>]*> e820      	jr	ra
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-relax-2.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-relax-2.s	2016-06-25 00:37:40.370253679 +0100
@@ -0,0 +1,23 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+	.set	noreorder
+foo:
+	la	$2, .L0
+	jr	$ra
+	 nop
+	.ifdef	align
+	.align	2
+	.endif
+.L0 = .
+	.short	0
+	.set	reorder
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-relax-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-relax-3.d	2016-06-25 00:37:40.394396297 +0100
@@ -0,0 +1,18 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 PC-relative relaxation 3
+#as: -32 --defsym align=1
+#source: mips16-pcrel-relax-2.s
+
+# Check that PC-relative relaxation chooses the short encoding
+# where the address referred is fixed by an alignment directive
+# cf. RELAX_MIPS16_MARK_LONG_BRANCH.
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> 0a02      	la	v0,00001008 <foo\+0x8>
+[0-9a-f]+ <[^>]*> e820      	jr	ra
+[0-9a-f]+ <[^>]*> 6500      	nop
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-0.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-0.d	2016-06-25 00:37:40.415497432 +0100
@@ -0,0 +1,13 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 PC-relative relocation 0
+#as: -32
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> 0a08      	la	v0,00001020 <bar>
+[0-9a-f]+ <[^>]*> b208      	lw	v0,00001020 <bar>
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-0.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-0.s	2016-06-25 00:37:40.432595396 +0100
@@ -0,0 +1,25 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	la	$2, bar
+	lw	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.type	bar, @object
+bar:
+	.long	0
+	.size	bar, . - bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-1.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-1.d	2016-06-25 00:37:40.438643235 +0100
@@ -0,0 +1,13 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 PC-relative relocation 1
+#as: -32
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+	\.\.\.
+[0-9a-f]+ <[^>]*> f7ff 0a00 	la	v0,00001000 <bar>
+[0-9a-f]+ <[^>]*> f7df b21c 	lw	v0,00001000 <bar>
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-1.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-1.s	2016-06-25 00:37:40.459824776 +0100
@@ -0,0 +1,25 @@
+	.text
+
+	.space	0x1000
+
+	.type	bar, @object
+bar:
+	.long	0
+	.size	bar, . - bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.ent	foo
+	.set	mips16
+foo:
+	la	$2, bar
+	lw	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-2.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-2.d	2016-06-25 00:37:40.470880881 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 PC-relative relocation 2
+#as: -32
+#error-output: mips16-pcrel-reloc-2.l
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-2.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-2.l	2016-06-25 00:37:40.477926000 +0100
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:9: Error: unsupported relocation
+.*:10: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-2.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-2.s	2016-06-25 00:37:40.493996121 +0100
@@ -0,0 +1,26 @@
+	.text
+	.globl	bar
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	la	$2, bar
+	lw	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.type	bar, @object
+bar:
+	.long	0
+	.size	bar, . - bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-3.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-3.d	2016-06-25 00:37:40.506053618 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 PC-relative relocation 3
+#as: -32
+#error-output: mips16-pcrel-reloc-3.l
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-3.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-3.l	2016-06-25 00:37:40.521404228 +0100
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:8: Error: unsupported relocation
+.*:9: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-3.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-3.s	2016-06-25 00:37:40.536573155 +0100
@@ -0,0 +1,16 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	la	$2, bar
+	lw	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-4.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-4.d	2016-06-25 00:37:40.567951576 +0100
@@ -0,0 +1,13 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 PC-relative relocation 4
+#as: -32 -mips3
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+[0-9a-f]+ <[^>]*> fe48      	dla	v0,00001020 <bar>
+[0-9a-f]+ <[^>]*> fc44      	ld	v0,00001020 <bar>
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-4.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-4.s	2016-06-25 00:37:40.583102672 +0100
@@ -0,0 +1,25 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	dla	$2, bar
+	ld	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.type	bar, @object
+bar:
+	.long	0
+	.size	bar, . - bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-5.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-5.d	2016-06-25 00:37:40.601316912 +0100
@@ -0,0 +1,13 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 PC-relative relocation 5
+#as: -32 -mips3
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+	\.\.\.
+	\.\.\.
+[0-9a-f]+ <[^>]*> f7ff fe40 	dla	v0,00001000 <bar>
+[0-9a-f]+ <[^>]*> f7ff fc40 	ld	v0,00001000 <bar>
+[0-9a-f]+ <[^>]*> 6500      	nop
+	\.\.\.
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-5.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-5.s	2016-06-25 00:37:40.617400699 +0100
@@ -0,0 +1,25 @@
+	.text
+
+	.space	0x1000
+
+	.type	bar, @object
+bar:
+	.long	0
+	.size	bar, . - bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.ent	foo
+	.set	mips16
+foo:
+	dla	$2, bar
+	ld	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-6.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-6.d	2016-06-25 00:37:40.641573311 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 PC-relative relocation 6
+#as: -32 -mips3
+#error-output: mips16-pcrel-reloc-6.l
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-6.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-6.l	2016-06-25 00:37:40.655657944 +0100
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:9: Error: unsupported relocation
+.*:10: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-6.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-6.s	2016-06-25 00:37:40.677815614 +0100
@@ -0,0 +1,26 @@
+	.text
+	.globl	bar
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	dla	$2, bar
+	ld	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
+
+	.type	bar, @object
+bar:
+	.long	0
+	.size	bar, . - bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-7.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-7.d	2016-06-25 00:37:40.683855108 +0100
@@ -0,0 +1,3 @@
+#name: MIPS16 PC-relative relocation 7
+#as: -32 -mips3
+#error-output: mips16-pcrel-reloc-7.l
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-7.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-7.l	2016-06-25 00:37:40.701963192 +0100
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:8: Error: unsupported relocation
+.*:9: Error: unsupported relocation
Index: binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-7.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16-pcrel-reloc-7.s	2016-06-25 00:37:40.736543466 +0100
@@ -0,0 +1,16 @@
+	.text
+
+	.space	0x1000
+
+	.ent	foo
+	.set	mips16
+foo:
+	dla	$2, bar
+	ld	$2, bar
+	nop
+	.set	nomips16
+	.end	foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	4, 0
+	.space	16
Index: binutils/gas/testsuite/gas/mips/mips16@relax-swap3.d
===================================================================
--- binutils.orig/gas/testsuite/gas/mips/mips16@relax-swap3.d	2016-06-24 21:46:00.771218452 +0100
+++ binutils/gas/testsuite/gas/mips/mips16@relax-swap3.d	2016-06-24 22:08:10.003833386 +0100
@@ -2,14 +2,10 @@
 #name: MIPS relaxed macro with branch swapping
 #as: -32
 #source: relax-swap3.s
+#error-output: mips16@relax-swap3.l
 
-.*: +file format .*mips.*
-
-Disassembly of section \.text:
-[0-9a-f]+ <[^>]*> 0a00      	la	v0,[0-9a-f]+ <[^>]*>
-[0-9a-f]+ <[^>]*> eb00      	jr	v1
-[0-9a-f]+ <[^>]*> 6500      	nop
-[0-9a-f]+ <[^>]*> f7ff 0a1c 	la	v0,[0-9a-f]+ <[^>]*>
-[0-9a-f]+ <[^>]*> 2300      	beqz	v1,[0-9a-f]+ <[^>]*>
-	\.\.\.
-#pass
+# This test used to cover the MIPS16 LA macro, but ceased to work when a
+# regression in MIPS16 relocation processing has been corrected, because
+# we have no external relocation available to represent the expression.
+# It is left in place to trigger if we ever get R_MIPS16_PC16 relocation
+# support.
Index: binutils/gas/testsuite/gas/mips/mips16@relax-swap3.l
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ binutils/gas/testsuite/gas/mips/mips16@relax-swap3.l	2016-06-24 22:08:10.017038495 +0100
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:5: Error: unsupported relocation
+.*:8: Error: unsupported relocation


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]