-fasynchronous-unwind-tables bug

Jakub Jelinek jakub@redhat.com
Thu Nov 21 09:38:00 GMT 2002


Hi!

-fasynchronous-unwind-tables causes improper .eh_frame section to be created
(and as a result .eh_frame_hdr doesn't contain lookup table on x86-64).
The problem is that the terminating 0 which is supposed to come from
crtend.o's
STATIC int __FRAME_END__[]
     __attribute__ ((unused, mode(SI), section(EH_FRAME_SECTION_NAME),
                     aligned(4)))
     = { 0 };
is actually not terminating, because crtend*.o has further .eh_frame bits
generated for __do_global_ctors_aux in crtend.o.
The solutions I can see for this are:
a) build crtend.o always with -fno-asynchronous-unwind-tables
   (ATM that FDE is never seen by frame unwinders anyway, since it is
   past the terminating 0).
b) write the terminating 0 in asm magic, which every
   -fasynchronous-unwind-tables defaulting target would have to write
   (using .subsection)
c) move __FRAME_END__ out of crtend*.o on -fasynchronous-unwind-tables
   defaulting targets into some special crtehframeend.o and add it
   to the link line after crtend*.o
What do you prefer?

	Jakub



More information about the Gcc mailing list