This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: dwarf2 exception fix for djgpp (and possibly others)



  In message <19990222130638.B520@duna91.eth.ericsson.se>you write:
  > Hi,
  > 
  > The problem: dwarf2 exception handling was working very unreliably
  > under ix86-pc-msdosdjgpp since egcs v1.0. After some (lots of :-)
  > debugging I've found the problem.
  > 
  > It's caused by a strange interaction between egcs and gas. Djgpp uses
  > the COFF format, and gas from binutils 2.9.1 is compiled without
  > --enable-bfd-assembler. So, the problem is that the size of the CIE and
  > FDE structures in the dwarf2 output are always a multiple of 4, so
  > sometimes padding is needed. Egcs assumes that the padding bytes in
  > that section are always 0x00 (NOP) bytes. But unfortunately gas handles
  > this section ("eh_frame") as code (the section is not called "data" nor
  > "bss"), and uses other aligment bytes (like 0x90). Unfortunately these
  > bytes are valid byte codes in the dwarf2 byte code interpreter, and it
  > causes the exception stuff to abort.
  > 
  > A possible solution to this problem is to make sure that 0x00 bytes are
  > used in this section for padding. Below is a patch by me and Andris
  > Pavenis <pavenis@lanet.lv> (against egcs 1.1.1) 
This really sounds like a bug in the assembler to me.  We're probably better
off fixing the assembler than trying to work around the problem in the
compiler.

jeff


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