文章目录
参考
https://www.geeksforgeeks.org/executing-main-in-c-behind-the-scene/
流程图
当从command line / shell/ bash 调用程序时,是使用的execve系统调用。
文件读取
如果格式是elf,则会通过load_elf_binary 函数找到elf文件的入口函数。
也就是_start函数的地址开始 start_thread.
main
最终通过_start - > __libc_start_main -> main 调用到main 函数,