On 5.03.2025 03:25, LIU Hao wrote:
Second, in the future, if `IMAGE_GUARD_PROTECT_DELAYLOAD_IAT` is specified in `GuardFlags` of the load config directory of an image, the delay-load IAT can also be made read-only, which may also require this change.
I think that when MSVC does this, it also places the delay-load IAT in a separate page to ensure that changing its protection doesn’t affect other data. Modifying the protection of a random page that happens to contain the delay-load IAT doesn’t seem correct.
Relying on __delayLoadHelper2 behavior specific to mingw-w64 comes with drawbacks. As I mentioned earlier, an application can forward the call to ResolveDelayLoadedAPI, which will bypass this change and fail to work, while it previously worked with earlier binutils.
Overall, since we agree that the issue lies with binutils, I believe it should be fixed there rather than working around it in mingw-w64-crt.
Thanks, Jacek _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public