"Programmer self-accomplishment" reading notes-Dynamic links

Source: Internet
Author: User

1, the meaning of dynamic link. Dynamic linking is the postponement of a link-time relocation until it is loaded. One advantage of dynamic linking, compared to static linking, is that it saves memory. Because the code that shares the file can be shared. When you use dynamic linking, both executable and shared files are loaded into memory. However, if many executables use the same trend file, the code portion of the shared file needs to be loaded only once, thus saving memory. Here, the data portion of the shared file is saved in one copy of each executable file. Therefore, the code in the shared file that is related to your own data can change because the address of the data is not deterministic. Once you change, you cannot achieve the purpose of code sharing. So, in this case, the general shared file is the address-independent code.

2, address-independent code. The purpose is that the instruction part does not need to be changed by the loading address at the time of loading, so the part of the instruction that needs to be modified should be separated from the data so that the instruction part can be left unchanged. This technique is called address-independent code technology. Here are a few scenarios for how to implement address-Independent:

(1)

"Programmer self-accomplishment" reading notes-Dynamic links

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.