Skip to content

Commit ff88e27

Browse files
committed
Mark assembly files as SafeSEH compatible
These assembly files contain no exception handlers, so we can just emit the special @feat.00 symbol to indicate that they're trivially SafeSEH compatible. See [1] for details. [1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms680547(v=vs.85).aspx#the_.sxdata_section_
1 parent e80d3b2 commit ff88e27

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

CoreFoundation/Base.subproj/CFAsmMacros.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,16 @@
2020
#define NO_EXEC_STACK_DIRECTIVE
2121
#endif
2222

23+
.macro SAFESEH_REGISTRATION_DIRECTIVE
24+
#if defined(_WIN32) && defined(_M_IX86)
25+
.def @feat.00
26+
.scl 3
27+
.type 0
28+
.endef
29+
.globl @feat.00
30+
@feat.00 = 1
31+
#endif
32+
.endm
33+
2334
#endif
2435

CoreFoundation/String.subproj/CFCharacterSetData.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ _C_LABEL(__CFCharacterSetBitmapDataSize):
2222
.int _C_LABEL(__CFCharacterSetBitmapDataEnd) - _C_LABEL(__CFCharacterSetBitmapData)
2323

2424
NO_EXEC_STACK_DIRECTIVE
25-
25+
SAFESEH_REGISTRATION_DIRECTIVE

CoreFoundation/String.subproj/CFUniCharPropertyDatabase.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ _C_LABEL(__CFUniCharPropertyDatabaseSize):
2222
.int _C_LABEL(__CFUniCharPropertyDatabaseEnd) - _C_LABEL(__CFUniCharPropertyDatabase)
2323

2424
NO_EXEC_STACK_DIRECTIVE
25-
25+
SAFESEH_REGISTRATION_DIRECTIVE

CoreFoundation/String.subproj/CFUnicodeData.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ _C_LABEL(__CFUnicodeDataLSize):
3636
#endif
3737

3838
NO_EXEC_STACK_DIRECTIVE
39-
39+
SAFESEH_REGISTRATION_DIRECTIVE

0 commit comments

Comments
 (0)