Stop objcopy trying to convert endianness.

Hans-Peter Nilsson hans-peter.nilsson@axis.com
Thu Jan 18 01:08:00 GMT 2001


> Date: Wed, 17 Jan 2001 16:17:20 -0800
> From: Nick Clifton <nickc@redhat.com>

>   After handling another bug report from a customer who complained
>   that objcopy could not convert from little-endian to big-endian, I
>   have decided to check in this patch.  It makes objcopy produce a
>   fatal error if such an attempt is made (instead of seg faulting as
>   it currently does),

Thanks!

> +   if (ibfd->xvec->byteorder != obfd->xvec->byteorder
> +       && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
> +       && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
> +     {
> +       fatal (_("Unable to change endianness of input file(s)"));
> +       return;
> +     }

You might want to report the name of the ibfd file with the
mismatching endianness.  Useful in case it's not that way on
intent.

brgds, H-P


More information about the Binutils mailing list