[LLD] [MinGW] Implement the --no-seh flag
authorMartin Storsjö <martin@martin.st>
Mon, 27 Jul 2020 20:44:41 +0000 (23:44 +0300)
committerMartin Storsjö <martin@martin.st>
Tue, 28 Jul 2020 18:08:37 +0000 (21:08 +0300)
commit745eb02496b515cc8292dd7f9d7f0db43e162013
treeb11726d9b328d99a19bfb53281db0bb9ff791bce
parent5608f28f552793d115a7f8682559ab053f961924
[LLD] [MinGW] Implement the --no-seh flag

Previously this flag was just ignored. If set, set the
IMAGE_DLL_CHARACTERISTICS_NO_SEH bit, regardless of the normal safeSEH
machinery.

In mingw configurations, the safeSEH bit might not be set in e.g. object
files built from handwritten assembly, making it impossible to use the
normal safeseh flag. As mingw setups don't generally use SEH on 32 bit
x86 at all, it should be fine to set that flag bit though - hook up
the existing GNU ld flag for controlling that.

Differential Revision: https://reviews.llvm.org/D84701
lld/COFF/Config.h
lld/COFF/Driver.cpp
lld/COFF/Options.td
lld/COFF/Writer.cpp
lld/MinGW/Driver.cpp
lld/MinGW/Options.td
lld/test/COFF/noseh.s [new file with mode: 0644]
lld/test/MinGW/driver.test