[David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
David Mosberger
davidm@napali.hpl.hp.com
Fri Mar 1 16:56:00 GMT 2002
>>>>> 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
More information about the Binutils
mailing list