This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: binutils > 2.21.51.0.2 fails to build glibc


On Tue, Jan 11, 2011 at 3:48 PM, Alan Modra <amodra@gmail.com> wrote:
> 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.

Glibc has been fixed:

http://sourceware.org/git/?p=glibc.git;a=commit;h=4a531bb0b3b582cb693de9f76d2d97d970f9a5d5

> 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.
>

It is too fragile. I want to avoid it if possible.


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]