The .eh_frame_hdr section contains additional information about the .eh_frame section. A pointer to the start of the .eh_frame data, and optionally, a binary search table of pointers to the .eh_frame records are found in this section.
Data in this section is encoded according to the DWARF Exception Header Encoding described below.
Table 6-1. .eh_frame_hdr Section Format
Encoding | Field |
---|---|
unsigned byte | version |
unsigned byte | eh_frame_ptr_enc |
unsigned byte | fde_count_enc |
unsigned byte | table_enc |
encoded | eh_frame_ptr |
encoded | fde_count |
binary search table |
Version of the .eh_frame_hdr format. This value must be 1.
The encoding format of the eh_frame_ptr field.
The encoding format of the fde_count field. A value of DW_EH_PE_omit indicates the binary search table is not present.
The encoding format of the entries in the binary search table. A value of DW_EH_PE_omit indicates the binary search table is not present.
The encoded value of the pointer to the start of the .eh_frame section.
The encoded value of the count of entries in the binary search table.
A binary search table containing fde_count entries. Each entry of the table consist of two encoded values, the initial location, and the address. The entries are sorted in an increasing order by the initial location value.
The DWARF Exception Header Encoding is used to describe the type of data used in the .eh_frame_hdr section. The upper 4 bits indicate how the value is to be applied. The lower 4 bits indicate the format of the data.
Table 6-2. DWARF Exception Header value format
Name | Value | Meaning |
---|---|---|
DW_EH_PE_omit | 0xff | No value is present. |
DW_EH_PE_uleb128 | 0x01 | Unsigned value is encoded using the Little Endian Base 128 (LEB128) as defined by DWARF Debugging Information Format, Revision 2.0.0 (July 27, 1993). |
DW_EH_PE_udata2 | 0x02 | A 2 bytes unsigned value. |
DW_EH_PE_udata4 | 0x03 | A 4 bytes unsigned value. |
DW_EH_PE_udata8 | 0x04 | An 8 bytes unsigned value. |
DW_EH_PE_sleb128 | 0x09 | Signed value is encoded using the Little Endian Base 128 (LEB128) as defined by DWARF Debugging Information Format, Revision 2.0.0 (July 27, 1993). |
DW_EH_PE_sdata2 | 0x0A | A 2 bytes signed value. |
DW_EH_PE_sdata4 | 0x0B | A 4 bytes signed value. |
DW_EH_PE_sdata8 | 0x0C | An 8 bytes signed value. |
Table 6-3. DWARF Exception Header application
Name | Value | Meaning |
---|---|---|
DW_EH_PE_absptr | 0x00 | Value is used with no modification. |
DW_EH_PE_pcrel | 0x10 | Value is reletive to the current program counter. |
DW_EH_PE_datarel | 0x30 | Value is reletive to the beginning of the .eh_frame_hdr section. |
DW_EH_PE_omit | 0xff | No value is present. |