This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [RFA] bfd/elf-eh-frame.c: return address column of CIE
- From: kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: binutils at sources dot redhat dot com
- Cc: jakub at redhat dot com, nickc at redhat dot com
- Date: Fri, 23 Aug 2002 07:18:33 +0900
- Subject: Re: [RFA] bfd/elf-eh-frame.c: return address column of CIE
- References: <20020822222858.N26639@sunsite.ms.mff.cuni.cz>
Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Aug 22, 2002 at 09:01:53PM +0100, Nick Clifton wrote:
>> Hi Kaz,
>>
>>> The DWARF 2 draft says that the return address register column of
>>> CIE of an eh_frame has the unsigned byte type. I've seen also that
>>> gcc puts it as an unsigned byte. So
>>> _bfd_elf_discard_section_eh_frame shouldn't use read_uleb128 when
>>> reading it.
>>
>> Thanks for spotting it.
>>
>>> 2002-08-18 Kaz Kojima <kkojima@rr.iij4u.or.jp>
>>>
>>> * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple
>>> byte read when reading the return address register column.
>>
>> Approved and applied.
>
> Unfortunately it is wrong, at least my Dwarf3-draft7-011029.pdf
> says:
>
> 7. return_address_register
>
> An unsigned LEB128 constant that indicates which column in the rule table represents the
> return address of the function. Note that this column might not correspond to an actual
> machine register.
>
> In DWARF V2, this field is a ubyte.
I'm just a little confused. It seems that GCC uses DWARF v2 not v3
format about this. gcc/dwarf2out.c (output_call_frame) outputs this
entry like as:
...
dw2_asm_output_data_sleb128 (DWARF_CIE_DATA_ALIGNMENT,
"CIE Data Alignment Factor");
dw2_asm_output_data (1, DWARF_FRAME_RETURN_COLUMN, "CIE RA Column");
...
but binutils uses DWARF v3. Does it mean that we should fix gcc?
kaz