aboutsummaryrefslogtreecommitdiff
path: root/bfd/cpu-m68k.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2006-03-25 10:24:27 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2006-03-25 10:24:27 +0000
commita9d34880555ed60254118c80850a4e4a6f62104f (patch)
tree8fa27b6361338acecf73f7ac755f853eabbca73f /bfd/cpu-m68k.c
parent9332ab0250fa03f913b7253659266b2afb6d2501 (diff)
downloadgdb-a9d34880555ed60254118c80850a4e4a6f62104f.zip
gdb-a9d34880555ed60254118c80850a4e4a6f62104f.tar.gz
gdb-a9d34880555ed60254118c80850a4e4a6f62104f.tar.bz2
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.
Diffstat (limited to 'bfd/cpu-m68k.c')
-rw-r--r--bfd/cpu-m68k.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/bfd/cpu-m68k.c b/bfd/cpu-m68k.c
index 83aaa25..3662789 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. */