From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Modra To: Jason Merrill Cc: Benjamin Kosnik , binutils@sourceware.cygnus.com, libstdc++@sourceware.cygnus.com Subject: Re: Test case which displays problem found in libstdc++-v3 effort Date: Thu, 22 Jun 2000 18:12:00 -0000 Message-id: References: X-SW-Source: 2000-06/msg00468.html On 22 Jun 2000, Jason Merrill wrote: > >>>>> Alan Modra writes: > > > On 19 Jun 2000, Jason Merrill wrote: > >> >>>>> Alan Modra writes: > >> > >> > It's a linker script bug. The linker needs to be told to keep the > >> > .eh_frame contents. Lack of any reference to symbols defined in a > >> > section normally causes --gc-sections to discard the section. > >> > >> I would think that the reference to __EH_FRAME_BEGIN__ from > >> __do_global_ctors would satisfy the linker. Why doesn't it? > > > Because there doesn't seem to be any such reference. __main.o doesn't > > have much in it on i586-linux. > > What about crt{begin,end}.o? Yep, there's a reference to __EH_FRAME_BEGIN__ in crtbegin.o. Sooo, this makes it a linker bug after all, and my patch to the script is just papering over the problem. Hmm, looking at objdump output, we actually get a reference to the section symbol: 35: 68 00 00 00 00 push $0x0 36: R_386_32 .eh_frame 3a: e8 fc ff ff ff call 3b <__do_global_dtors_aux+0x3b> That ought to be enough to ensure the .eh_frame section gets kept, but I'm guessing that section symbols aren't looked at for some reason. I'll see if I can fix this later on today if I find some time. Here's a very simple set of test files if someone else wants to look at this problem cat > t1.s < t2.s <