I am trying to get /SafeSEH for a DLL I am building. The sources are all being compiled with Visual Studio 2008 SP1 with the same build options, except that one of the libraries being compiled has K&R-style C source in it. Those files are CompileAs 'C'.
Here is the problem. The link fails with: fatal error LNK1281: Unable to generate SAFESEH image.
Each of the objects that were compiled from K&R-style C shows the following error: error LNK2026: module unsafe for SAFESEH image.
The link options are:
/VERBOSE /INCREMENTAL:NO /NOLOGO /DLL /MANIFEST /DEF:"foo.def" /DEBUG /PDB:"foo.pdb" /MAP:"foo.map" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /DYNAMICBASE /NXCOMPAT /MACHINE:X86
None of the C files in question throw exceptions or do long jumps. One has embedded ASM - but it is not the only one that fails. None of the others have embedded ASM.
I am compiling for Release/x86_32.
One final note -- there is an absolute symbol in each of the failing objects called "@feat.00" with a value of 1. According to the Microsoft COFF spec this means they are "safe" for /SafeSEH linking.
Any clues?