| |||
| Home > System V Shared Libraries > Using SVr4 shared libraries > Exception tables | |||
In a static image that does not use shared libraries, the linker automatically discards exception tables if it decides that the image cannot throw an exception.
When linking an image that uses shared objects, use the --force_so_throw command-line
option to specify that all shared objects might throw exceptions
and so force the linker to keep the exception tables, regardless
of whether the image can throw an exception or not.
If you are building an SVr4 formatted ELF executable file,
use the --pt_arm_exidx command-line option to add
a program header of type PT_ARM_EXIDX to an image
or shared object that has exception tables and dynamic content.
This describes the location of the unwind tables for the image.
It contains fields that describe the file offset, virtual address,
and size of the table to the program loader.
The linker infers that a shared object might throw an exception
if it has a PT_ARM_EXIDX program header. It must,
therefore, keep the exception tables, regardless of whether an exception
can be thrown or not.
The default is --no_pt_arm_exidx.