Replace assert (about endianism) with an error message
authorNick Clifton <nickc@redhat.com>
Fri, 7 May 1999 07:44:11 +0000 (07:44 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 7 May 1999 07:44:11 +0000 (07:44 +0000)
bfd/ChangeLog
bfd/coff-mcore.c

index 9784c1fb50513ea8c4f8e2e0cb2de906107975d1..891b6b9051dcb53f98ba4d1285645cf9014dc771 100644 (file)
@@ -1,3 +1,8 @@
+1999-05-07  Nick Clifton  <nickc@cygnus.com>
+
+       * coff-mcore.c (coff_mcore_relocate_section): Replace assert about
+       endianism with an error message.
+
 Thu May  6 17:09:09 1999  Fred Fish  <fnf@be.com>
 
        * dwarf2.c (read_abbrevs): Change cast of dwarf_abbrev_buffer
index d787096e379bf029f1e5ae017f06da2da27e1b0a..0180517eeab3dd2b229299672c2841b077ec4f90 100644 (file)
@@ -357,8 +357,19 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
   if (info->relocateable)
     return true;
   
-  BFD_ASSERT (input_bfd->xvec->byteorder
-             == output_bfd->xvec->byteorder);
+  /* Check if we have the same endianess */
+  if (   input_bfd->xvec->byteorder != output_bfd->xvec->byteorder
+      && output_bfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
+    {
+      (*_bfd_error_handler)
+       (_("%s: compiled for a %s endian system and target is %s endian.\n"),
+        bfd_get_filename (input_bfd),
+         bfd_big_endian (input_bfd) ? "big" : "little",
+         bfd_big_endian (output_bfd) ? "big" : "little");
+
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+    }
 
   hihalf = false;
   hihalf_val = 0;
This page took 0.029413 seconds and 4 git commands to generate.