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: differences in generated ldscripts for native and cross builds


On Sun, Oct 11, 2015 at 11:56 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On 09 Oct 2015 22:45, Alan Modra wrote:
>> On Fri, Oct 09, 2015 at 08:43:22AM +0200, Matthias Klose wrote:
>> > --- debian/tmp/usr/lib/ldscripts/aarch64elf.x
>> > +++ debian/binutils-aarch64-linux-gnu/usr/lib/ldscripts/aarch64elf.x
>> > @@ -93,15 +93,15 @@
>> >    .init_array     :
>> >    {
>> >      PROVIDE_HIDDEN (__init_array_start = .);
>> > -    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
>> > -    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o
>> > *crtend?.o ) .ctors))
>> > +    KEEP (*(SORT(.init_array.*)))
>> > +    KEEP (*(.init_array ))
>> >      PROVIDE_HIDDEN (__init_array_end = .);
>> >    }
>> >    .fini_array     :
>> >    {
>> >      PROVIDE_HIDDEN (__fini_array_start = .);
>> > -    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
>> > -    KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o
>> > *crtend?.o ) .dtors))
>> > +    KEEP (*(SORT(.fini_array.*)))
>> > +    KEEP (*(.fini_array ))
>> >      PROVIDE_HIDDEN (__fini_array_end = .);
>> >    }
>> >    .ctors          :
>>
>> Try adding --enable-initfini-array to the cross configuration.  The
>> autoconf test for this option uses AC_RUN_IFELSE so only works on
>> native builds.
>
> can't we make this smarter ?  this feature has been around for quite
> a long time now.  seems crazy that the default is to disable these
> when cross-compiling.

Yes, the default should be ON for Linux targets.

-- 
H.J.


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