Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] m68k: work around binutils tokenizer change

Recent as(1) doesn't think that . terminates a macro name, so getuser.l is
_not_ treated as invoking getuser with .l as the first argument.
arch/m68k/math-emu relies on old behaviour, so it gets a lot of undefined
macros with more or less current binutils.

Note that this behaviour remains in all recent versions and is unrelated to
another binutils problems we used to have for a while (having (%a0)+ parsed
as two arguments). This one is there to stay; it's an intentional and
documented change.

.irp <identifier> <words>
[text]
.endr
expands to a copy of text per each word, with \<identifier> replaced with
corresponding word. Again, what happens depends on whether gas_ident.x
is treated as one or as two tokens; in the former case we'll get old_gas
incremented once, in the latter - twice. The rest is obvious.

Unlike .macro argument list _anything_ is explicitly allowed after
.irp <identifier>; here we are on very safe ground. And yes, it does
work with all gas variants I've got here (including vanilla 2.15, 2.16,
2.16.1 and 2.17, plus debian and FC binutils).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Al Viro and committed by
Linus Torvalds
38135614 fabb626a

+15
+15
include/asm-m68k/math-emu.h
··· 226 226 .previous 227 227 .endm 228 228 229 + /* work around binutils idiocy */ 230 + old_gas=-1 231 + .irp gas_ident.x .x 232 + old_gas=old_gas+1 233 + .endr 234 + .if !old_gas 235 + .irp m b,w,l 236 + .macro getuser.\m src,dest,label,addr 237 + getuser .\m,\src,\dest,\label,\addr 238 + .endm 239 + .macro putuser.\m src,dest,label,addr 240 + putuser .\m,\src,\dest,\label,\addr 241 + .endm 242 + .endr 243 + .endif 229 244 230 245 .macro movestack nr,arg1,arg2,arg3,arg4,arg5 231 246 .if \nr