C Language Learning Notes

Source: Internet
Author: User

1, compilation mechanism:

Converting a source file into an executable is a two-step process: compiling and linking. The compiler translates the source code into intermediate code, which the linker combines with other code to generate the executable file. Intermediate files are available in a variety of forms, most commonly in the form of converting source code to machine language code and placing the result in a target code file (abbreviated to the target file). Although this target file contains machine language code, this file is not yet operational. The destination file contains the conversion result of the source code, but it is not yet a complete program.

There are two elements missing from the target file: The first is something called the startup code, which is equivalent to the interface between the program and the operating system. The second is the code of the library routine (that is, the library function), that is, the actual code of the function used in the written program is not in the target file.

The purpose of the linker is to combine the three elements (the target code, the standard boot code of the system, and the library code) and place them in a single file to execute the file. In the case of library code, the linker extracts the function code used in the written program.

On most systems, the compiler can start the linker automatically, so just give the compile command.

C Language Learning Notes

Related Article

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.