aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog9
-rw-r--r--ld/testsuite/ld-mips-elf/mips-elf.exp5
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-branch-2.d19
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-branch-3.d20
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-branch-addend-2.d19
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-branch-addend-3.d20
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-branch.s15
7 files changed, 107 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index c1b7f45..be31872 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,12 @@
+2016-06-28 Maciej W. Rozycki <macro@imgtec.com>
+
+ * testsuite/ld-mips-elf/mips16-branch-2.d: New test.
+ * testsuite/ld-mips-elf/mips16-branch-3.d: New test.
+ * testsuite/ld-mips-elf/mips16-branch-addend-2.d: New test.
+ * testsuite/ld-mips-elf/mips16-branch-addend-3.d: New test.
+ * testsuite/ld-mips-elf/mips16-branch.s: New test source.
+ * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
+
2016-06-27 Nick Clifton <nickc@redhat.com>
PR ld/20302
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index 8fb55e4..0d5842f 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -143,6 +143,11 @@ run_dump_test "mips16-1"
# MIPS branch offset final link checking.
run_dump_test "branch-misc-1"
+run_dump_test "mips16-branch-2" [list [list ld $abi_ldflags(o32)]]
+run_dump_test "mips16-branch-3" [list [list ld $abi_ldflags(o32)]]
+run_dump_test "mips16-branch-addend-2" [list [list ld $abi_ldflags(o32)]]
+run_dump_test "mips16-branch-addend-3" [list [list ld $abi_ldflags(o32)]]
+
# Jalx test
run_dump_test "jalx-1"
diff --git a/ld/testsuite/ld-mips-elf/mips16-branch-2.d b/ld/testsuite/ld-mips-elf/mips16-branch-2.d
new file mode 100644
index 0000000..9528733
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-branch-2.d
@@ -0,0 +1,19 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 link branch 2
+#source: ../../../gas/testsuite/gas/mips/mips16-branch-reloc-2.s
+#as: -EB -32
+#ld: -EB -Ttext 0x1c000000 -e bar
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+ \.\.\.
+[0-9a-f]+ <[^>]*> f000 1016 b 1c001030 <bar>
+[0-9a-f]+ <[^>]*> f000 6014 bteqz 1c001030 <bar>
+[0-9a-f]+ <[^>]*> f000 6112 btnez 1c001030 <bar>
+[0-9a-f]+ <[^>]*> f000 2210 beqz v0,1c001030 <bar>
+[0-9a-f]+ <[^>]*> f000 2a0e bnez v0,1c001030 <bar>
+[0-9a-f]+ <[^>]*> 6500 nop
+ \.\.\.
+[0-9a-f]+ <[^>]*> 6500 nop
+ \.\.\.
diff --git a/ld/testsuite/ld-mips-elf/mips16-branch-3.d b/ld/testsuite/ld-mips-elf/mips16-branch-3.d
new file mode 100644
index 0000000..88918c1
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-branch-3.d
@@ -0,0 +1,20 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 link branch 3
+#source: mips16-branch.s
+#source: ../../../gas/testsuite/gas/mips/mips16-branch-reloc-3.s
+#as: -EB -32
+#ld: -EB -Ttext 0x1c000000 -e bar
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+ \.\.\.
+[0-9a-f]+ <[^>]*> 6500 nop
+ \.\.\.
+[0-9a-f]+ <[^>]*> f7fe 100e b 1c001000 <bar>
+[0-9a-f]+ <[^>]*> f7fe 600c bteqz 1c001000 <bar>
+[0-9a-f]+ <[^>]*> f7fe 610a btnez 1c001000 <bar>
+[0-9a-f]+ <[^>]*> f7fe 2208 beqz v0,1c001000 <bar>
+[0-9a-f]+ <[^>]*> f7fe 2a06 bnez v0,1c001000 <bar>
+[0-9a-f]+ <[^>]*> 6500 nop
+ \.\.\.
diff --git a/ld/testsuite/ld-mips-elf/mips16-branch-addend-2.d b/ld/testsuite/ld-mips-elf/mips16-branch-addend-2.d
new file mode 100644
index 0000000..c724bdd
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-branch-addend-2.d
@@ -0,0 +1,19 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 link branch addend 2
+#source: ../../../gas/testsuite/gas/mips/mips16-branch-addend-2.s
+#as: -EB -32
+#ld: -EB -Ttext 0x1c000000 -e bar
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+ \.\.\.
+[0-9a-f]+ <[^>]*> f121 1010 b 1c002264 <bar\+0x1234>
+[0-9a-f]+ <[^>]*> f121 600e bteqz 1c002264 <bar\+0x1234>
+[0-9a-f]+ <[^>]*> f121 610c btnez 1c002264 <bar\+0x1234>
+[0-9a-f]+ <[^>]*> f121 220a beqz v0,1c002264 <bar\+0x1234>
+[0-9a-f]+ <[^>]*> f121 2a08 bnez v0,1c002264 <bar\+0x1234>
+[0-9a-f]+ <[^>]*> 6500 nop
+ \.\.\.
+[0-9a-f]+ <[^>]*> 6500 nop
+ \.\.\.
diff --git a/ld/testsuite/ld-mips-elf/mips16-branch-addend-3.d b/ld/testsuite/ld-mips-elf/mips16-branch-addend-3.d
new file mode 100644
index 0000000..84bccc7
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-branch-addend-3.d
@@ -0,0 +1,20 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS16 link branch addend 3
+#source: mips16-branch.s
+#source: ../../../gas/testsuite/gas/mips/mips16-branch-addend-3.s
+#as: -EB -32
+#ld: -EB -Ttext 0x1c000000 -e bar
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+ \.\.\.
+[0-9a-f]+ <[^>]*> 6500 nop
+ \.\.\.
+[0-9a-f]+ <[^>]*> f100 1008 b 1c002234 <foo\+0x214>
+[0-9a-f]+ <[^>]*> f100 6006 bteqz 1c002234 <foo\+0x214>
+[0-9a-f]+ <[^>]*> f100 6104 btnez 1c002234 <foo\+0x214>
+[0-9a-f]+ <[^>]*> f100 2202 beqz v0,1c002234 <foo\+0x214>
+[0-9a-f]+ <[^>]*> f100 2a00 bnez v0,1c002234 <foo\+0x214>
+[0-9a-f]+ <[^>]*> 6500 nop
+ \.\.\.
diff --git a/ld/testsuite/ld-mips-elf/mips16-branch.s b/ld/testsuite/ld-mips-elf/mips16-branch.s
new file mode 100644
index 0000000..0024cdd
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-branch.s
@@ -0,0 +1,15 @@
+ .text
+ .globl bar
+
+ .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