By default, or if the option
specified, the image can contain exception tables. Exception tables
are discarded silently if no code throws an exception. However,
if the option
--no_exceptions is specified, the
linker generates an error if any exceptions sections are present after
unused sections have been eliminated.
You can use the
--no_exceptions option to
ensure that your code is exceptions free. The linker generates an
error message to highlight that exceptions have been found and does
not produce a final image.
However, you can use the
--diag_warning option to downgrade the
error message to a warning. The linker produces a final image but
also generates a message to warn you that exceptions have been found.
The linker can create exception tables for legacy objects
that contain debug frame information. The linker can do this safely
for C and assembly language objects. By default, the linker does not
create exception tables. This is the same as using the linker option
The linker option
the linker to use the
to create a register-restoring unwinding table for each section
in your image that does not already have an exception table. If
this is not possible, the linker creates a nounwind table instead.
Use the linker option
create a nounwind table for each section in your image that does
not already have an exception table.
Be aware of the following:
With the default settings, that is,
--exceptions --exception_tables=nocreate, it is not safe to throw an exception through C or assembly code, unless the C code is compiled with the option
The linker can generate frame unwinding instructions from objects with
.debug_frameinformation. Frame unwinding is sufficient for C and assembler code. It is not sufficient for C++ code, because it does not call the destructors for the objects on the stack that is being unwound.
The cleanup code for C++ must be generated by the compiler with the