In MSVC, the Base Address Randomizaiton is a default option.(Since VS2005?)
So, I do not rebase manually the dll's base address anymore.
But I rebased my all dlls to improve loading performance when I use VS2003.
If I use ASLR option, the loading performance is always decreased?
(Of cource I can get other benefits)
The short answer is no.
On a system without ASLR (e.g. XP), loading a DLL at a non-preferred address has several costs:
Items 2 and 3 are by far the biggest costs, and are the main reason why manually rebasing DLLs used to be necessary.
With ASLR, fixups are applied transparently by the OS, making it look like the DLL was actually loaded at its preferred address. There are no copy-on-write faults, and no process-private pages are created. Also, fixups are applied only to the pages that are actually accessed by the app, rather than the entire image, which means no extra data is read from disk.
In addition to that, manual rebasing schemes can't prevent all base address conflicts (for example, DLLs from different vendors can conflict with each other, or an OS DLL could increase in size due to a hotfix and spill over into a range reserved for some other DLL, etc.). ASLR is a lot more efficient at dealing with these issues, so when looking at the system as a whole it can actually improve performance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With