Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在阅读Red 站点时,我遇到了一个声明,指出编译一个 hello world Red/System 程序会创建..
“...一个 162 字节的 ELF 二进制文件,而类似的 C 代码将使用 Gcc 生成一个 5-6KB 的二进制文件”
太棒了。有人可以解释/指出使这种优化成为可能的技术吗?
它是通过一个几乎空的运行时库(只有几个系统调用包装器)和一个 ELF 发射器来实现的,它不会对齐 4K 页面边界上的部分以实现最佳加载。
虽然,这对于 Red/System 0.1.0是正确的,所以在早期,不再正确(现在它与其他编译器类似)。虽然我们仍然有一个-r编译选项来编译 Red/System 代码而无需任何运行时,但由于没有人使用它,它可能不再工作(如果有人需要它应该很容易修复,只需访问 Red 的聊天并询问它。 ;-))
-r