[Dwarf-Discuss] doubt parsing CIE in eh_frame

David Anderson davea42 at linuxmail.org
Tue May 24 08:45:13 PDT 2016


On 05/24/2016 12:46 AM, Francesco Zappa Nardelli wrote:
>> If you could produce a small object file..
>
> Invoking readelf on /lib/x86_64-linux-gnu/libc.so.6 is enough to
> observe this (I am on Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-68-generic
> x86_64)):
>
> $ readelf -wf /lib/x86_64-linux-gnu/libc.so.6 (and search for S in the
> augmentation string)
>
> 00002690 0000000000000014 00000000 CIE
>   Version:               1
>   Augmentation:          "zRS"
>   Code alignment factor: 1
>   Data alignment factor: -8
>   Return address column: 16
>   Augmentation data:     1b
>
>   DW_CFA_nop
>   DW_CFA_nop
>   DW_CFA_nop
>   DW_CFA_nop
>   DW_CFA_nop
>   DW_CFA_nop
>
> while readelf -wF gives:
>
> 00002690 0000000000000014 00000000 CIE "zRS" cf=1 df=-8 ra=16
>    LOC           CFA
> 0000000000000000 rax+0

rax is the x86_64 64bit reg . As a 32bit x86 reg it is named eax.

IMO this is an accidental side effect of the way dwarf.c is implemented
in binutils.  If printing eh_frame it won't print the  CFA_nop but
finishes up
with a print of the resulting cfa reg which never got set so is zero.
Zero results in printing rax+0.

So I think this is just a simple bug in readelf.


David Anderson




More information about the Dwarf-Discuss mailing list