为我的操作系统移植NewLib:一些问题

pim*_*oum 7 c gcc ld newlib

我正在尝试为我的操作系统移植NewLib(我正在关注本教程:http://wiki.osdev.org/Porting_Newlib ),我有一些问题.

谢谢你的回答!

nic*_*men 1

作为第一个对象链接可能会像您显示的那样工作得很好,但文档确实提到使用链接器脚本并将 crt0.o 添加为 STARTUP() - 我对链接器脚本不太熟悉,但您可以找到默认值链接器脚本并可能创建它/调整它:

链接脚本的语法:http://wiki.osdev.org/Linker_Scripts

http://sourceware.org/binutils/docs-2.19/ld/Scripts.html#Scripts

The linker always uses a linker script. If you do not supply one yourself, the linker
will use a default script that is compiled into the linker executable. You can use the 
`--verbose' command line option to display the default linker script. Certain command
line options, such as `-r' or `-N', will affect the default linker script.
Run Code Online (Sandbox Code Playgroud)

对于始终必须成为链接一部分的其他系统库,也可以执行相同的操作。

在命令行上全部添加还好,但最后有点繁琐。

自从您询问以来,您是否收到任何错误或错误的结果?