从 gcc4.7.x 中删除 crt0.o 背后的基本原理是什么? [英] What is the rationale behind removing crt0.o from gcc4.7.x?

查看:34
本文介绍了从 gcc4.7.x 中删除 crt0.o 背后的基本原理是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试升级到 yagarto4.7.2(对于那些想知道的人来说,又是一个 GNU ARM 工具链),这是为 Windows 移植的 gcc 和 binutils.但是,尝试编译一个简单的 Hello World 会产生:

I am trying to upgrade to yagarto4.7.2 (Yet Another GNU ARM toolchain, for those wondering), which is gcc and binutils, ported for Windows. However, trying to compile a simple Hello World yields:

c:/yagarto-20121222/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi
/bin/ld.exe: cannot find crt0.o: No such file or directory
collect2.exe: error: ld returned 1 exit status

现在,在这个 论坛它是由明显,这是启动initialziation库,这是在 gcc4.6.x 之后删除.提出了两种解决方案:

Now, in this forum it is made clear that this is the startup initialziation library, that was removed after gcc4.6.x. Two solutions are proposed:

  • 使用 -nostartfiles 编译
  • 将 crt0.o 从 4.6.x 复制到 4.7.x 文件夹

对于生产代码来说,两者都看起来很脏并且不可接受.那么有没有人知道为什么删除这个库以及它现在的等价物是什么?

Both look quite dirty and unacceptable for production code. So does anyone know why was this library removed and what is it's equivalent now?

推荐答案

crt0.o 派生自操作系统提供的 crt0.s.在裸机设置的情况下,此文件必须由实现提供.它包含启动和退出代码,例如用于将 .bss 归零.

crt0.o is derived from crt0.s, which is provided by the OS. In the case of bare metal setup, this file must be provided by the implementation. It contains startup and exit code, for example for zeroing the .bss.

这篇关于从 gcc4.7.x 中删除 crt0.o 背后的基本原理是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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