From cb69142fe06303f058f854170c6cd3fad4649c6f Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Sat, 25 Mar 2006 10:24:27 +0000 Subject: bfd/ * cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as incompatible. Likewise MAC and EMAC code. * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use bfd_get_compatible to set the new bfd architecture. Rely on it to detect incompatibilities. gas/ * config/tc-m68k.c (m68k_cpus): Change cpu_cf5208 entries to use mcfemac instead of mcfmac. ld/testsuite/ * ld-m68k/merge-error-1a.s, ld-m68k/merge-error-1b.s, * ld-m68k/merge-error-1a.d, ld-m68k/merge-error-1b.d, * ld-m68k/merge-error-1c.d, ld-m68k/merge-error-1d.d, * ld-m68k/merge-error-1e.d, ld-m68k/merge-ok-1a.d, * ld-m68k/merge-ok-1b.d: New tests. * ld-m68k/m68k.exp: Run them. --- bfd/cpu-m68k.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bfd/cpu-m68k.c') diff --git a/bfd/cpu-m68k.c b/bfd/cpu-m68k.c index 83aaa254c1..366278960a 100644 --- a/bfd/cpu-m68k.c +++ b/bfd/cpu-m68k.c @@ -208,9 +208,16 @@ bfd_m68k_compatible (const bfd_arch_info_type *a, /* Merge cf machine. */ unsigned features = (bfd_m68k_mach_to_features (a->mach) | bfd_m68k_mach_to_features (b->mach)); - unsigned machine = bfd_m68k_features_to_mach (features); - return bfd_lookup_arch (a->arch, machine); + /* ISA A+ and ISA B are incompatible. */ + if ((~features & (mcfisa_aa | mcfisa_b)) == 0) + return NULL; + + /* MAC and EMAC code cannot be merged. */ + if ((~features & (mcfmac | mcfemac)) == 0) + return NULL; + + return bfd_lookup_arch (a->arch, bfd_m68k_features_to_mach (features)); } else /* They are incompatible. */ -- cgit v1.2.1