4

In the PE header there's a flag to indicate whether the binary is LargeAddressAware or not.
The PE header itself exists for both, *.exe and *.dll.

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?

Also see related question: Drawbacks of using /LARGEADDRESSAWARE for 32 bit Windows executables?

4

1 回答 1

4

Windows 操作系统是否真的只为父可执行文件评估此标志?

是的。

所有 DLL 模块都完全忽略它吗?

是的。

那么,如果没有人评估它,我为什么要为 DLL 启用 LAA 链接器标志呢?

你不应该。这样做是没有意义的。

我想到了以下几点:如果启用 LAA 的 exe 加载未编译为 LAA 的模块,是否有办法强制 Windows 发出警告?

不,那里没有。


问题是堆是进程范围的。它由所有模块共享。你不能让一些人使用 LAA 堆,而另一些人则不能。所以只有可执行文件才有机会做出这个决定。该标志采用 DLL 和 EXE 通用的 PE 文件格式。但它只对 EXE 有意义。

于 2014-04-12T21:57:20.553 回答