From 23719f397d0b91d40410206aee6ef8c716a48397 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 18 Jan 2001 00:17:43 +0000 Subject: Stop objcopy trying to convert endianness. --- binutils/ChangeLog | 7 +++++++ binutils/objcopy.c | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'binutils') diff --git a/binutils/ChangeLog b/binutils/ChangeLog index fe1cdd3..f86805f 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,10 @@ +2001-01-17 Nick Clifton + + * objcopy.c (copy_object): Fail if attempting to convert the + endianness of the input object file. + + * binutils.texi: Explain that objcopy cannot convert endianness. + 2001-01-16 Nick Clifton * readelf.c (string_table_length): New variable. diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 21f5793..cae66fc 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -1,5 +1,5 @@ /* objcopy.c -- copy object file from input to output, optionally massaging it. - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -765,6 +765,13 @@ copy_object (ibfd, obfd) long symsize; PTR dhandle; + 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; + } if (!bfd_set_format (obfd, bfd_get_format (ibfd))) RETURN_NONFATAL (bfd_get_filename (obfd)); -- cgit v1.1