写在前面
这篇文章通过gdb来跟踪一下main函数之前,CRT(C runtime)帮我们做了哪些事情。具体的调试环境搭建可以参考我的另一篇博文《源码级调试glibc》。
参考链接:
《The thorny path of Hello World》
《Before Main()》(需梯子)
《Life Cycle of a Linux Program | Glenn's Web Site》
《How main() is executed on Linux 》
《Building executables with GNU linker》
《How statically linked programs run on Linux》
《How is a binary executable organized? Let's explore it!》
《canary分析》
《main之前 》
《Linux Programe/Dynamic Shared Library Entry/Exit Point Glibc Entry Point/Function》
《链接脚本在编程中的高级运用之二——运行时库和C++特性支持》
引申话题:
exit函数
C++构造和析构函数
__cxa_atexit()

本文通过gdb调试工具深入探讨了在main函数执行之前,C运行时库(CRT)完成的各项初始化任务。从调试环境搭建到具体的过程解析,并参考了多篇专业文献,详细介绍了CRT如何为程序的顺利运行打下基础。
1万+

被折叠的 条评论
为什么被折叠?



