forked from Imagelibrary/binutils-gdb
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user