[David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections

Richard Henderson rth@redhat.com
Fri Mar 1 16:47:00 GMT 2002


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~



More information about the Binutils mailing list