Is the same DLL guaranteed to map to the same virtual address in every process using it?

I am researching internal Windows systems and the question is just a guess.

I find out that DLLs are a form of shared libraries, so at least a section of the code of the same DLL is shared with the processes using it. (By adding the same page records to the page table of these processes) A ​​section of code usually has something like jump tables that need to be moved (i.e., write the runtime virtual address to correct the pointer) before it is ready to be executed.

Suppose the same DLL is aa.dll

displayed in two different processes at different virtual addresses. (for example, a.exe

0x00400000 b.exe

0x00410000) The same pointer (s .text+0x100

) will be fixed to different addresses. (for example, a.exe

0x00400100 b.exe

0x004100100). Therefore, we have to make a copy of the code section and modify it to adapt one process. Then how to split the section of code?

I'm right?

+3


source to share





All Articles