This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: binutils > 2.21.51.0.2 fails to build glibc
- From: Alan Modra <amodra at gmail dot com>
- To: Octoploid <cryptooctoploid at gmail dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, binutils at sourceware dot org
- Date: Wed, 12 Jan 2011 10:18:55 +1030
- Subject: Re: binutils > 2.21.51.0.2 fails to build glibc
- References: <AANLkTi==jMF+p7jz5aggY=8yG6bZp4SftPfro1hG72U4@mail.gmail.com>
On Sun, Jan 09, 2011 at 12:37:15PM +0100, Octoploid wrote:
> Any binutils version > 2.21.51.0.2 fails to build glibc (2.12.2) on
> Linux x86_64:
I just ran into this myself on x86. I think glibc probably fails to
build on any architecture. The patch that introduced the problem is
http://sourceware.org/ml/binutils/2010-12/msg00466.html
HJ, please look at fixing this. A new binutils ought to be able to
build the most recently released glibc. Actually, I guess this is not
just glibc that is broken but any binary using .ctors/.dtors that
happens to use non-standard startup file names.
A good fix might be to add EXCLUDE_INIT_SENTINEL, so that
.init_array :
{
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
KEEP (*(.init_array))
KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
}
becomes
.init_array :
{
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
KEEP (*(.init_array))
KEEP (*(EXCLUDE_INIT_SENTINEL(.ctors)))
}
with EXCLUDE_INIT_SENTINEL looking at .ctors section contents and
not match any section containing a single 0 or -1.
A quick and dirty workaroundk for glibc would be to add *soinit.os and
*sofini.os to the list in EXCLUDE_FILE.
--
Alan Modra
Australia Development Lab, IBM