What is the rationale behind removing crt0.o from gcc4.7.x?

吃可爱长大的小学妹 提交于 2019-12-01 17:05:12

问题


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

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:

  • compile with -nostartfiles
  • copy the crt0.o form the 4.6.x to the 4.7.x folder

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?


回答1:


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.



来源:https://stackoverflow.com/questions/16981704/what-is-the-rationale-behind-removing-crt0-o-from-gcc4-7-x

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!