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.
最近我一直在尝试调试一些低级工作,但我找不到crt0.S编译器(avr-gcc),但我确实找到了一个crt1.S(与相应的.o文件相同)。
crt0.S
crt1.S
.o
这两个文件有什么区别?是crt1完全不同还是什么?它们似乎都与“引导”(设置stack frame等)有关,但为什么要区分呢?
crt1
stack frame
crt0/crt1 都做同样的事情,基本上都是在调用 main() 之前做需要做的事情(比如初始化堆栈,设置 irqs 等)。您应该链接其中之一,但不能同时链接两者。它们不是真正的库,而是真正的内联汇编代码。
据我了解,crt 有两种“口味”