]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: correct absolute branch check with segment override
authorJan Beulich <jbeulich@suse.com>
Mon, 7 Jun 2021 10:02:15 +0000 (12:02 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 7 Jun 2021 10:02:15 +0000 (12:02 +0200)
This needs to happen before checking of what may legitimately start a
memory operand (like is done when there's no segment override). Plus a
second '*' shouldn't be permitted when one was already found before the
segment override.

gas/ChangeLog
gas/config/tc-i386.c

index 66e040aaa149afc260172dae4f8cd2f8661cd0f7..008027b1fc12f9d525961cf6d41d7dac9c15d01d 100644 (file)
@@ -1,3 +1,8 @@
+2021-06-07  Jan Beulich  <jbeulich@suse.com>
+
+       * config/tc-i386.c (i386_att_operand): Flip checking for '*' and
+       start-of-expression. Don't permit '*' when one was already seen.
+
 2021-06-07  Jan Beulich  <jbeulich@suse.com>
 
        * config/tc-i386.c (parse_operands): Don't check for matched
index a20aea287182c99b589ee343decf188433a77217..0fe439eddd5ac94d7751198738ba69e57ecea0e6 100644 (file)
@@ -11413,22 +11413,22 @@ i386_att_operand (char *operand_string)
          if (is_space_char (*op_string))
            ++op_string;
 
-         if (!is_digit_char (*op_string)
-             && !is_identifier_char (*op_string)
-             && *op_string != '('
-             && *op_string != ABSOLUTE_PREFIX)
-           {
-             as_bad (_("bad memory operand `%s'"), op_string);
-             return 0;
-           }
          /* Handle case of %es:*foo.  */
-         if (*op_string == ABSOLUTE_PREFIX)
+         if (!i.jumpabsolute && *op_string == ABSOLUTE_PREFIX)
            {
              ++op_string;
              if (is_space_char (*op_string))
                ++op_string;
              i.jumpabsolute = true;
            }
+
+         if (!is_digit_char (*op_string)
+             && !is_identifier_char (*op_string)
+             && *op_string != '(')
+           {
+             as_bad (_("bad memory operand `%s'"), op_string);
+             return 0;
+           }
          goto do_memory_reference;
        }