This is the mail archive of the binutils@sourceware.cygnus.com 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]

[patch] binary file endianness


Hi,

This patch fixes ppc_elf_merge_private_data so it
doesn't give an error if one of the files is a non-ELF one,
e.g. binary.
mcore, mips and sh have the same problem.

Regards,
-velco
2000-05-21  Momchil Velikov  <velco@fadata.bg>

	* elf32-ppc.c (ppc_elf_merge_private_bfd_data): Do not try to check the
	endianness of non-ELF (e.g. raw data) files.  

--- elf32-ppc.c.orig	Sun May 21 02:35:46 2000
+++ elf32-ppc.c	Sun May 21 02:36:07 2000
@@ -1398,6 +1398,10 @@
   flagword new_flags;
   boolean error;
 
+  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+    return true;
+
   /* Check if we have the same endianess */
   if (ibfd->xvec->byteorder != obfd->xvec->byteorder
       && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
@@ -1414,10 +1418,6 @@
       bfd_set_error (bfd_error_wrong_format);
       return false;
     }
-
-  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
-      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
-    return true;
 
   new_flags = elf_elfheader (ibfd)->e_flags;
   old_flags = elf_elfheader (obfd)->e_flags;

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