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 6:30 PM, Alan Modra <amodra@gmail.com> wrote:
> On Tue, Jan 11, 2011 at 03:56:36PM -0800, H.J. Lu wrote:
>> 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
>
> You didn't read what I said.
>
>> > A good fix might be to add EXCLUDE_INIT_SENTINEL, so that
>>
>> It is too fragile. I want to avoid it if possible.
>
> Do you think it is OK for a new GNU ld to without warning build older
> versions of glibc that segfault at runtime?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Not exactly, it segfault at build-time.  If you want to use the latest
binutils to BUILD your glibc, I think it is OK to require you to patch
your glibc. I can provide a patch for glibc 2.12.

One problem is your suggestion is for .o files with RELA relocations
checking the content of .ctor section may not be enough.

> Do you intend to fix this problem, or do you think it would be better

I fixed the problem in glibc.  .ctor isn't standard. All ELF C run-time
libraries should switch to .init_array anyway.

> to revert the .ctor in .init_array support?
>

I don't think it should be reverted since that was added to provide
maximum binary compatibility when gcc is switched to .init_array.
Between the choice of unpatched glibc segfault at build-time and
stuck to .ctor forever, I choose latter.

-- 
H.J.


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