[PATCH] D41252: [COFF] Set the IMAGE_DLL_CHARACTERISTICS_NO_SEH flag automatically

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 15 11:25:41 PST 2017


rnk added a comment.

In https://reviews.llvm.org/D41252#955769, @mstorsjo wrote:

> In https://reviews.llvm.org/D41252#955735, @rnk wrote:
>
> > Does link.exe set this flag if there are no handlers in .sxdata? This flag seems like it was added as a way to mark DLLs that don't have _load_config_used as not having any exception handlers for /safeseh. Maybe we should just set this flag implicitly if there were no handlers in .sxdata and _load_config_used never resolved.
>
>
> So I guess this would make sense and match link.exe. Do you happen to know how this relates to SEH based exception handling in (GCC based) MinGW btw? When I build an executable (or DLL) with mingw-gcc that has SEH exceptions, llvm-readobj -coff-load-config doesn't show anything at all for such a binary. So if we were to link such binaries with LLD (which I don't do yet because libcxxabi lacks support for SEH), wouldn't we end up setting this flag for them as well?


I suspect that this flag is only meaningful for x86 images, and we should only ever set it for x86 images that have no exception handlers and no load config. GCC's SEH support is x64-only, so this should never interfere with that.


https://reviews.llvm.org/D41252





More information about the llvm-commits mailing list