What happens if the loader can't load executable at the preffered address? Does it have to recalculate all addresses while loading and change the code section to fit new address for calls and jumps and new references to data? How can a dll have one code segment for different processes that had loaded it?
What happens if the loader can't load executable at the preffered address? Does it have to recalculate all addresses while loading and change the code section to fit new address for calls and jumps and new references to data?
How can a dll have one code segment for different processes that had loaded it?
Relocation information would have to be present.Thanks, BitRake.
So, 2 programs share the same dll code only if that code has been loaded at the same address by both of them.
So, 2 programs share the same dll code only if that code has been loaded at the same address by both of them.
So, 2 programs share the same dll code only if that code has been loaded at the same address by both of them.
2 programs share the same dll code even if it being loaded at different addresses.
The physical memory is the same but system maps this physical memory at different addresses in differrent processe
How is this possible, Four-F? The code section has to be modified to correct all the CALL's, so they have different code sections. Then how can this section be shared?
To Four-F. You are wrong That cannot be possible
My win32 api says
See Advantages of Dynamic Linking in win32 api reference.
My win32 api says
Processes that load a DLL AT THE SAME BASE ADDRESS can use a single DLL simultaneously, sharing a single copy of the DLL code in physical memory. Doing this saves memory and reduces swapping.
See Advantages of Dynamic Linking in win32 api reference.
With PE format files, EXE files mainly load at 400000h no matter what, DLLs are a problem in that if an EXE file loads 2 or more DLLs that have the same preferred base address, only one can be loaded at the base address and the others must be relocated.
Address clashes across different running processes can and do cause multiple loading of DLLs. One of the memory usage optimisations is to change the preferred load address for DLLs used by a single process so there is no need to relocate the DLL.
The EDITBIN utility can do that from memory.
Regards,
hutch@movsd.com
Address clashes across different running processes can and do cause multiple loading of DLLs. One of the memory usage optimisations is to change the preferred load address for DLLs used by a single process so there is no need to relocate the DLL.
The EDITBIN utility can do that from memory.
Regards,
hutch@movsd.com
Qweerdy & Vaxon, of course you are right. My mistake.