Why won't the loader load at the desired locat

2019-03-05 15:56发布

问题:

It is said that sometimes the loader loads the exe at an address which is different than the one assumed by the linker. What all could be the cases when loader does so??

回答1:

Basically, this takes place in the following situations:

  1. The address at which the image prefers to be loaded is already occupied. For example, there may be another image already loaded there.
  2. The image to be loaded has been compiled with ASLR enabled.
  3. The FLG_LDR_TOP_DOWN global flag has been set, which forces modules to be loaded at the highest possible address.