This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] bfd/elf-eh-frame.c: return address column of CIE


Hi Jakub,

> > > 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.
 
> 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.

So - for DWARF2 we read a ubyte and for DWARF3 we read a LEB128 ?

Since we are not currently supporting DWARF3 how about just adding a
note to remind us to fix this problem later on:

Cheers
        Nick

Index: bfd/elf-eh-frame.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-eh-frame.c,v
retrieving revision 1.13
diff -c -3 -p -w -r1.13 elf-eh-frame.c
*** bfd/elf-eh-frame.c	22 Aug 2002 20:00:14 -0000	1.13
--- bfd/elf-eh-frame.c	23 Aug 2002 06:40:59 -0000
*************** _bfd_elf_discard_section_eh_frame (abfd,
*** 506,511 ****
--- 506,513 ----
  	    }
  	  read_uleb128 (cie.code_align, buf);
  	  read_sleb128 (cie.data_align, buf);
+ 	  /* FIXME: In DWARF3 the return address is an ULEB128,
+ 	     in DWARF2 an unsigned byte.  */
  	  cie.ra_column = *buf++;
  	  ENSURE_NO_RELOCS (buf);
  	  cie.lsda_encoding = DW_EH_PE_omit;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]