x86: adjust ignored prefix warning for branches

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).
This commit is contained in:
Jan Beulich
2019-12-27 09:39:58 +01:00
parent 6cb0a70ef3
commit f2810fe00a
5 changed files with 27 additions and 14 deletions

View File

@ -1,3 +1,12 @@
2019-12-27 Jan Beulich <jbeulich@suse.com>
* config/tc-i386.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.
2019-12-27 Jan Beulich <jbeulich@suse.com>
* config/tc-i386.c (output_branch): Handle BND prefix the same

View File

@ -7914,8 +7914,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
@ -8057,8 +8057,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)
@ -8118,8 +8118,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);

View File

@ -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'

View File

@ -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'

View File

@ -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'