[Dwarf-Discuss] _starting address_ in eh_frame FDE encoding

Cary Coutant ccoutant@gmail.com
Thu Mar 24 14:47:04 GMT 2016


> I have a question about the FDE encoding in eh_frame (and not dwarf_frame)
> tables.
>
> This document (I could not find a better description of eh_frame)
>
>   http://www.airs.com/blog/archives/460

The official description of the .eh_frame section, with a description
of the augmentation string and what the various DW_EH_PE values mean,
can be found in the relevant psABI document for your architecture.

> states that:
>
>   "An FDE starts with the length and ID described above, and then continues
> as follows.   1 The _starting address_ to which this FDE applies. This is
> encoded using the FDE encoding specified by the associated CIE.?
>
> In a sample elf file, the associated CIE augmentation data state reports:
>
>    DW_EH_PE_pcrel, DW_EH_PE_sdata4
>
> and the untranslated starting address value in the FDE is fffffe88
> (according to readelf this should be translated to 4004d0).  I do not
> understand what ?value is PC relative? means here, as we are actually
> defining the range of PC values.
>
> Can somebody explain me how to interpret this _starting address_ field?

PC-relative simply means that the value is not an absolute address,
but rather an offset relative to itself (i.e., the address of the
field that contains the value. The value you read there was
0xfffffe88, which, according to the augmentation string, is a signed
4-byte value, or -0x178. If you add that to the address of the
starting address field itself, you'll get the actual starting address,
which readelf has computed as 0x4004d0. Working backwards, that
implies that your FDE started at 400640, with the starting address
field at 0x400648.

-cary



More information about the Dwarf-discuss mailing list