.NET assemblies and DLL rebasing

后端 未结 2 767
日久生厌
日久生厌 2020-12-16 00:57

According to this article rebasing is not necessary for .NET assemblies due to JIT compilation of the code. The article states:

\"JIT-compiled code does not hav

相关标签:
2条回答
  • 2020-12-16 01:50

    What OS are you running? I know that the vista and beyond introduced ASLR which randomizes the address space it loads dlls into. This happens for system dlls but not sure about .net - maybe something to look into.

    0 讨论(0)
  • 2020-12-16 01:53

    CLR Loading mechanism uses LoadLibrary behind the scenes, so this is what you observe: 2 assemblies can't be loaded at the same address. Now what people often mean when they try to rebase a dll is to avoid the perf. hit of fix-ups, e.g. absolute addresses & function calls need to be "relocated" with the loaded base-address. CLR does not have this problem (not sure about static data in the application, which is the second part of those fix-ups, I would need to read up on this), because MSIL code is loaded on-demand when you call a function in the managed code. The MSIL then gets jitted and placed on the heap, a different one from normal object heap I believe, in the same manner CLR allocates and lays out new objects in your application.

    0 讨论(0)
提交回复
热议问题