有没有办法在GCC中不用汇编就可以编译程序?

发布于 2024-12-25 03:53:42 字数 297 浏览 3 评论 0原文

可能的重复:
使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遗忘曾经 2025-01-01 03:53:42

只要写gcc -S file.c,你就会得到file.s,它是程序集。

just write gcc -S file.c, and you will get file.s which is assembly.

爱人如己 2025-01-01 03:53:42

是的。是-S。请参阅手册

Yes. It's -S. See the manual.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文