]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2015-09-07 Andrew Pinski <apinski@cavium.com>
authorAndrew Pinski <apinski@cavium.com>
Mon, 7 Sep 2015 09:06:18 +0000 (17:06 +0800)
committerAndrew Pinski <apinski@cavium.com>
Mon, 7 Sep 2015 09:06:18 +0000 (17:06 +0800)
* cpu-aarch64.c (compatible):
Don't reject different mach or ILP32 here.
* elfnn-aarch64.c (elfNN_aarch64_merge_private_bfd_data):
Add an error message on why endianess is rejected.
Reject different ILP32/LP64 settings.

bfd/ChangeLog
bfd/cpu-aarch64.c
bfd/elfnn-aarch64.c

index d51800e855df390a2ef18a680222b4a26f8c546c..108e4bdeff5af81b7ef25865d3ae722b7c650989 100644 (file)
@@ -1,3 +1,11 @@
+2015-09-07  Andrew Pinski  <apinski@cavium.com>
+
+       * cpu-aarch64.c (compatible):
+       Don't reject different mach or ILP32 here.
+       * elfnn-aarch64.c (elfNN_aarch64_merge_private_bfd_data):
+       Add an error message on why endianess is rejected.
+       Reject different ILP32/LP64 settings.
+
 2015-09-03  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Remove
index 7d767f0805db4aaa1b4cf3099a6cbcf4be7b59ae..0b2e303517cfb29dd041895b7b3e69da1eae0d9b 100644 (file)
@@ -34,31 +34,9 @@ compatible (const bfd_arch_info_type * a, const bfd_arch_info_type * b)
   if (a->arch != b->arch)
     return NULL;
 
-  /* If a & b are for the same machine then all is well.  */
-  if (a->mach == b->mach)
-    return a;
-
-  /* Don't allow mixing ilp32 with lp64.  */
-  if ((a->mach & bfd_mach_aarch64_ilp32) != (b->mach & bfd_mach_aarch64_ilp32))
-    return NULL;
-
-  /* Otherwise if either a or b is the 'default' machine
-     then it can be polymorphed into the other.  */
-  if (a->the_default)
-    return b;
-
-  if (b->the_default)
-    return a;
-
-  /* So far all newer cores are
-     supersets of previous cores.  */
-  if (a->mach < b->mach)
-    return b;
-  else if (a->mach > b->mach)
-    return a;
-
-  /* Never reached!  */
-  return NULL;
+  /* Machine compatibility is checked in
+     elfNN_aarch64_merge_private_bfd_data.  */
+  return a;
 }
 
 static struct
index 3c4392477c3506eb272992e1a012cd9d43ee6435..3c072b0913bdb3c62f86f3cf773c0e1a6477e07a 100644 (file)
@@ -6141,11 +6141,26 @@ elfNN_aarch64_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
 
   /* Check if we have the same endianess.  */
   if (!_bfd_generic_verify_endian_match (ibfd, obfd))
-    return FALSE;
+    {
+      (*_bfd_error_handler)
+       (_("%B: endianness incompatible with that of the selected emulation"),
+        ibfd);
+      return FALSE;
+    }
 
   if (!is_aarch64_elf (ibfd) || !is_aarch64_elf (obfd))
     return TRUE;
 
+  /* Don't allow mixing ilp32 with lp64.  */
+  if ((bfd_get_arch_info (ibfd)->mach & bfd_mach_aarch64_ilp32)
+      != (bfd_get_arch_info (obfd)->mach & bfd_mach_aarch64_ilp32))
+    {
+      (*_bfd_error_handler)
+       (_("%B: ABI is incompatible with that of the selected emulation: \"%s\" != \"%s\""),
+        ibfd, bfd_get_target (ibfd), bfd_get_target (obfd));
+      return FALSE;
+    }
+
   /* The input BFD must have had its flags initialised.  */
   /* The following seems bogus to me -- The flags are initialized in
      the assembler but I don't think an elf_flags_init field is