diff options
Diffstat (limited to 'ld/testsuite')
9 files changed, 221 insertions, 0 deletions
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp index 0c2a93b..3fa151a 100644 --- a/ld/testsuite/ld-mips-elf/mips-elf.exp +++ b/ld/testsuite/ld-mips-elf/mips-elf.exp @@ -184,6 +184,21 @@ run_dump_test "unaligned-jalx-mips16-1" [list [list ld $abi_ldflags(o32)]] run_dump_test "unaligned-jalx-micromips-0" [list [list ld $abi_ldflags(o32)]] run_dump_test "unaligned-jalx-micromips-1" [list [list ld $abi_ldflags(o32)]] +if $has_newabi { + run_dump_test "unaligned-jalx-addend-0" \ + [list [list ld $abi_ldflags(n32)]] + run_dump_test "unaligned-jalx-addend-1" \ + [list [list ld $abi_ldflags(n32)]] + run_dump_test "unaligned-jalx-addend-mips16-0" \ + [list [list ld $abi_ldflags(n32)]] + run_dump_test "unaligned-jalx-addend-mips16-1" \ + [list [list ld $abi_ldflags(n32)]] + run_dump_test "unaligned-jalx-addend-micromips-0" \ + [list [list ld $abi_ldflags(n32)]] + run_dump_test "unaligned-jalx-addend-micromips-1" \ + [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-jalx-addend-0.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-0.d new file mode 100644 index 0000000..094277b --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-0.d @@ -0,0 +1,27 @@ +#name: MIPS JALX to unaligned symbol with addend 0 +#source: unaligned-jalx-addend-0.s +#source: unaligned-insn.s -mips16 +#as: -EB -n32 -march=from-abi +#ld: -EB -Ttext 0x1c000000 -e 0x1c000000 +#objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*mips.* + +Disassembly of section \.text: +[0-9a-f]+ <[^>]*> 7700000d jalx 1c000034 <bar2> +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 7700000c jalx 1c000030 <bar0> +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 7700000c jalx 1c000030 <bar0> +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 7700000e jalx 1c000038 <bar4> +[0-9a-f]+ <[^>]*> 00000000 nop + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-0.s b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-0.s new file mode 100644 index 0000000..417d69a --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-0.s @@ -0,0 +1,14 @@ + .text + .align 4 + .globl foo + .ent foo +foo: + jal bar0 + 4 + jal bar1 - 2 + jal bar2 - 4 + jal bar3 + 2 + .end foo + +# Force some (non-delay-slot) zero bytes, to make 'objdump' print ... + .align 4, 0 + .space 16 diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-1.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-1.d new file mode 100644 index 0000000..befac09 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-1.d @@ -0,0 +1,29 @@ +#name: MIPS JALX to unaligned symbol with addend 1 +#source: unaligned-jalx-addend-1.s +#source: unaligned-insn.s -mips16 +#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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-1.s b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-1.s new file mode 100644 index 0000000..9e95bf9 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-1.s @@ -0,0 +1,22 @@ + .text + .align 4 + .globl foo + .ent foo +foo: + jal bar0 + 1 + jal bar0 + 2 + jal bar0 + 3 + jal bar1 + 1 + jal bar1 + 3 + jal bar1 + 4 + jal bar2 - 1 + jal bar2 - 2 + jal bar2 - 3 + jal bar3 - 1 + jal bar3 - 3 + jal bar3 - 4 + .end foo + +# Force some (non-delay-slot) zero bytes, to make 'objdump' print ... + .align 4, 0 + .space 16 diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-0.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-0.d new file mode 100644 index 0000000..5a4eafc --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-0.d @@ -0,0 +1,27 @@ +#name: microMIPS JALX to unaligned symbol with addend 0 +#source: unaligned-jalx-addend-0.s -mmicromips +#source: unaligned-insn.s +#as: -EB -n32 -march=from-abi +#ld: -EB -Ttext 0x1c000000 -e 0x1c000000 +#objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*mips.* + +Disassembly of section \.text: +[0-9a-f]+ <[^>]*> f300 000d jalx 1c000034 <bar2> +[0-9a-f]+ <[^>]*> 0000 0000 nop +[0-9a-f]+ <[^>]*> f300 000c jalx 1c000030 <bar0> +[0-9a-f]+ <[^>]*> 0000 0000 nop +[0-9a-f]+ <[^>]*> f300 000c jalx 1c000030 <bar0> +[0-9a-f]+ <[^>]*> 0000 0000 nop +[0-9a-f]+ <[^>]*> f300 000e jalx 1c000038 <bar4> +[0-9a-f]+ <[^>]*> 0000 0000 nop + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. 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 new file mode 100644 index 0000000..038e46e --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d @@ -0,0 +1,30 @@ +#name: microMIPS JALX to unaligned symbol with addend 1 +#source: unaligned-jalx-addend-1.s -mmicromips +#source: unaligned-insn.s +#as: -EB -n32 -march=from-abi +#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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\Z diff --git a/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-0.d b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-0.d new file mode 100644 index 0000000..3e7ac16 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-0.d @@ -0,0 +1,27 @@ +#name: MIPS16 JALX to unaligned symbol with addend 0 +#source: unaligned-jalx-addend-0.s -mips16 +#source: unaligned-insn.s +#as: -EB -n32 -march=from-abi +#ld: -EB -Ttext 0x1c000000 -e 0x1c000000 +#objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*mips.* + +Disassembly of section \.text: +[0-9a-f]+ <[^>]*> 1c18 000d jalx 1c000034 <bar2> +[0-9a-f]+ <[^>]*> 6500 nop +[0-9a-f]+ <[^>]*> 1c18 000c jalx 1c000030 <bar0> +[0-9a-f]+ <[^>]*> 6500 nop +[0-9a-f]+ <[^>]*> 1c18 000c jalx 1c000030 <bar0> +[0-9a-f]+ <[^>]*> 6500 nop +[0-9a-f]+ <[^>]*> 1c18 000e jalx 1c000038 <bar4> +[0-9a-f]+ <[^>]*> 6500 nop + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. + \.\.\. 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 new file mode 100644 index 0000000..0bd81d8 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d @@ -0,0 +1,30 @@ +#name: MIPS16 JALX to unaligned symbol with addend 1 +#source: unaligned-jalx-addend-1.s -mips16 +#source: unaligned-insn.s +#as: -EB -n32 -march=from-abi +#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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to 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: [^\n]*: In function `foo':\n +#error: \(\.text\+0x[0-9a-f]+\): JALX to a non-word-aligned address\Z |