Developer Guide and Reference

Contents

Optimize Exception Handling Data
(Linux* and
macOS*
)

If a program requires support for exception handling, the compiler creates a special section containing DWARF directives that are used by the Linux*
and
macOS*
run-time to unwind and catch an exception.
This information is located in the .eh_frame section and may be shrunk using the compiler options listed below.
Options to specify:
Linux*
and
macOS*
:
-fno-exceptions
-fno-asynchronous-unwind-tables
Windows*:
None
Advantages of this method:
  • These options may shrink the size of the object or binary file by up to 15%, though the amount of the reduction depends on the target platform.
  • These options control whether unwind information is precise at an instruction boundary or at a call boundary. For example, option
    -fno-asynchronous-unwind-tables
    can be used for programs that may
    only
    throw or catch exceptions.
Disadvantages of this method:
Both options may change the program's behavior:
  • Do not use option
    -fno-exceptions
    for programs that require standard C++ handling for objects of classes with destructors.
  • Do not use option
    -fno-asynchronous-unwind-tables
    for functions compiled with option