Seventh Week Linux Kernel analysis

Source: Internet
Author: User

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
    • Entrance to the program: Entry Point address:0x8048300

    • A general static link places all the code in a single code snippet

    • A dynamically linked process will have multiple sections of code

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.