aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog19
-rw-r--r--binutils/testsuite/binutils-all/mips/micromips-branch-alias.d17
-rw-r--r--binutils/testsuite/binutils-all/mips/micromips-branch-alias.s17
-rw-r--r--binutils/testsuite/binutils-all/mips/micromips-branch-noalias.d17
-rw-r--r--binutils/testsuite/binutils-all/mips/mips-branch-alias.s18
-rw-r--r--binutils/testsuite/binutils-all/mips/mips.exp8
-rw-r--r--binutils/testsuite/binutils-all/mips/mips1-branch-alias.d17
-rw-r--r--binutils/testsuite/binutils-all/mips/mips1-branch-noalias.d17
-rw-r--r--binutils/testsuite/binutils-all/mips/mips2-branch-alias.d18
-rw-r--r--binutils/testsuite/binutils-all/mips/mips2-branch-noalias.d18
-rw-r--r--binutils/testsuite/binutils-all/mips/mips32r6-branch-alias.d17
-rw-r--r--binutils/testsuite/binutils-all/mips/mips32r6-branch-noalias.d17
12 files changed, 200 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 1a8da33..a355e18 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,22 @@
+2021-03-06 Maciej W. Rozycki <macro@orcam.me.uk>
+
+ * testsuite/binutils-all/mips/mips1-branch-alias.d: New test.
+ * testsuite/binutils-all/mips/mips1-branch-noalias.d: New test.
+ * testsuite/binutils-all/mips/mips2-branch-alias.d: New test.
+ * testsuite/binutils-all/mips/mips2-branch-noalias.d: New test.
+ * testsuite/binutils-all/mips/mips32r6-branch-alias.d: New test.
+ * testsuite/binutils-all/mips/mips32r6-branch-noalias.d: New
+ test.
+ * testsuite/binutils-all/mips/micromips-branch-alias.d: New
+ test.
+ * testsuite/binutils-all/mips/micromips-branch-noalias.d: New
+ test.
+ * testsuite/binutils-all/mips/mips-branch-alias.s: New test
+ source.
+ * testsuite/binutils-all/mips/micromips-branch-alias.s: New test
+ source.
+ * testsuite/binutils-all/mips/mips.exp: Run the new tests.
+
2022-03-04 Simon Marchi <simon.marchi@polymtl.ca>
* readelf.c (process_dynamic_section): Fix indentation.
diff --git a/binutils/testsuite/binutils-all/mips/micromips-branch-alias.d b/binutils/testsuite/binutils-all/mips/micromips-branch-alias.d
new file mode 100644
index 0000000..3a5a879
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/micromips-branch-alias.d
@@ -0,0 +1,17 @@
+#PROG: objcopy
+#objdump: -d --prefix-addresses --show-raw-insn
+#name: microMIPS branch instruction alias disassembly
+#source: micromips-branch-alias.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 9400 0000 b [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 4040 0000 b [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 40e0 0000 bc [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 9401 0000 beqz at,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> b401 0000 bnez at,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 4060 0000 bal [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 4260 0000 bals [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 0000 0000 nop
+ \.\.\.
diff --git a/binutils/testsuite/binutils-all/mips/micromips-branch-alias.s b/binutils/testsuite/binutils-all/mips/micromips-branch-alias.s
new file mode 100644
index 0000000..3d27bb4
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/micromips-branch-alias.s
@@ -0,0 +1,17 @@
+ .text
+ .set mips32r3
+ .set noat
+ .set noreorder
+ .set micromips
+foo:
+ beq $0, $0, . + 4
+ bgez $0, . + 4
+ beqzc $0, . + 4
+ beqz $1, . + 4
+ bnez $1, . + 4
+ bgezal $0, . + 4
+ bgezals $0, . + 4
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16
diff --git a/binutils/testsuite/binutils-all/mips/micromips-branch-noalias.d b/binutils/testsuite/binutils-all/mips/micromips-branch-noalias.d
new file mode 100644
index 0000000..3c9fa7d
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/micromips-branch-noalias.d
@@ -0,0 +1,17 @@
+#PROG: objcopy
+#objdump: -M no-aliases -d --prefix-addresses --show-raw-insn
+#name: microMIPS branch canonical alias disassembly
+#source: micromips-branch-alias.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 9400 0000 beq zero,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 4040 0000 bgez zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 40e0 0000 beqzc zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 9401 0000 beq at,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> b401 0000 bne at,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 4060 0000 bgezal zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 4260 0000 bgezals zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 0000 0000 sll zero,zero,0x0
+ \.\.\.
diff --git a/binutils/testsuite/binutils-all/mips/mips-branch-alias.s b/binutils/testsuite/binutils-all/mips/mips-branch-alias.s
new file mode 100644
index 0000000..dfde3c0
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/mips-branch-alias.s
@@ -0,0 +1,18 @@
+ .text
+ .set noat
+ .set noreorder
+ .set mips2
+foo:
+ beq $0, $0, . + 4
+ bgez $0, . + 4
+ bgezal $0, . + 4
+ bltzal $0, . + 4
+ beqz $1, . + 4
+ bnez $1, . + 4
+
+ beqzl $1, . + 4
+ bnezl $1, . + 4
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16
diff --git a/binutils/testsuite/binutils-all/mips/mips.exp b/binutils/testsuite/binutils-all/mips/mips.exp
index 3d818f8..b6fe11d 100644
--- a/binutils/testsuite/binutils-all/mips/mips.exp
+++ b/binutils/testsuite/binutils-all/mips/mips.exp
@@ -238,6 +238,14 @@ run_dump_test_o32 "mips16-extend-insn" noarch
run_dump_test_o32 "mips16e2-extend-insn" noarch
run_dump_test_o32 "mips16-alias" noarch
run_dump_test_o32 "mips16-noalias" noarch
+run_dump_test_o32 "mips1-branch-alias"
+run_dump_test_o32 "mips1-branch-noalias"
+run_dump_test_o32 "mips2-branch-alias"
+run_dump_test_o32 "mips2-branch-noalias"
+run_dump_test_o32 "mips32r6-branch-alias"
+run_dump_test_o32 "mips32r6-branch-noalias"
+run_dump_test_o32 "micromips-branch-alias"
+run_dump_test_o32 "micromips-branch-noalias"
run_dump_test_o32 "mips-note-2"
run_dump_test_n32 "mips-note-2-n32"
diff --git a/binutils/testsuite/binutils-all/mips/mips1-branch-alias.d b/binutils/testsuite/binutils-all/mips/mips1-branch-alias.d
new file mode 100644
index 0000000..467775f
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/mips1-branch-alias.d
@@ -0,0 +1,17 @@
+#PROG: objcopy
+#objdump: -m mips:3000 -d --prefix-addresses --show-raw-insn
+#name: MIPS1 branch instruction alias disassembly
+#source: mips-branch-alias.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 10000000 b [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04010000 b [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04110000 bal [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04100000 bltzal zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 10200000 beqz at,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 14200000 bnez at,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 50200000 0x50200000
+[0-9a-f]+ <[^>]*> 54200000 0x54200000
+ \.\.\.
diff --git a/binutils/testsuite/binutils-all/mips/mips1-branch-noalias.d b/binutils/testsuite/binutils-all/mips/mips1-branch-noalias.d
new file mode 100644
index 0000000..b3fa8a0
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/mips1-branch-noalias.d
@@ -0,0 +1,17 @@
+#PROG: objcopy
+#objdump: -M no-aliases -m mips:3000 -d --prefix-addresses --show-raw-insn
+#name: MIPS1 branch canonical alias disassembly
+#source: mips-branch-alias.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 10000000 beq zero,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04010000 bgez zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04110000 bgezal zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04100000 bltzal zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 10200000 beq at,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 14200000 bne at,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 50200000 0x50200000
+[0-9a-f]+ <[^>]*> 54200000 0x54200000
+ \.\.\.
diff --git a/binutils/testsuite/binutils-all/mips/mips2-branch-alias.d b/binutils/testsuite/binutils-all/mips/mips2-branch-alias.d
new file mode 100644
index 0000000..f1fbeea
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/mips2-branch-alias.d
@@ -0,0 +1,18 @@
+#PROG: objcopy
+#objdump: -m mips:6000 -d --prefix-addresses --show-raw-insn
+#name: MIPS2 branch instruction alias disassembly
+#source: mips-branch-alias.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 10000000 b [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04010000 b [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04110000 bal [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04100000 bltzal zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 10200000 beqz at,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 14200000 bnez at,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 50200000 beqzl at,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 54200000 bnezl at,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 00000000 nop
+ \.\.\.
diff --git a/binutils/testsuite/binutils-all/mips/mips2-branch-noalias.d b/binutils/testsuite/binutils-all/mips/mips2-branch-noalias.d
new file mode 100644
index 0000000..0f819e8
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/mips2-branch-noalias.d
@@ -0,0 +1,18 @@
+#PROG: objcopy
+#objdump: -M no-aliases -m mips:6000 -d --prefix-addresses --show-raw-insn
+#name: MIPS2 branch canonical alias disassembly
+#source: mips-branch-alias.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 10000000 beq zero,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04010000 bgez zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04110000 bgezal zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04100000 bltzal zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 10200000 beq at,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 14200000 bne at,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 50200000 beql at,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 54200000 bnel at,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 00000000 sll zero,zero,0x0
+ \.\.\.
diff --git a/binutils/testsuite/binutils-all/mips/mips32r6-branch-alias.d b/binutils/testsuite/binutils-all/mips/mips32r6-branch-alias.d
new file mode 100644
index 0000000..aebbb26
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/mips32r6-branch-alias.d
@@ -0,0 +1,17 @@
+#PROG: objcopy
+#objdump: -m mips:isa32r6 -d --prefix-addresses --show-raw-insn
+#name: MIPS32r6 branch instruction alias disassembly
+#source: mips-branch-alias.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 10000000 b [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04010000 b [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04110000 bal [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04100000 nal
+[0-9a-f]+ <[^>]*> 10200000 beqz at,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 14200000 bnez at,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 50200000 0x50200000
+[0-9a-f]+ <[^>]*> 54200000 0x54200000
+ \.\.\.
diff --git a/binutils/testsuite/binutils-all/mips/mips32r6-branch-noalias.d b/binutils/testsuite/binutils-all/mips/mips32r6-branch-noalias.d
new file mode 100644
index 0000000..d7d512f
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/mips32r6-branch-noalias.d
@@ -0,0 +1,17 @@
+#PROG: objcopy
+#objdump: -M no-aliases -m mips:isa32r6 -d --prefix-addresses --show-raw-insn
+#name: MIPS32r6 branch canonical alias disassembly
+#source: mips-branch-alias.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 10000000 beq zero,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04010000 bgez zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04110000 bal [0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 04100000 nal
+[0-9a-f]+ <[^>]*> 10200000 beq at,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 14200000 bne at,zero,[0-9a-f]+ <[^>]*>
+[0-9a-f]+ <[^>]*> 50200000 0x50200000
+[0-9a-f]+ <[^>]*> 54200000 0x54200000
+ \.\.\.