differences in generated ldscripts for native and cross builds

Alan Modra amodra@gmail.com
Fri Oct 9 12:16:00 GMT 2015


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.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list