aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-08-19 06:38:21 -0700
committerH.J. Lu <hjl.tools@gmail.com>2021-08-19 07:01:20 -0700
commit7e40d574be8b8bc01d3726b90556cff0081e9dd9 (patch)
tree616c46809f70e57ca26b18743e8c1951ac5db857 /gas
parent8ddf46454aa981246f9611b1897f41fabd2a108d (diff)
downloadfsf-binutils-gdb-7e40d574be8b8bc01d3726b90556cff0081e9dd9.zip
fsf-binutils-gdb-7e40d574be8b8bc01d3726b90556cff0081e9dd9.tar.gz
fsf-binutils-gdb-7e40d574be8b8bc01d3726b90556cff0081e9dd9.tar.bz2
x86: Avoid abort on invalid broadcast
Print "{bad}" on invalid broadcast instead of abort. gas/ PR binutils/28247 * testsuite/gas/i386/bad-bcast.d: New file. * testsuite/gas/i386/bad-bcast.s: Likewise. * testsuite/gas/i386/i386.exp: Run bad-bcast. opcodes/ PR binutils/28247 * i386-dis.c (OP_E_memory): Print "{bad}" on invalid broadcast instead of abort.
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/gas/i386/bad-bcast.d14
-rw-r--r--gas/testsuite/gas/i386/bad-bcast.s2
-rw-r--r--gas/testsuite/gas/i386/i386.exp1
3 files changed, 17 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/bad-bcast.d b/gas/testsuite/gas/i386/bad-bcast.d
new file mode 100644
index 0000000..9fc474a
--- /dev/null
+++ b/gas/testsuite/gas/i386/bad-bcast.d
@@ -0,0 +1,14 @@
+#objdump: -dw
+#name: Disassemble bad broadcast
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <.text>:
+ +[a-f0-9]+: 62 .byte 0x62
+ +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: 8c 1d 66 90 66 90 mov %ds,0x90669066
+ +[a-f0-9]+: 66 90 xchg %ax,%ax
+#pass
diff --git a/gas/testsuite/gas/i386/bad-bcast.s b/gas/testsuite/gas/i386/bad-bcast.s
new file mode 100644
index 0000000..e09c3aa
--- /dev/null
+++ b/gas/testsuite/gas/i386/bad-bcast.s
@@ -0,0 +1,2 @@
+ .text
+ .byte 0x62, 0xc3, 0x8c, 0x1d, 0x66, 0x90, 0x66, 0x90, 0x66, 0x90
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index f5eda2c..8095972 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -646,6 +646,7 @@ if [gas_32_check] then {
run_dump_test "dw2-compress-2"
run_dump_test "dw2-compressed-2"
+ run_dump_test "bad-bcast"
run_dump_test "bad-size"
run_dump_test "size-1"