why do some Windows applications contain a relocat

2019-08-07 19:31发布

问题:

If my understanding of the Windows Portable Executable specification is correct, relocation tables are only needed when libraries cannot be loaded at their prefered addresses. Why do some applications (e.g. chrome.exe) contain a relocation table? Are applications not always loaded at their preferred addresses?

回答1:

It's for ASLR

AFAIK, current system loader don't relocate .exe files, maybe because it will increase loading time.
However, in next versions of OS, loader will relocate EXEs. (When hardware will be fast enough)