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: Richard Henderson <rth at redhat dot com>
- To: davidm at hpl dot hp dot com
- Cc: "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:47:25 -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>
On Fri, Mar 01, 2002 at 10:24:26AM -0800, David Mosberger wrote:
> OK, so how about this patch?
Looks close. 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 = .);}}
Suppose . is not as aligned as the contents of .preinit_array
etc? Then __preinit_array_start will have the wrong value.
I think you want
.preinit_array ${RELOCATING-0} : ${RELOCATING+ALIGN(${ALIGNMENT})} {
${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
*(.preinit_array)
${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
}
That will make sure you get 4 byte alignment for ELF32 and 8 byte
alignment for ELF64. And assuming that the sections are similarly
aligned, this should work fine.
r~