bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/25750] GNU as has inconsistent behavior when expanding .ma


From: caij2003 at gmail dot com
Subject: [Bug binutils/25750] GNU as has inconsistent behavior when expanding .macro that takes as input directives with arguments
Date: Mon, 06 Apr 2020 19:18:08 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=25750

--- Comment #6 from Jian Cai <caij2003 at gmail dot com> ---

> So this:
> 
>   .macro foo insn1 insn2
>   \insn1 \insn2
>   .endm
> 
>       foo .section .sec1
> 
> Does work.

Thanks for the suggestion. I found this issue while working on
https://github.com/ClangBuiltLinux/linux/issues/939. Essentially, the following
case assembled with arm-linux-gnueabihf-gcc but not clang.

$ cat bad.s
.macro alternative_insn insn1
.endm

alternative_insn .inst (0x0)

There were several ways to make it work with clang, including removing the
space between .inst and its argument, quoting the directive and its arguments,
and now using vararg as you suggested. 

I made an LLVM patch for (https://reviews.llvm.org/D76962), which will make
clang's integrated assembler to treat .inst and its arguments as one macro
argument in the above example. It did not go though upstream review as it would
create mismatch between clang and gcc, so I am curious if gcc is interested to
have more general support, so that code like the example in Comment 4 will work
without being rewritten.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]