Is there a way to have the GNU assembly process a source file that contains macros, expand them, and then output the expanded equivalent code in a form that could be assembled by as? Basically, I'm looking for something that's an equivalent of gcc's -E argument.
I have found the -a -am options (as per this question here) but it doesn't output code in a form that can be assembled, but rather outputs the process of expanding the macros in a heavily annotated fashion. The expanded code is mixed in with a lot of other stuff. It might be possible to parse that output and get what I want, but I'm hoping there's a way to get it to just output the expanded assembly code that it would actually turn into machine code.
(In case it matters, I am cross-compiling to m68k, so I'm limited to tools that can work with that.)
gcc -x assembler-with-cpp -Sdo what you want?objconvcan disassemble into source that's ready to be assembled. But you'd lose stuff like.p2aligndirectives, and of course comments. Depends on the use-case whether that's useful.objdump -drw. For example How to disassemble a binary executable in Linux to get the assembly code? uses asedcommand on the output ofllvm-objdump 'foo.o' --no-show-raw-insn --no-leading-addr -d -C --symbolize-operands -j.text(With-Mintelsince they're using x86 with Intel syntax, but hopefully the sed command would only need minor changes for the characters that can appear in m68k syntax.)