[PATCH] D41252: [MinGW] Implement the --no-seh flag

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 14 12:19:44 PST 2017


rnk added a comment.

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

> In https://reviews.llvm.org/D41252#955735, @rnk wrote:
>
> > Does link.exe set this flag if there are no handlers in .sxdata?
>
>
> It doesn't seem so - a plain C hello world exe won't have it set.


Well, it will link the CRT, which has _except_handler4. You would need to make a no CRT test case and check that. It's probably simplest with a DLL with a custom entry point. You can also use llvm-readobj -coff-load-config to see that it doesn't have a load config directory.

>>   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.
> 
> If we choose to do that, we'd need to make this a no-op flag in the mingw driver instead - I've just run across some code that seems to set this flag (for unknown reasons).

Makes sense.


https://reviews.llvm.org/D41252





More information about the llvm-commits mailing list