This is the mail archive of the gcc@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]
Other format: [Raw text]

-fasynchronous-unwind-tables bug


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


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