This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Properly align __*_array_start
On Mon, Dec 16, 2002 at 07:09:34PM +0100, Jakub Jelinek wrote:
> On Mon, Dec 16, 2002 at 10:04:33AM -0800, H. J. Lu wrote:
> > Hi Jakub,
> >
> > I don't believe
> >
> > http://sources.redhat.com/ml/libc-hacker/2002-12/msg00017.html
> >
> > is correct. The problem is we can have the .init_array section in a.o,
> > b.o, c.o, .... You only want to align the first .init_array section
> > the linker sees to the proper alignment according to the ABI since the
> > linker will concatenate all .init_array sections into one. We don't
> > want any gaps between them. The glibc problem is a linker bug. Please
> > try the patch enclosed here.
>
> The proper alignment of .init_array etc. is (IMHO) 8 on x86-64, not 16.
> The ABI creators (Jan, Andreas) can explain their intent, but I think
> .*_array are just special sections which contain function pointers,
> it is not a C array variable with 2 or more members.
> The alignment of 16 is a performance thing which makes no sense for
> .*_array which are not copied somewhere else, just run one function pointer
> following other one in crt*.
If it is the case, my ld patch is not needed. I still don't believe
http://sources.redhat.com/ml/libc-hacker/2002-12/msg00017.html
is necessary at all.
H.J.