MIPS16/GAS: Restore unsupported relocation diagnostics

Correct a MIPS16 relocation handling regression in GAS introduced with:

commit 177b4a6ad0
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.
This commit is contained in:
Maciej W. Rozycki 2016-06-25 00:49:10 +01:00
parent 2907f41490
commit 88a7ef1689
77 changed files with 1227 additions and 63 deletions

View File

@ -1,3 +1,90 @@
2016-06-24 Maciej W. Rozycki <macro@imgtec.com>
* 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.
2016-06-24 Alan Modra <amodra@gmail.com>
* configure.tgt (alpha-*-openbsd*): Use em=nbsd.

View File

@ -7307,15 +7307,31 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
}
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, asection *sec, long stretch)
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, asection *sec, long stretch)
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. */
if (RELAX_MIPS16_LONG_BRANCH (fragp->fr_subtype))
return 1;
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"));
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;
}
/* 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, asection *sec, long stretch)
/* 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, asection *sec, long stretch)
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 *fragp, long stretch)
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_UNUSED, segT asec, fragS *fragp)
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_UNUSED, segT asec, fragS *fragp)
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);

View File

@ -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" \

View File

@ -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
\.\.\.

View File

@ -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

View File

@ -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
\.\.\.

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 absolute relocation 2
#as: -32
#error-output: mips16-absolute-reloc-2.l

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 absolute relocation 3
#as: -32 -mips3
#error-output: mips16-absolute-reloc-3.l

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 branch to absolute expression
#as: -32
#error-output: mips16-branch-absolute.l

View File

@ -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

View File

@ -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

View File

@ -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
\.\.\.

View File

@ -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

View File

@ -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
\.\.\.

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 branch relocation with addend 2
#as: -32
#error-output: mips16-branch-addend-2.l

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 branch relocation with addend 3
#as: -32
#error-output: mips16-branch-reloc-3.l

View File

@ -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

View File

@ -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

View File

@ -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
\.\.\.

View File

@ -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

View File

@ -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
\.\.\.

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 branch relocation 2
#as: -32
#error-output: mips16-branch-reloc-2.l

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 branch relocation 3
#as: -32
#error-output: mips16-branch-reloc-3.l

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 PC-relative reference to absolute expression
#as: -32
#error-output: mips16-pcrel-absolute.l

View File

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:8: Error: unsupported relocation
.*:9: Error: unsupported relocation

View File

@ -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

View File

@ -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
\.\.\.
\.\.\.

View File

@ -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

View File

@ -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
\.\.\.

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 PC-relative relocation with addend 2
#as: -32
#error-output: mips16-pcrel-addend-2.l

View File

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:9: Error: unsupported relocation
.*:10: Error: unsupported relocation

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 PC-relative relocation with addend 3
#as: -32
#error-output: mips16-pcrel-addend-3.l

View File

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:8: Error: unsupported relocation
.*:9: Error: unsupported relocation

View File

@ -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

View File

@ -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
\.\.\.

View File

@ -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

View File

@ -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
\.\.\.

View File

@ -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
\.\.\.

View File

@ -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

View File

@ -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
\.\.\.

View File

@ -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
\.\.\.
\.\.\.

View File

@ -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

View File

@ -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
\.\.\.

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 PC-relative relocation 2
#as: -32
#error-output: mips16-pcrel-reloc-2.l

View File

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:9: Error: unsupported relocation
.*:10: Error: unsupported relocation

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 PC-relative relocation 3
#as: -32
#error-output: mips16-pcrel-reloc-3.l

View File

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:8: Error: unsupported relocation
.*:9: Error: unsupported relocation

View File

@ -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

View File

@ -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
\.\.\.
\.\.\.

View File

@ -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

View File

@ -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
\.\.\.

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 PC-relative relocation 6
#as: -32 -mips3
#error-output: mips16-pcrel-reloc-6.l

View File

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:9: Error: unsupported relocation
.*:10: Error: unsupported relocation

View File

@ -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

View File

@ -0,0 +1,3 @@
#name: MIPS16 PC-relative relocation 7
#as: -32 -mips3
#error-output: mips16-pcrel-reloc-7.l

View File

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:8: Error: unsupported relocation
.*:9: Error: unsupported relocation

View File

@ -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

View File

@ -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.

View File

@ -0,0 +1,3 @@
.*: Assembler messages:
.*:5: Error: unsupported relocation
.*:8: Error: unsupported relocation