C程序:__start [英] C program: __start
问题描述
您能帮我了解一下吗
__start
是在C内部使用的吗?
是main
函数的精确副本还是它是编译程序的入口点?
Is it the exact replica of the main
function or is it the entry point to the compiled program?
想知道,它是如何使用的?
Just wondering, how its getting used?
推荐答案
此处很好地概述了程序在之前 main
启动期间发生的情况.从OS的角度来看,它特别表明__start
是程序的实际入口点.
Here is a good overview of what happens during program startup before main
. In particular, it shows that __start
is the actual entry point to your program from OS viewpoint.
这是指令指针的第一个地址,它将开始计入您的程序.
It is the very first address from which the instruction pointer will start counting in your program.
那里的代码调用一些C运行时库例程只是为了做一些内务处理,然后调用main
,然后放下东西并用返回的任何退出代码main
调用exit
.
The code there invokes some C runtime library routines just to do some housekeeping, then call your main
, and then bring things down and call exit
with whatever exit code main
returned.
一张图片值一千字:
这篇关于C程序:__start的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!