x86: handle SVR4 escaped binary operators

PR gas/4572

When / is a comment character, its use as binary "divide" operator needs
escaping by a backslash. Besides the scrubber needing to support this
(addressed in an earlier change), there are also a few provisions needed
in target specific operator handling.

As the spec calls for % and * to also be escaped because of being
"overloaded", also recognize these, despite the overloading there not
really preventing their use as operators in most (%) or all (*) cases,
given the way how the rest of the assembler works.

To bring source and testsuite in line, also drop the TE_I386AIX part of
the respective conditional, as i?86-*-aix* support had been removed a
while ago.
This commit is contained in:
Jan Beulich
2020-07-20 08:57:18 +02:00
parent 750e4bf70f
commit b3983e5f53
6 changed files with 95 additions and 7 deletions

View File

@@ -123,6 +123,16 @@ operatorT i386_operator (const char *name, unsigned int operands, char *pc)
{
unsigned int j;
#ifdef SVR4_COMMENT_CHARS
if (!name && operands == 2 && *input_line_pointer == '\\')
switch (input_line_pointer[1])
{
case '/': input_line_pointer += 2; return O_divide;
case '%': input_line_pointer += 2; return O_modulus;
case '*': input_line_pointer += 2; return O_multiply;
}
#endif
if (!intel_syntax)
return O_absent;