有没有办法在GCC中不用汇编就可以编译程序?
可能的重复:
使用 GCC 生成可读的程序集?
例如,当我尝试:
- c myprogram
它会给我一个二进制形式的目标文件。我想要得到的只是一个汇编文件(就在汇编程序处理它以生成目标文件之前)。有没有办法在 gcc 中做到这一点?
Possible Duplicate:
Using GCC to produce readable assembly?
For example, when I try:
gcc -c myprogram
it will give me an object file, which is in binary form. What I would like to get is just an assembly file (right before it is processed by an assembler to produce the object file). Is there a way to do it in gcc?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只要写
gcc -S file.c
,你就会得到file.s,它是程序集。just write
gcc -S file.c
, and you will get file.s which is assembly.是的。是-S。请参阅手册。
Yes. It's -S. See the manual.