Deep understanding of computer systems

Source: Internet
Author: User

Linking is the process of collecting and combining code and data from different parts into a single file, which can be loaded (or copied) to the memory and executed. The link can be executed at compile time, that is, when the source code is translated into its code, or load time ), that is, when a program is loaded into memory and executed by the loader, or even run time, It is executed by the application.

Connectors play a key role in software development because they make separate compilation possible. Instead of organizing a large application into a huge source file, we can break it into smaller, better-managed modules that can be modified and compiled independently. When we change one of these modules, we just need to simply recompile it and relink it to the application without re-compiling other files.

1: Understanding the linker will help you build large programs. Programmers who construct large programs often encounter linker errors due to lack of modules, libraries, or incompatible library versions. Unless you understand how the linker parses the reference, what is the library, and how the linker uses the library to parse the reference, you will be confused and frustrated by such errors.

2: Understanding the linker will help you avoid some dangerous programming errors. The decisions made by the Unix linker when parsing a symbolic reference can affect the correctness of your program. By default, programs that incorrectly define multiple global variables will use the linker without generating any warning information. The resulting program produces confusing runtime behavior and is very difficult to debug. We will show you how this happened and how to avoid it.

3: Understanding the linker will help you understand how the language's scope rules are implemented. For example, what is the difference between global variables and local variables? What does it actually mean when you define a variable or function with a static attribute?

4: Understanding the link will help you understand other important system concepts. The executable target file generated by the linker plays a key role in important system functions, such as loading and running programs, virtual memory, paging and memory ing.

5: Understanding the link will enable you to develop shared libraries. For many years, links have been considered simple and boring. However, with the increasing importance of shared libraries and dynamic connections in modern operating systems, connections have become a complex process and provide powerful capabilities for knowledgeable programmers. For example, many software products use a shared library to upgrade the shrink-wrapped binary program at runtime. In addition, most Web servers rely on the Dynamic Links of shared libraries to provide dynamic content.

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.