+/* This routine is provided two arch_infos and returns the lowest common
+ denominator. CRIS v0..v10 vs. v32 are not compatible in general, but
+ there's a compatible subset for which we provide an arch_info. */
+
+static const bfd_arch_info_type * get_compatible
+ (const bfd_arch_info_type *, const bfd_arch_info_type *);
+
+static const bfd_arch_info_type *
+get_compatible (const bfd_arch_info_type *a,
+ const bfd_arch_info_type *b)
+{
+ /* Arches must match. */
+ if (a->arch != b->arch)
+ return NULL;
+
+ /* If either is the compatible mach, return the other. */
+ if (a->mach == bfd_mach_cris_v10_v32)
+ return b;
+ if (b->mach == bfd_mach_cris_v10_v32)
+ return a;
+
+#if 0
+ /* The code below is disabled but kept as a warning.
+ See ldlang.c:lang_check. Quite illogically, incompatible arches
+ (as signalled by this function) are only *warned* about, while with
+ this function signalling compatible ones, we can have the
+ cris_elf_merge_private_bfd_data function return an error. This is
+ undoubtedly a FIXME: in general. Also, the
+ command_line.warn_mismatch flag and the --no-warn-mismatch option
+ are misnamed for the multitude of ports that signal compatibility:
+ it is there an error, not a warning. We work around it by
+ pretending matching machs here. */
+
+ /* Except for the compatible mach, machs must match. */
+ if (a->mach != b->mach)
+ return NULL;
+#endif
+
+ return a;
+}
+
+#define N(NUMBER, PRINT, NEXT) \
+ { 32, 32, 8, bfd_arch_cris, NUMBER, "cris", PRINT, 1, FALSE, \
+ get_compatible, bfd_default_scan, bfd_arch_default_fill, NEXT }
+
+static const bfd_arch_info_type bfd_cris_arch_compat_v10_v32 =
+ N (bfd_mach_cris_v10_v32, "cris:common_v10_v32", NULL);
+
+static const bfd_arch_info_type bfd_cris_arch_v32 =
+ N (bfd_mach_cris_v32, "crisv32", &bfd_cris_arch_compat_v10_v32);
+
+const bfd_arch_info_type bfd_cris_arch =