dwarf2 exception fix for djgpp (and possibly others)
Jeffrey A Law
law@hurl.cygnus.com
Thu Mar 11 00:16:00 GMT 1999
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
More information about the Gcc-patches
mailing list