Loading of executable programs Author Bérénice Angremy + original works reprint please specify source + "Linux kernel analysis" MOOC course http://mooc.study.163.com/course/USTC-1000029000 how did the executable come from?
Format of the destination file elf
Statically linked elf executable file and process address space
Work before the executable program is loaded
- Executable Environment for executable programs
The shell command line, the parameters of the main function, and the parameters of the Execve shell call Execve to pass the command-line arguments and environment parameters to the main function of the executable program, first the function call parameter passing, and then the system call parameter passing.
Execve and Fork are a special point of the system call: The general is to fall into the kernel state and then return to the user state. Fork parent process and general process scheduling, the child process returns to a specific point ret fromFork, the child process starts from theret from fork and then returns to the user state;
The address space is generally 0x8048000 or 0x8048300;
EXECVE Special: Execute to executable program--fall into kernel--construct new executable file--Overwrite the original executables--return to the new executor, as a starting point (that is, main function), need to construct his execution environment;
Static Link: Elfentry points to the head of the executable file, usually the main function; 2. Dynamic Link: Elfentry point to the beginning of LD
Executable Program Load Measurement
Simple analysis on loading of dynamically linked executable program
(1) You can focus on interp and dynamic in the ELF format.
(2) The loading process of a dynamic link library is a graph traversal.
(3) After loading and connecting the LD gives the CPU control to the executable program.
Seventh Week Linux Kernel analysis