This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
- From: David Mosberger <davidm at napali dot hpl dot hp dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: davidm at hpl dot hp dot com, "H . J . Lu" <hjl at lucon dot org>, Ulrich Drepper <drepper at redhat dot com>, GNU libc hacker <libc-hacker at sources dot redhat dot com>, binutils at sources dot redhat dot com
- Date: Fri, 1 Mar 2002 16:52:55 -0800
- Subject: Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
- References: <m3g03lfd1g.fsf@myware.mynet><20020228165851.A26168@lucon.org><15486.55079.333535.999190@napali.hpl.hp.com><20020228173311.A26728@lucon.org><15486.56491.696020.742674@napali.hpl.hp.com><20020228175426.A30756@redhat.com><15487.8879.719511.86715@napali.hpl.hp.com><20020228225757.A30933@redhat.com><15487.51034.573513.390031@napali.hpl.hp.com><20020301164725.C31581@redhat.com>
- Reply-to: davidm at hpl dot hp dot com
>>>>> On Fri, 1 Mar 2002 16:47:25 -0800, Richard Henderson <rth@redhat.com> said:
Richard> On Fri, Mar 01, 2002 at 10:24:26AM -0800, David Mosberger wrote:
>> OK, so how about this patch?
Richard> Looks close.
Great!
Richard> The only problem I see is with
>> + ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
>> + .preinit_array ${RELOCATING-0} : { *(.preinit_array) }
>> + ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
Richard> Suppose . is not as aligned as the contents of .preinit_array
Richard> etc? Then __preinit_array_start will have the wrong value.
Richard> I think you want
Richard> .preinit_array ${RELOCATING-0} : ${RELOCATING+ALIGN(${ALIGNMENT})} {
Richard> ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
Richard> *(.preinit_array)
Richard> ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
Richard> }
Richard> That will make sure you get 4 byte alignment for ELF32 and 8 byte
Richard> alignment for ELF64. And assuming that the sections are similarly
Richard> aligned, this should work fine.
Good point. The reason I moved the labels outside is because
otherwise the linker seems to insist on creating the sections, even if
they're empty. Is there another way to avoid this? If not, I suppose
we can live with that as it's more of a beauty blemish than a real
problem.
--david