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


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