Поделиться через


/SAFESEH - Image has Safe Exception Handlers (Windows Embedded CE 6.0)

1/5/2010

This linker option causes the linker only to produce an image if it can also produce a table of the image's safe exception handlers. This table specifies for the operating system which exception handlers are valid for the image.

The following line shows the syntax for the /SAFESEH linker option

/SAFESEH[:NO]

When /SAFESEH is specified, the linker will only produce /SAFESEH is only valid when linking for x86 targets. /SAFESEH is not supported for other platforms such as ARM, MIPS and SH because those platforms note the exception handlers in PDATA structures. See Exception Handling for Device Compilers for more information.

If /SAFESEH:NO is specified, the linker will not produce an image with a table of safe exceptions handlers even if all modules are compatible with the safe exception handling feature. The OS build system specifies SAFESEH=1 in SOURCES files by default. Set SAFESEH= to pass /SAFESEH:NO to the linker.

The most common reason for the linker not to be able to produce an image is because one or more of the input files or modules to the linker was not compatible with the safe exception handlers feature. A common reason for a module to not be compatible with safe exception handlers is because it was created with a compiler from a previous version of Visual C++.

You can also register a function as a structured exception handler by using the .SAFESEH directive. For more information, see the Microsoft Macro Assembler Reference on MSDN.

The linker's ability to build a table of safe exception handlers depends on the application using the C runtime library.

See Also

Concepts

Unique Build Options
Security Best Practices for C++