C language code compilation process

Source: Internet
Author: User

1 Source File hello. C (text) -- à Preprocessor ---- à hello. I (text)
Preprocessor: insert the content of the # include file into this command, check the full-text processing # define macro definition, and compile the command for processing conditions # If # endif unneeded code, after processing, generate the modified source code hello. i.
2 Hello. I (text) ---- à compiler ------ à hello. S (assembler text)
Compiler: the lexical analysis syntax analysis generates an Assembly statement such as mov ax and BX, which is equivalent to the source file of the optimized assembly language.
3 Hello. S (Assembly text) ------ à assembler ---- à hello. O (Binary of the target file)
Assembler: translates the Assembly source file into the corresponding machine commands, and also writes something into a package with the machine commands into a file that can be located in the target program format hello. o
4 hello. o)
Connector: for example, hello. O calls the standard library function eg prinf. The function of the connector is to find the target file XX where prinf is located. O or xx. lib and insert the program to our hello. o, specifically, what is the details and how to find xx. what about o? Is it just incorporated into the functions used?

5. Execute hello.exe: when running a program under OS, for example, we use double
Clicka xx.exe icon. First, the OS calls a function called the loader. After reading and analyzing the information in the executable file, it copies its code and data
In memory, and then perform some operations (?) Transfer control to this program.

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.