GCC:空程序== 23202字节? [英] GCC: Empty program == 23202 bytes?

查看:92
本文介绍了GCC:空程序== 23202字节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

test.c:

int main()
{
    return 0;
}

我没有使用任何标志(我是gcc的新手),只是命令:

I haven't used any flags (I am a newb to gcc) , just the command:

gcc test.c

我已经在win32上使用了最新的 GCC的TDM版本. 生成的可执行文件几乎为23KB,对于一个空程序来说太大了.

I have used the latest TDM build of GCC on win32. The resulting executable is almost 23KB, way too big for an empty program.

如何减小可执行文件的大小?

How can I reduce the size of the executable?

推荐答案

不要遵循其建议,但出于娱乐考虑,请阅读.

Don't follow its suggestions, but for amusement sake, read this 'story' about making the smallest possible ELF binary.

这篇关于GCC:空程序== 23202字节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆