summaryrefslogtreecommitdiff
path: root/bfd/cpu-h8300.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/cpu-h8300.c')
-rw-r--r--bfd/cpu-h8300.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/bfd/cpu-h8300.c b/bfd/cpu-h8300.c
index 5907de02537..d726dc32bb9 100644
--- a/bfd/cpu-h8300.c
+++ b/bfd/cpu-h8300.c
@@ -96,8 +96,18 @@ h8300_scan (const struct bfd_arch_info *info, const char *string)
static const bfd_arch_info_type *
compatible (const bfd_arch_info_type *in, const bfd_arch_info_type *out)
{
+ if (in->arch != out->arch)
+ return 0;
+ if (in->mach == bfd_mach_h8300sx && out->mach == bfd_mach_h8300s)
+ return in;
+ if (in->mach == bfd_mach_h8300s && out->mach == bfd_mach_h8300sx)
+ return out;
+ if (in->mach == bfd_mach_h8300sxn && out->mach == bfd_mach_h8300sn)
+ return in;
+ if (in->mach == bfd_mach_h8300sn && out->mach == bfd_mach_h8300sxn)
+ return out;
/* It's really not a good idea to mix and match modes. */
- if (in->arch != out->arch || in->mach != out->mach)
+ if (in->mach != out->mach)
return 0;
else
return in;