aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-03-20 16:57:42 +0100
committerJan Beulich <jbeulich@suse.com>2023-03-20 16:57:42 +0100
commitccb05c9c999f274c92b09f4b29c41d91cece88cf (patch)
tree3c8cad5dd1a760e7be49aa0ed933a6ae0fa314f2
parent3f155099ad1e69a028c3585040c89fd0b77d6f25 (diff)
downloadbinutils-ccb05c9c999f274c92b09f4b29c41d91cece88cf.zip
binutils-ccb05c9c999f274c92b09f4b29c41d91cece88cf.tar.gz
binutils-ccb05c9c999f274c92b09f4b29c41d91cece88cf.tar.bz2
x86/AT&T: restrict recognition of the "absolute branch" prefix character
While in principle merely rejecting this for .insn would be sufficient for the purposes there, be more generic and reject it for anything that isn't going to be a branch: All elements of same-mnemonic template groups either are branches, or are not, and the few cases possibly requiring a 2nd parsing pass aren't affected either. This then also improves diagnostics for misuses like inc *%eax incl %fs:*(%eax) add *$1, %eax
-rw-r--r--gas/config/tc-i386.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index ebfcda4..fb75594 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -11423,7 +11423,8 @@ i386_att_operand (char *operand_string)
/* We check for an absolute prefix (differentiating,
for example, 'jmp pc_relative_label' from 'jmp *absolute_label'. */
- if (*op_string == ABSOLUTE_PREFIX)
+ if (*op_string == ABSOLUTE_PREFIX
+ && current_templates->start->opcode_modifier.jump)
{
++op_string;
if (is_space_char (*op_string))
@@ -11454,7 +11455,8 @@ i386_att_operand (char *operand_string)
++op_string;
/* Handle case of %es:*foo. */
- if (!i.jumpabsolute && *op_string == ABSOLUTE_PREFIX)
+ if (!i.jumpabsolute && *op_string == ABSOLUTE_PREFIX
+ && current_templates->start->opcode_modifier.jump)
{
++op_string;
if (is_space_char (*op_string))