在 PE header 中有一个标志指示二进制文件是否为 LargeAddressAware。
PE header 本身存在于 *.exe 和 *.dll 中。
Windows 操作系统真的只为父可执行文件评估此标志吗?
是否对所有 DLL 模块完全忽略?
那么,如果没有人评估它,我为什么要为 DLL 启用 LAA 链接器标志?
我的想法是:
如果启用 LAA 的 exe 加载未编译为 LAA 的模块,是否有办法强制 Windows 发出警告?
另见相关问题:Drawbacks of using /LARGEADDRESSAWARE for 32 bit Windows executables?
最佳答案
Is it really the case that Windows OS evaluates this flag for the parent executable, only?
是的。
Is it completely ignored for all DLL modules?
是的。
So why should i enable the LAA linker flag for DLLs if nobody is evaluating it?
你不应该。这样做毫无意义。
I was having the following in mind: Is there a way to force Windows issue a warning in case a LAA enabled exe loads a module that is not compiled as being LAA?
不,没有。
问题是堆是进程范围的。它由所有模块共享。您不能让一些使用 LAA 堆而另一些不使用。所以只有可执行文件才有机会做出这个决定。该标志采用 DLL 和 EXE 通用的 PE 文件格式。但它只对 EXE 有意义。
关于windows - PE header 和 LARGEADDRESSAWARE 未针对 DLL 模块进行评估?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23034803/