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