summaryrefslogtreecommitdiff
path: root/src/vm
diff options
context:
space:
mode:
authorMike Danes <onemihaid@hotmail.com>2015-12-05 12:24:32 +0200
committerMike Danes <onemihaid@hotmail.com>2015-12-06 18:06:15 +0200
commit03fe85991f055fcad160407e8f03f6aa54112740 (patch)
treec4f19e57e98962446e35647a358c254abb7ccceb /src/vm
parentc28fdd314ee4bdcaab02689cf47b0fb497b0bca2 (diff)
downloadcoreclr-03fe85991f055fcad160407e8f03f6aa54112740.tar.gz
coreclr-03fe85991f055fcad160407e8f03f6aa54112740.tar.bz2
coreclr-03fe85991f055fcad160407e8f03f6aa54112740.zip
Enable SAFESEH in the Windows x86 build
Diffstat (limited to 'src/vm')
-rw-r--r--src/vm/i386/asmhelpers.asm21
-rw-r--r--src/vm/wks/CMakeLists.txt2
2 files changed, 22 insertions, 1 deletions
diff --git a/src/vm/i386/asmhelpers.asm b/src/vm/i386/asmhelpers.asm
index 93d10cd92c..5e1c05919f 100644
--- a/src/vm/i386/asmhelpers.asm
+++ b/src/vm/i386/asmhelpers.asm
@@ -332,6 +332,27 @@ ___CxxFrameHandler3 ENDP
endif ; _DEBUG
endif ; FEATURE_CORECLR
+; Register CLR exception handlers defined on the C++ side with SAFESEH.
+; Note that these directives must be in a file that defines symbols that will be used during linking,
+; otherwise it's possible that the resulting .obj will completly be ignored by the linker and these
+; directives will have no effect.
+COMPlusFrameHandler proto c
+.safeseh COMPlusFrameHandler
+
+COMPlusNestedExceptionHandler proto c
+.safeseh COMPlusNestedExceptionHandler
+
+FastNExportExceptHandler proto c
+.safeseh FastNExportExceptHandler
+
+UMThunkPrestubHandler proto c
+.safeseh UMThunkPrestubHandler
+
+ifdef FEATURE_COMINTEROP
+COMPlusFrameHandlerRevCom proto c
+.safeseh COMPlusFrameHandlerRevCom
+endif
+
; Note that RtlUnwind trashes EBX, ESI and EDI, so this wrapper preserves them
CallRtlUnwind PROC stdcall public USES ebx esi edi, pEstablisherFrame :DWORD, callback :DWORD, pExceptionRecord :DWORD, retVal :DWORD
diff --git a/src/vm/wks/CMakeLists.txt b/src/vm/wks/CMakeLists.txt
index 06cf425dc6..1b232b7b19 100644
--- a/src/vm/wks/CMakeLists.txt
+++ b/src/vm/wks/CMakeLists.txt
@@ -36,7 +36,7 @@ foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES)
endforeach()
if (CLR_CMAKE_PLATFORM_ARCH_I386)
- set_source_files_properties(${VM_SOURCES_WKS_ARCH_ASM} PROPERTIES COMPILE_FLAGS "/Zm")
+ set_source_files_properties(${VM_SOURCES_WKS_ARCH_ASM} PROPERTIES COMPILE_FLAGS "/Zm /safeseh")
endif (CLR_CMAKE_PLATFORM_ARCH_I386)
# Convert AsmConstants.h into AsmConstants.inc