diff options
author | Maciej W. Rozycki <macro@imgtec.com> | 2016-07-19 13:59:28 +0100 |
---|---|---|
committer | Maciej W. Rozycki <macro@imgtec.com> | 2016-07-19 14:46:30 +0100 |
commit | 9d862524f6ae9703fe8e264dd4785756d358570a (patch) | |
tree | bd5585c84b4fedc97b3068865b82eeb10d781e29 /ld | |
parent | 065251a0d7a5b0b079ed1f86247573a07d7d98c8 (diff) | |
download | gdb-9d862524f6ae9703fe8e264dd4785756d358570a.zip gdb-9d862524f6ae9703fe8e264dd4785756d358570a.tar.gz gdb-9d862524f6ae9703fe8e264dd4785756d358570a.tar.bz2 |
MIPS: Verify the ISA mode and alignment of branch and jump targets
Verify that the ISA mode of branch targets is the same as the referring
relocation, so that an attempt to produce a branch between instructions
encoded in different ISA modes each causes an error rather than silently
producing non-functional code. Make sure that no symbol or addend bits
are silently truncated: terminate with an error if the relocation value
calculated cannot be encoded in the relocatable field of a branch; for
REL targets also applying to any intermediate addend.
Also make jump target's alignment verification consistent with that for
branches.
This change will require an update to some obscure handcoded assembly
sources which make branches to labels placed at data objects, however
for microMIPS code only. These labels will have to be updated with the
`.insn' directive for containing code to assemble and link successfully.
Such code is broken as any such labels have always been required by the
microMIPS architecture specification[1][2] to be annotated this way for
correct interpretation, and with our old code missing `.insn' directives
caused labels to present different semantics depending on whether they
were referred with branch (ISA bit ignored) or other relocations (ISA
bit respected).
Enforcing these checks however will ensure errors in building software,
like mixed regular MIPS and microMIPS code links with branches between,
will be diagnosed at the build time rather than causing odd run-time
errors such as intermittent crashes. It will also let cross-mode BAL
instructions be converted to JALX instructions, with a separate change.
References:
[1] "MIPS Architecture for Programmers, Volume II-B: The microMIPS32
Instruction Set", MIPS Technologies, Inc., Document Number: MD00582,
Revision 5.04, January 15, 2014, Section 7.1 "Assembly-Level
Compatibility", p. 533
[2] "MIPS Architecture for Programmers, Volume II-B: The microMIPS64
Instruction Set", MIPS Technologies, Inc., Document Number: MD00594,
Revision 5.04, January 15, 2014, Section 8.1 "Assembly-Level
Compatibility", p. 623
bfd/
* elfxx-mips.c (b_reloc_p): Add R_MICROMIPS_PC16_S1,
R_MICROMIPS_PC10_S1 and R_MICROMIPS_PC7_S1.
(branch_reloc_p): New function.
(mips_elf_calculate_relocation): Handle ISA mode determination
for relocations against section symbols, against absolute
symbols and absolute relocations. Also set `*cross_mode_jump_p'
for branches.
<R_MIPS16_26, R_MIPS_26, R_MICROMIPS_26_S1>: Suppress alignment
checks for weak undefined symbols. Also check target alignment
within the same ISA mode.
<R_MIPS_PC16, R_MIPS_GNU_REL16_S2>: Handle cross-mode branches
in the alignment check.
<R_MICROMIPS_PC7_S1>: Add an alignment check.
<R_MICROMIPS_PC10_S1>: Likewise.
<R_MICROMIPS_PC16_S1>: Likewise.
(mips_elf_perform_relocation): Report a failure for unsupported
same-mode JALX instructions and cross-mode branches.
(_bfd_mips_elf_relocate_section) <bfd_reloc_outofrange>: Add
error messages for jumps to misaligned addresses.
gas/
* config/tc-mips.c (mips_force_relocation): Also retain branch
relocations against MIPS16 and microMIPS symbols.
(fix_bad_cross_mode_jump_p): New function.
(fix_bad_same_mode_jalx_p): Likewise.
(fix_bad_misaligned_jump_p): Likewise.
(fix_bad_cross_mode_branch_p): Likewise.
(fix_bad_misaligned_branch_p): Likewise.
(fix_validate_branch): Likewise.
(md_apply_fix) <BFD_RELOC_MIPS_JMP, BFD_RELOC_MIPS16_JMP>
<BFD_RELOC_MICROMIPS_JMP>: Separate from BFD_RELOC_MIPS_SHIFT5,
etc. Verify the ISA mode and alignment of the jump target.
<BFD_RELOC_MIPS_21_PCREL_S2>: Replace the inline alignment check
with a call to `fix_validate_branch'.
<BFD_RELOC_MIPS_26_PCREL_S2>: Likewise.
<BFD_RELOC_16_PCREL_S2>: Likewise.
<BFD_RELOC_MICROMIPS_7_PCREL_S1, BFD_RELOC_MICROMIPS_10_PCREL_S1>
<BFD_RELOC_MICROMIPS_16_PCREL_S1>: Retain the original addend.
Verify the ISA mode and alignment of the branch target.
(md_convert_frag): Verify the ISA mode and alignment of resolved
MIPS16 branch targets.
* testsuite/gas/mips/branch-misc-1.s: Annotate non-instruction
branch targets with `.insn'.
* testsuite/gas/mips/branch-misc-5.s: Likewise.
* testsuite/gas/mips/micromips@branch-misc-5-64.d: Update
accordingly.
* testsuite/gas/mips/micromips@branch-misc-5pic-64.d: Likewise.
* testsuite/gas/mips/micromips-branch-relax.s: Annotate
non-instruction branch target with `.insn'.
* testsuite/gas/mips/micromips.s: Replace microMIPS JALX targets
with external symbols.
* testsuite/gas/mips/micromips-insn32.d: Update accordingly.
* testsuite/gas/mips/micromips-noinsn32.d: Likewise.
* testsuite/gas/mips/micromips-trap.d: Likewise.
* testsuite/gas/mips/micromips.d: Likewise.
* testsuite/gas/mips/mips16.s: Annotate non-instruction branch
targets with `.insn'.
* testsuite/gas/mips/mips16.d: Update accordingly.
* testsuite/gas/mips/mips16-64.d: Likewise.
* testsuite/gas/mips/mips16-dwarf2.s: Annotate non-instruction
branch target with `.insn'.
* testsuite/gas/mips/relax-swap3.s: Likewise.
* testsuite/gas/mips/branch-local-2.l: New list test.
* testsuite/gas/mips/branch-local-3.l: New list test.
* testsuite/gas/mips/branch-local-n32-2.l: New list test.
* testsuite/gas/mips/branch-local-n32-3.l: New list test.
* testsuite/gas/mips/branch-local-n64-2.l: New list test.
* testsuite/gas/mips/branch-local-n64-3.l: New list test.
* testsuite/gas/mips/unaligned-jump-1.l: New list test.
* testsuite/gas/mips/unaligned-jump-2.l: New list test.
* testsuite/gas/mips/unaligned-jump-3.d: New test.
* testsuite/gas/mips/unaligned-jump-mips16-1.l: New list test.
* testsuite/gas/mips/unaligned-jump-mips16-2.l: New list test.
* testsuite/gas/mips/unaligned-jump-mips16-3.d: New test.
* testsuite/gas/mips/unaligned-jump-micromips-1.l: New list
test.
* testsuite/gas/mips/unaligned-jump-micromips-2.l: New list
test.
* testsuite/gas/mips/unaligned-jump-micromips-3.d: New test.
* testsuite/gas/mips/unaligned-branch-1.l: New list test.
* testsuite/gas/mips/unaligned-branch-2.l: New list test.
* testsuite/gas/mips/unaligned-branch-3.d: New test.
* testsuite/gas/mips/unaligned-branch-r6-1.l: New list test.
* testsuite/gas/mips/unaligned-branch-r6-2.l: New list test.
* testsuite/gas/mips/unaligned-branch-r6-3.l: New list test.
* testsuite/gas/mips/unaligned-branch-r6-4.l: New list test.
* testsuite/gas/mips/unaligned-branch-r6-5.d: New test.
* testsuite/gas/mips/unaligned-branch-r6-6.d: New test.
* testsuite/gas/mips/unaligned-branch-mips16-1.l: New list test.
* testsuite/gas/mips/unaligned-branch-mips16-2.l: New list test.
* testsuite/gas/mips/unaligned-branch-mips16-3.d: New test.
* testsuite/gas/mips/unaligned-branch-micromips-1.l: New list
test.
* testsuite/gas/mips/unaligned-branch-micromips-2.l: New list
test.
* testsuite/gas/mips/unaligned-branch-micromips-3.d: New test.
* testsuite/gas/mips/branch-local-2.s: New test source.
* testsuite/gas/mips/branch-local-3.s: New test source.
* testsuite/gas/mips/branch-local-n32-2.s: New test source.
* testsuite/gas/mips/branch-local-n32-3.s: New test source.
* testsuite/gas/mips/branch-local-n64-2.s: New test source.
* testsuite/gas/mips/branch-local-n64-3.s: New test source.
* testsuite/gas/mips/unaligned-jump-1.s: New test source.
* testsuite/gas/mips/unaligned-jump-2.s: New test source.
* testsuite/gas/mips/unaligned-jump-mips16-1.s: New test source.
* testsuite/gas/mips/unaligned-jump-mips16-2.s: New test source.
* testsuite/gas/mips/unaligned-jump-micromips-1.s: New test
source.
* testsuite/gas/mips/unaligned-jump-micromips-2.s: New test
source.
* testsuite/gas/mips/unaligned-branch-1.s: New test source.
* testsuite/gas/mips/unaligned-branch-2.s: New test source.
* testsuite/gas/mips/unaligned-branch-r6-1.s: New test source.
* testsuite/gas/mips/unaligned-branch-r6-2.s: New test source.
* testsuite/gas/mips/unaligned-branch-r6-3.s: New test source.
* testsuite/gas/mips/unaligned-branch-r6-4.s: New test source.
* testsuite/gas/mips/unaligned-branch-mips16-1.s: New test
source.
* testsuite/gas/mips/unaligned-branch-mips16-2.s: New test
source.
* testsuite/gas/mips/unaligned-branch-micromips-1.s: New test
source.
* testsuite/gas/mips/unaligned-branch-micromips-2.s: New test
source.
* testsuite/gas/mips/mips.exp: Run the new tests.
ld/
* testsuite/ld-mips-elf/unaligned-jalx-1.d: Update error message
expected.
* testsuite/ld-mips-elf/unaligned-jalx-addend-1.d: Likewise.
* testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d:
Likewise.
* testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d:
Likewise.
* testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d: Likewise.
* testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d: Likewise.
* testsuite/ld-mips-elf/undefweak-overflow.s: Add jumps,
microMIPS BAL and MIPS16 instructions.
* testsuite/ld-mips-elf/undefweak-overflow.d: Update
accordingly.
* testsuite/ld-mips-elf/unaligned-branch-2.d: New test.
* testsuite/ld-mips-elf/unaligned-branch-r6-1.d: New test.
* testsuite/ld-mips-elf/unaligned-branch-r6-2.d: New test.
* testsuite/ld-mips-elf/unaligned-branch-mips16.d: New test.
* testsuite/ld-mips-elf/unaligned-branch-micromips.d: New test.
* testsuite/ld-mips-elf/unaligned-jump-mips16.d: New test.
* testsuite/ld-mips-elf/unaligned-jump-micromips.d: New test.
* testsuite/ld-mips-elf/unaligned-jump.d: New test.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
Diffstat (limited to 'ld')
18 files changed, 923 insertions, 42 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 35a2b80..a82ce2b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,28 @@ +2016-07-19 Maciej W. Rozycki <macro@imgtec.com> + + * testsuite/ld-mips-elf/unaligned-jalx-1.d: Update error message + expected. + * testsuite/ld-mips-elf/unaligned-jalx-addend-1.d: Likewise. + * testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d: + Likewise. + * testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d: + Likewise. + * testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d: Likewise. + * testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d: Likewise. + * testsuite/ld-mips-elf/undefweak-overflow.s: Add jumps, + microMIPS BAL and MIPS16 instructions. + * testsuite/ld-mips-elf/undefweak-overflow.d: Update + accordingly. + * testsuite/ld-mips-elf/unaligned-branch-2.d: New test. + * testsuite/ld-mips-elf/unaligned-branch-r6-1.d: New test. + * testsuite/ld-mips-elf/unaligned-branch-r6-2.d: New test. + * testsuite/ld-mips-elf/unaligned-branch-mips16.d: New test. + * testsuite/ld-mips-elf/unaligned-branch-micromips.d: New test. + * testsuite/ld-mips-elf/unaligned-jump-mips16.d: New test. + * testsuite/ld-mips-elf/unaligned-jump-micromips.d: New test. + * testsuite/ld-mips-elf/unaligned-jump.d: New test. + * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests. + 2016-07-19 Andrew Burgess <andrew.burgess@embecosm.com> * plugin.c (plugin_call_claim_file): Restore the file offset after diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp index 5c417c7..6a78fd8 100644 --- a/ld/testsuite/ld-mips-elf/mips-elf.exp +++ b/ld/testsuite/ld-mips-elf/mips-elf.exp @@ -244,6 +244,25 @@ if $has_newabi { run_dump_test "unaligned-branch" [list [list ld $abi_ldflags(o32)]] +if $has_newabi { + run_dump_test "unaligned-branch-2" \ + [list [list ld $abi_ldflags(n32)]] + run_dump_test "unaligned-branch-r6-1" \ + [list [list ld $abi_ldflags(n32)]] + run_dump_test "unaligned-branch-r6-2" \ + [list [list ld $abi_ldflags(n32)]] + run_dump_test "unaligned-branch-mips16" \ + [list [list ld $abi_ldflags(n32)]] + run_dump_test "unaligned-branch-micromips" \ + [list [list ld $abi_ldflags(n32)]] + run_dump_test "unaligned-jump" \ + [list [list ld $abi_ldflags(n32)]] + run_dump_test "unaligned-jump-mips16" \ + [list [list ld $abi_ldflags(n32)]] + run_dump_test "unaligned-jump-micromips" \ + [list [list ld $abi_ldflags(n32)]] +} + run_dump_test "unaligned-lwpc-0" [list [list ld $abi_ldflags(o32)]] run_dump_test "unaligned-lwpc-1" [list [list ld $abi_ldflags(o32)]] run_dump_test "unaligned-ldpc-0" [list [list ld $abi_ldflags(o32)]] diff --git a/ld/testsuite/ld-mips-elf/unaligned-branch-2.d b/ld/testsuite/ld-mips-elf/unaligned-branch-2.d new file mode 100644 index 0000000..60755cb --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-branch-2.d @@ -0,0 +1,106 @@ +#name: MIPS link branch to unaligned symbol 2 +#as: -EB -n32 -march=from-abi +#ld: -EB -Ttext 0x1c000000 -e 0x1c000000 +#source: ../../../gas/testsuite/gas/mips/unaligned-branch-2.s +#error: \A[^\n]*: In function `foo':\n +#error: \(\.text\+0x101c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1024\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x102c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1034\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x103c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1044\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x104c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1054\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x105c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x107c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1084\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x108c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1094\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x109c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10a4\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ac\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10b4\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10bc\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10dc\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10e4\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ec\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10f4\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10f4\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10fc\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10fc\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1104\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1104\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x110c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1114\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x111c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1124\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1124\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x112c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x112c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1134\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1134\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x113c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x113c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1144\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1144\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x114c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x114c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1154\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1154\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x115c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x115c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1164\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1164\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x116c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1174\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x117c\): Unsupported branch between ISA modes\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-branch-micromips.d b/ld/testsuite/ld-mips-elf/unaligned-branch-micromips.d new file mode 100644 index 0000000..e32a187 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-branch-micromips.d @@ -0,0 +1,174 @@ +#name: microMIPS link branch to unaligned symbol +#as: -EB -n32 -march=from-abi +#ld: -EB -Ttext 0x1c000000 -e 0x1c000000 +#source: ../../../gas/testsuite/gas/mips/unaligned-branch-micromips-2.s +#error: \A[^\n]*: In function `foo':\n +#error: \(\.text\+0x1002\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x100a\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x100a\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1012\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1012\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x101a\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x101a\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1022\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x102a\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x102a\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1032\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1032\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x103a\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x103a\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1042\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1062\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1072\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1082\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1088\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1088\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x108e\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x108e\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1094\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1094\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x109a\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10a0\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10a0\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10a6\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10a6\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ac\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ac\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10b2\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ca\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10d6\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10e2\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10e8\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10e8\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ee\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ee\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10f4\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10f4\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10fa\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1100\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1100\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1106\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1106\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x110c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x110c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1112\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x112a\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1136\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1142\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1146\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1146\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x114a\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x114a\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x114e\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x114e\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1152\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1156\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1156\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x115a\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x115a\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x115e\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x115e\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1162\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1172\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x117a\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1182\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1186\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1186\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x118a\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x118a\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x118e\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x118e\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1192\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1196\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1196\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x119a\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x119a\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x119e\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x119e\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x11a2\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x11b2\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x11ba\): Branch to a non-instruction-aligned address\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-branch-mips16.d b/ld/testsuite/ld-mips-elf/unaligned-branch-mips16.d new file mode 100644 index 0000000..1752683 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-branch-mips16.d @@ -0,0 +1,72 @@ +#name: MIPS16 link branch to unaligned symbol +#as: -EB -n32 -march=from-abi +#ld: -EB -Ttext 0x1c000000 -e 0x1c000000 +#source: ../../../gas/testsuite/gas/mips/unaligned-branch-mips16-2.s +#error: \A[^\n]*: In function `foo':\n +#error: \(\.text\+0x1002\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1008\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1008\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x100e\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x100e\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1014\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1014\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x101a\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1020\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1020\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1026\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1026\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x102c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x102c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1032\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x104a\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1056\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1062\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1068\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1068\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x106e\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x106e\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1074\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1074\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x107a\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1080\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1080\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1086\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1086\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x108c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x108c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1092\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10aa\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10b6\): Branch to a non-instruction-aligned address\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-branch-r6-1.d b/ld/testsuite/ld-mips-elf/unaligned-branch-r6-1.d new file mode 100644 index 0000000..070304e --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-branch-r6-1.d @@ -0,0 +1,114 @@ +#name: MIPSr6 link branch to unaligned symbol 1 +#as: -EB -n32 -march=from-abi +#ld: -EB -Ttext 0x1c000000 -e 0x1c000000 +#source: ../../../gas/testsuite/gas/mips/unaligned-branch-r6-3.s +#error: \A[^\n]*: In function `foo':\n +#error: \(\.text\+0x101c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1024\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x102c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1034\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x103c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1044\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x104c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1054\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x105c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x107c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1084\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x108c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1094\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x109c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10a4\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ac\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10b4\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10bc\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10dc\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10dc\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10e4\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10e4\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ec\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10f4\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10f4\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10fc\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10fc\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1104\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1104\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x110c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x110c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1114\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1114\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x111c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1124\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1124\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x112c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x112c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1134\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1134\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x113c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x113c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1144\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1144\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x114c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x114c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1154\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x115c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1164\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1164\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x116c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x116c\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1174\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1174\): Unsupported branch between ISA modes\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x117c\): Unsupported branch between ISA modes\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-branch-r6-2.d b/ld/testsuite/ld-mips-elf/unaligned-branch-r6-2.d new file mode 100644 index 0000000..c1a297f --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-branch-r6-2.d @@ -0,0 +1,64 @@ +#name: MIPSr6 link branch to unaligned symbol 2 +#as: -EB -n32 -mips64r6 +#ld: -EB -Ttext 0x1c000000 -e 0x1c000000 +#source: ../../../gas/testsuite/gas/mips/unaligned-branch-r6-4.s +#error: \A[^\n]*: In function `foo':\n +#error: \(\.text\+0x101c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1024\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x102c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1034\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x103c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1044\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x104c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1054\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x105c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x107c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1084\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x108c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1094\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x109c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10a4\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ac\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10b4\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10bc\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10f4\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10fc\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1104\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1124\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x112c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1134\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x113c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1144\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x114c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1154\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x115c\): Branch to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1164\): Branch to a non-instruction-aligned address\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-1.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-1.d index 650bd8f..a842cfc 100644 --- a/ld/testsuite/ld-mips-elf/unaligned-jalx-1.d +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-1.d @@ -4,4 +4,4 @@ #as: -EB -32 #ld: -EB -Ttext 0x1c000000 -e 0x1c000000 #error: \A[^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\Z +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-1.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-1.d index befac09..54d6747 100644 --- a/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-1.d +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-1.d @@ -4,26 +4,26 @@ #as: -EB -n32 -march=from-abi #ld: -EB -Ttext 0x1c000000 -e 0x1c000000 #error: \A[^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\Z +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d index 038e46e..0734d83 100644 --- a/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d @@ -5,26 +5,26 @@ #ld: -EB -Ttext 0x1c000000 -e 0x1c000000 #objdump: -dr --prefix-addresses --show-raw-insn #error: \A[^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\Z +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d index 0bd81d8..9f2e626 100644 --- a/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d @@ -5,26 +5,26 @@ #ld: -EB -Ttext 0x1c000000 -e 0x1c000000 #objdump: -dr --prefix-addresses --show-raw-insn #error: \A[^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\n +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\n #error: [^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\Z +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d index 2df19df..7143c05 100644 --- a/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d @@ -4,4 +4,4 @@ #as: -EB -32 #ld: -EB -Ttext 0x1c000000 -e 0x1c000000 #error: \A[^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\Z +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d index 4c3e1bb..07d5568 100644 --- a/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d @@ -4,4 +4,4 @@ #as: -EB -32 #ld: -EB -Ttext 0x1c000000 -e 0x1c000000 #error: \A[^\n]*: In function `foo':\n -#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\Z +#error: \(\.text\+0x[0-9a-f]+\): Cannot convert a jump to JALX for a non-word-aligned address\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-jump-micromips.d b/ld/testsuite/ld-mips-elf/unaligned-jump-micromips.d new file mode 100644 index 0000000..65ebd3c --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-jump-micromips.d @@ -0,0 +1,118 @@ +#name: microMIPS link jump to unaligned symbol +#as: -EB -n32 -march=from-abi +#ld: -EB -Ttext 0x1c000000 -e 0x1c000000 +#source: ../../../gas/testsuite/gas/mips/unaligned-jump-micromips-2.s +#error: \A[^\n]*: In function `foo':\n +#error: \(\.text\+0x1012\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1018\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x101e\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1026\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x102e\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x102e\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1034\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1034\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x103a\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1042\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x104a\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x104a\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1050\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1050\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1056\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x105e\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1066\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1066\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x106c\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x106c\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1082\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1088\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x108e\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1096\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x109e\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x109e\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10a4\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10a4\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10aa\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10b2\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ba\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ba\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10c0\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10c0\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10c6\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ce\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10d6\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10d6\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10dc\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10dc\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10f2\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10f8\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10fe\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x111a\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1136\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1152\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1152\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x115a\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1162\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1168\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x116e\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x118a\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x118a\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1192\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x119a\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x11a0\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x11a6\): Unsupported JALX to the same ISA mode\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-jump-mips16.d b/ld/testsuite/ld-mips-elf/unaligned-jump-mips16.d new file mode 100644 index 0000000..6e18679 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-jump-mips16.d @@ -0,0 +1,58 @@ +#name: MIPS16 link jump to unaligned symbol +#as: -EB -n32 -march=from-abi +#ld: -EB -Ttext 0x1c000000 -e 0x1c000000 +#source: ../../../gas/testsuite/gas/mips/unaligned-jump-mips16-2.s +#error: \A[^\n]*: In function `foo':\n +#error: \(\.text\+0x100e\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1014\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x101a\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1020\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1026\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x102c\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x103e\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1044\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x104a\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1050\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1056\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x105c\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x106e\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x107a\): Jump to a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x107a\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1080\): Jump to a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1086\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1092\): Jump to a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1092\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1098\): Jump to a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x109e\): Jump to a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x109e\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10a4\): Jump to a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10aa\): Jump to a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10aa\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10b0\): Jump to a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10b6\): Unsupported JALX to the same ISA mode\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-jump.d b/ld/testsuite/ld-mips-elf/unaligned-jump.d new file mode 100644 index 0000000..4341df3 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-jump.d @@ -0,0 +1,96 @@ +#name: MIPS link jump to unaligned symbol +#as: -EB -n32 -march=from-abi +#ld: -EB -Ttext 0x1c000000 -e 0x1c000000 +#source: ../../../gas/testsuite/gas/mips/unaligned-jump-2.s +#error: \A[^\n]*: In function `foo':\n +#error: \(\.text\+0x1004\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x101c\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x101c\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1024\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x102c\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1034\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1034\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x103c\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1044\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x104c\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x104c\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1054\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x105c\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1064\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x107c\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x107c\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1084\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x108c\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1094\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1094\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x109c\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10a4\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ac\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ac\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10b4\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10bc\): Jump to a non-instruction-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10c4\): Unsupported JALX to the same ISA mode\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10ec\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10f4\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x10fc\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1104\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1104\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x111c\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1124\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x112c\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1134\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1134\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x113c\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1144\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x114c\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x114c\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1154\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x115c\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1164\): Cannot convert a jump to JALX for a non-word-aligned address\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x1164\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\n +#error: [^\n]*: In function `foo':\n +#error: \(\.text\+0x117c\): Unsupported jump between ISA modes; consider recompiling with interlinking enabled\Z diff --git a/ld/testsuite/ld-mips-elf/undefweak-overflow.d b/ld/testsuite/ld-mips-elf/undefweak-overflow.d index f3334d3..b74f910 100644 --- a/ld/testsuite/ld-mips-elf/undefweak-overflow.d +++ b/ld/testsuite/ld-mips-elf/undefweak-overflow.d @@ -16,12 +16,27 @@ [ 0-9a-f]+: 00000000 nop [ 0-9a-f]+: 0411fff5 bal 20000000 <_ftext> [ 0-9a-f]+: 3c...... lui a0,0x.... +[ 0-9a-f]+: 0c000000 jal 20000000 <_ftext> +[ 0-9a-f]+: 00000000 nop +[ 0-9a-f]+: 08000000 j 20000000 <_ftext> +[ 0-9a-f]+: 00000000 nop [0-9a-f]+ <micro>: -[ 0-9a-f]+: 8e67 beqz a0,20000000 <_ftext> +[ 0-9a-f]+: 8e5f beqz a0,20000000 <_ftext> [ 0-9a-f]+: 0c00 nop -[ 0-9a-f]+: cfe5 b 20000000 <_ftext> +[ 0-9a-f]+: cfdd b 20000000 <_ftext> [ 0-9a-f]+: 0c00 nop -[ 0-9a-f]+: 9400 ffe2 b 20000000 <_ftext> +[ 0-9a-f]+: 9400 ffda b 20000000 <_ftext> [ 0-9a-f]+: 0c00 nop +[ 0-9a-f]+: 4060 ffd7 bal 20000000 <_ftext> +[ 0-9a-f]+: 0000 0000 nop +[ 0-9a-f]+: f400 0000 jal 20000000 <_ftext> +[ 0-9a-f]+: 0000 0000 nop +[ 0-9a-f]+: d400 0000 j 20000000 <_ftext> +[ 0-9a-f]+: 0c00 nop + +[0-9a-f]+ <mips16>: +[ 0-9a-f]+: f7df 100c b 20000000 <_ftext> +[ 0-9a-f]+: 1800 0000 jal 20000000 <_ftext> +[ 0-9a-f]+: 6500 nop #pass diff --git a/ld/testsuite/ld-mips-elf/undefweak-overflow.s b/ld/testsuite/ld-mips-elf/undefweak-overflow.s index 2cec4b9..a7a9937 100644 --- a/ld/testsuite/ld-mips-elf/undefweak-overflow.s +++ b/ld/testsuite/ld-mips-elf/undefweak-overflow.s @@ -21,6 +21,11 @@ start: bal foo lui $4, %gp_rel(foo) + jal foo + nop + j foo + nop + .set mips32r2 .set micromips micro: @@ -30,3 +35,18 @@ micro: nop b foo nop + bal foo + nop + + jal foo + nop + j foo + nop + + .set nomicromips + .set mips16 +mips16: + b foo + + jal foo + nop |