FDEs in .eh_frame section

Martin Kirchengast martin_kir_@hotmail.com
Thu Sep 16 17:14:00 GMT 2010


Hi,

what is the data format of "initial_location" and "address_range" in the .eh_frame section of an ELF64 binary? I read the DWARF specification which says:

"initial_location (target address): An addressing-unit sized constant indicating the address of the first location associated with this table entry."

and

"address_range (target address): An addressing unit sized constant indicating the number of bytes of program instructions described by this entry."

Because I'm building for x86-64 I thought that must be 64 bit, but that seems to be wrong. So I examined the binary with readelf and objdump:

____________________________________________________________________
READELF:

Contents of the .eh_frame section:

00000000 0000001c 00000000 CIE
  Version:               1
  Augmentation:          "zPR"
  Code alignment factor: 1
  Data alignment factor: -8
  Return address column: 16
  Augmentation data:     00 54 23 00 00 00 00 00 00 1b

  DW_CFA_def_cfa: r7 (rsp) ofs 8
  DW_CFA_offset: r16 (rip) at cfa-8

00000020 0000001c 00000024 FDE cie=00000000 pc=000000ec..000000f6
  DW_CFA_advance_loc: 1 to 000000ed
  DW_CFA_def_cfa_offset: 16
  DW_CFA_advance_loc: 3 to 000000f0
  DW_CFA_offset: r6 (rbp) at cfa-16
  DW_CFA_def_cfa_register: r6 (rbp)
  DW_CFA_advance_loc: 5 to 000000f5
  DW_CFA_def_cfa: r7 (rsp) ofs 8
  DW_CFA_nop
  DW_CFA_nop
  DW_CFA_nop

____________________________________________________________________
OBJDUMP:

Contents of section .eh_frame:
 3b78 1c000000 00000000 017a5052 00017810  .........zPR..x.
 3b88 0a005423 00000000 00001b0c 07089001  ..T#............
 3b98 1c000000 24000000 4cc5ffff 0a000000  ....$...L.......
 3ba8 00410e10 4386020d 06450c07 08000000  .A..C....E......

According to the above output of readelf the value of address_range should be 0xf6 - 0xec = 0xa. This value is at address 0x3ba4 and seems to be 32 bit wide. initial_location hast to be at address 0x3ba0, is 32 bit wide too and has a quite weird value. So please tell what am I doing wrong here?

Martin

 		 	   		  



More information about the Gcc-help mailing list