]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
x86: undo '{' being a symbol-start character
authorJan Beulich <jbeulich@suse.com>
Fri, 19 Jul 2024 09:44:07 +0000 (11:44 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 19 Jul 2024 09:44:07 +0000 (11:44 +0200)
commit0ff4e567db6c3c9da83073fe6abe27f561a2475b
tree2b1d65faf0f0b9d99feaa09653b61288cf4d09b9
parente3bfcef3f2cec94be9983d21e6e08bf28e2a3e52
x86: undo '{' being a symbol-start character

Having it that way has undue side effects, in permitting not only
pseudo-prefixes to be parsed correctly, but also permitting odd symbol
names which ought to be possible only when quoted.  Borrow what other
architectures do: Put in place an "unrecognized line" hook to parse off
any pseudo prefixes, while using the "start of line" hook to reject ones
not actually followed by an insn. For that parsing re-use parse_insn()
in yet a slightly different mode (dealing with only pseudo-prefixes).

With that, pp may no longer be cleared from init_globals(), but instead
needs clearing after a line was fully processed. Since md_assemble() has
pretty many return paths, convert that into a local helper, with a
trivial wrapper around it.

Similarly pp may no longer be updated (by check_register()) when
processing anything other than insn operands. To be able to (easily)
recognize the case, clear current_templates.start when done with an insn
(or with .insn).
gas/config/tc-i386.c
gas/config/tc-i386.h