Understanding The Linux Kernel says that
do_execve( ) which in turn
copies the file pathname, command-line arguments, and environment strings into one or more newly allocated page frames. (Eventually, they are assigned to the User Mode address space.)
Am I correct that after
execve() terminates with success, the process invokes
_start routine of
According to APUE:
When a C program is executed by the kernel—by one of the exec functions, a special start-up routine is called before the main function is called. The executable program ﬁle speciﬁes this routine as the starting address for the program; this is set up by the link editor when it is invoked by the C compiler. This start-up routine takes values from the kernel—the command-line arguments and the environment — and sets things up so that the main function is called as shown earlier.
__start routine also copy command line arguments and the environment again?
What are differences between
_start both copying the command line arguments and environment? Isn't it wasteful to copy twice?
_start, although compilers love to add such symbol name for it