This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 3/3] x86: adjust ignored prefix warning for branches
- From: Jan Beulich <jbeulich at suse dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Fri, 20 Dec 2019 11:39:54 +0100
- Subject: [PATCH 3/3] x86: adjust ignored prefix warning for branches
- References: <e6cb32e1-eb85-5f93-7e0a-e19e8363afbd@suse.com>
There's no reason to not also issue them in Intel syntax mode, and it
can be quite helpful to mention the actual insn (after all there can be
multiple on a single line).
gas/
2019-12-XX Jan Beulich <jbeulich@suse.com>
* config/tc-i386-intel.c (output_branch, output_jump,
output_interseg_jump): Also emit skipped prefix warning in Intel
syntax mode. Name instruction in the warning text.
* testsuite/gas/i386/mpx-inval-1.l,
testsuite/gas/i386/notrackbad.l,
testsuite/gas/i386/x86-64-notrackbad.l: Adjust expectations.
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -7916,8 +7916,8 @@ output_branch (void)
i.prefixes--;
}
- if (i.prefixes != 0 && !intel_syntax)
- as_warn (_("skipping prefixes on this instruction"));
+ if (i.prefixes != 0)
+ as_warn (_("skipping prefixes on `%s'"), i.tm.name);
/* It's always a symbol; End frag & setup for relax.
Make sure there is enough room in this frag for the largest
@@ -8059,8 +8059,8 @@ output_jump (void)
i.prefixes -= 1;
}
- if (i.prefixes != 0 && !intel_syntax)
- as_warn (_("skipping prefixes on this instruction"));
+ if (i.prefixes != 0)
+ as_warn (_("skipping prefixes on `%s'"), i.tm.name);
p = frag_more (i.tm.opcode_length + size);
switch (i.tm.opcode_length)
@@ -8120,8 +8120,8 @@ output_interseg_jump (void)
if (code16)
size = 2;
- if (i.prefixes != 0 && !intel_syntax)
- as_warn (_("skipping prefixes on this instruction"));
+ if (i.prefixes != 0)
+ as_warn (_("skipping prefixes on `%s'"), i.tm.name);
/* 1 opcode; 2 segment; offset */
p = frag_more (prefix + 1 + 2 + size);
--- a/gas/testsuite/gas/i386/mpx-inval-1.l
+++ b/gas/testsuite/gas/i386/mpx-inval-1.l
@@ -2,15 +2,17 @@
.*:6: Error: expecting valid branch instruction after `bnd'
.*:7: Error: expecting valid branch instruction after `bnd'
.*:8: Error: expecting valid branch instruction after `bnd'
-.*:8: Warning: skipping prefixes on this instruction
+.*:8: Warning: skipping prefixes on `lcall'
.*:9: Error: expecting valid branch instruction after `bnd'
-.*:9: Warning: skipping prefixes on this instruction
+.*:9: Warning: skipping prefixes on `ljmp'
.*:10: Error: expecting valid branch instruction after `bnd'
.*:11: Error: expecting valid branch instruction after `bnd'
.*:14: Error: expecting valid branch instruction after `bnd'
.*:15: Error: expecting valid branch instruction after `bnd'
.*:16: Error: expecting valid branch instruction after `bnd'
+.*:16: Warning: skipping prefixes on `lcall'
.*:17: Error: expecting valid branch instruction after `bnd'
+.*:17: Warning: skipping prefixes on `ljmp'
.*:18: Error: expecting valid branch instruction after `bnd'
.*:19: Error: expecting valid branch instruction after `bnd'
GAS LISTING .*
@@ -27,11 +29,11 @@ GAS LISTING .*
.* Error: expecting valid branch instruction after `bnd'
[ ]*8[ ]+\?\?\?\? 9A000000 bnd lcall \$0x1234,\$xxx
.* Error: expecting valid branch instruction after `bnd'
-.* Warning: skipping prefixes on this instruction
+.* Warning: skipping prefixes on `lcall'
[ ]*8[ ]+003412
[ ]*9[ ]+\?\?\?\? EA000000 bnd ljmp \$0x1234,\$xxx
.* Error: expecting valid branch instruction after `bnd'
-.* Warning: skipping prefixes on this instruction
+.* Warning: skipping prefixes on `ljmp'
[ ]*9[ ]+003412
[ ]*10[ ]+\?\?\?\? F2E2E9 bnd loop foo
.* Error: expecting valid branch instruction after `bnd'
@@ -45,9 +47,11 @@ GAS LISTING .*
.* Error: expecting valid branch instruction after `bnd'
[ ]*16[ ]+\?\?\?\? 9A000000 bnd lcall 0x1234,xxx
.* Error: expecting valid branch instruction after `bnd'
+.* Warning: skipping prefixes on `lcall'
[ ]*16[ ]+003412
[ ]*17[ ]+\?\?\?\? EA000000 bnd ljmp 0x1234,xxx
.* Error: expecting valid branch instruction after `bnd'
+.* Warning: skipping prefixes on `ljmp'
[ ]*17[ ]+003412
[ ]*18[ ]+\?\?\?\? F2E2CE bnd loop foo
.* Error: expecting valid branch instruction after `bnd'
--- a/gas/testsuite/gas/i386/notrackbad.l
+++ b/gas/testsuite/gas/i386/notrackbad.l
@@ -1,6 +1,6 @@
.*: Assembler messages:
.*:6: Error: expecting indirect branch instruction after `notrack'
-.*:6: Warning: skipping prefixes on this instruction
+.*:6: Warning: skipping prefixes on `call'
.*:7: Error: expecting indirect branch instruction after `notrack'
.*:9: Error: same type of prefix used twice
.*:10: Error: same type of prefix used twice
@@ -16,7 +16,7 @@ GAS LISTING .*
[ ]*5[ ]+_start:
[ ]*6[ ]+\?\?\?\? [0-9A-F]* notrack call foo
\*\*\*\* Error: expecting indirect branch instruction after `notrack'
-\*\*\*\* Warning: skipping prefixes on this instruction
+\*\*\*\* Warning: skipping prefixes on `call'
[ ]*6[ ]+[0-9A-F]*
[ ]*7[ ]+\?\?\?\? [0-9A-F]* notrack jmp foo
\*\*\*\* Error: expecting indirect branch instruction after `notrack'
--- a/gas/testsuite/gas/i386/x86-64-notrackbad.l
+++ b/gas/testsuite/gas/i386/x86-64-notrackbad.l
@@ -1,6 +1,6 @@
.*: Assembler messages:
.*:6: Error: expecting indirect branch instruction after `notrack'
-.*:6: Warning: skipping prefixes on this instruction
+.*:6: Warning: skipping prefixes on `call'
.*:7: Error: expecting indirect branch instruction after `notrack'
.*:9: Error: same type of prefix used twice
.*:10: Error: same type of prefix used twice
@@ -16,7 +16,7 @@ GAS LISTING .*
[ ]*5[ ]+_start:
[ ]*6[ ]+\?\?\?\? [0-9A-F]* notrack call foo
\*\*\*\* Error: expecting indirect branch instruction after `notrack'
-\*\*\*\* Warning: skipping prefixes on this instruction
+\*\*\*\* Warning: skipping prefixes on `call'
[ ]*6[ ]+[0-9A-F]*
[ ]*7[ ]+\?\?\?\? [0-9A-F]* notrack jmp foo
\*\*\*\* Error: expecting indirect branch instruction after `notrack'