diff options
author | Kazu Hirata <kazu@codesourcery.com> | 2007-01-08 18:42:37 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@codesourcery.com> | 2007-01-08 18:42:37 +0000 |
commit | 3bdcfdf41f04c851af504aa0b653e0c806a930f4 (patch) | |
tree | c3b84f2be979ef63edfcca340ffb50b340af54fa /bfd | |
parent | 00fa51f6801ada6b33763db75f5cdab6c74ea90b (diff) | |
download | gdb-3bdcfdf41f04c851af504aa0b653e0c806a930f4.zip gdb-3bdcfdf41f04c851af504aa0b653e0c806a930f4.tar.gz gdb-3bdcfdf41f04c851af504aa0b653e0c806a930f4.tar.bz2 |
bfd/
* archures.c (bfd_mach_cpu32_fido): Rename to bfd_mach_fido.
* bfd-in2.h: Regenerate.
* cpu-m68k.c (arch_info_struct): Use bfd_mach_fido instead of
bfd_mach_cpu32_fido.
(m68k_arch_features): Use fido_a instead of cpu32.
(bfd_m68k_compatible): Reject the combination of Fido and
ColdFire. Accept the combination of CPU32 and Fido with a
warning.
* elf32-m68k.c (elf32_m68k_object_p,
elf32_m68k_merge_private_bfd_data,
elf32_m68k_print_private_bfd_data): Treat Fido as an
architecture by itself.
binutils/
* readelf.c (get_machine_flags): Treat Fido as an architecture
by itself.
gas/
* config/tc-m68k.c (m68k_archs, m68k_cpus): Treat Fido as an
architecture by itself.
(m68k_ip): Don't issue a warning for tbl instructions on fido.
(m68k_elf_final_processing): Treat Fido as an architecture by
itself.
include/elf/
* m68k.h (EF_M68K_FIDO): New.
(EF_M68K_ARCH_MASK): OR EF_M68K_FIDO.
(EF_M68K_CPU32_FIDO_A, EF_M68K_CPU32_MASK): Remove.
include/opcode/
* m68k.h (m68010up): OR fido_a.
opcodes/
* m68k-opc.c (m68k_opcodes): Replace cpu32 with
cpu32 | fido_a except on tbl instructions.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 15 | ||||
-rw-r--r-- | bfd/archures.c | 2 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 2 | ||||
-rw-r--r-- | bfd/cpu-m68k.c | 24 | ||||
-rw-r--r-- | bfd/elf32-m68k.c | 29 |
5 files changed, 54 insertions, 18 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 402b0a3..6bbe72a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,18 @@ +2007-01-08 Kazu Hirata <kazu@codesourcery.com> + + * archures.c (bfd_mach_cpu32_fido): Rename to bfd_mach_fido. + * bfd-in2.h: Regenerate. + * cpu-m68k.c (arch_info_struct): Use bfd_mach_fido instead of + bfd_mach_cpu32_fido. + (m68k_arch_features): Use fido_a instead of cpu32. + (bfd_m68k_compatible): Reject the combination of Fido and + ColdFire. Accept the combination of CPU32 and Fido with a + warning. + * elf32-m68k.c (elf32_m68k_object_p, + elf32_m68k_merge_private_bfd_data, + elf32_m68k_print_private_bfd_data): Treat Fido as an + architecture by itself. + 2007-01-08 Kai Tietz <kai.tietz@onevision.com> * config.bfd: Renamed target x86_64-*-mingw64 to x86_64-*-mingw*. diff --git a/bfd/archures.c b/bfd/archures.c index 89a3805..a9fca3b 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -80,7 +80,7 @@ DESCRIPTION .#define bfd_mach_m68040 6 .#define bfd_mach_m68060 7 .#define bfd_mach_cpu32 8 -.#define bfd_mach_cpu32_fido 9 +.#define bfd_mach_fido 9 .#define bfd_mach_mcf_isa_a_nodiv 10 .#define bfd_mach_mcf_isa_a 11 .#define bfd_mach_mcf_isa_a_mac 12 diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index d82d468..da24ce5 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1715,7 +1715,7 @@ enum bfd_architecture #define bfd_mach_m68040 6 #define bfd_mach_m68060 7 #define bfd_mach_cpu32 8 -#define bfd_mach_cpu32_fido 9 +#define bfd_mach_fido 9 #define bfd_mach_mcf_isa_a_nodiv 10 #define bfd_mach_mcf_isa_a 11 #define bfd_mach_mcf_isa_a_mac 12 diff --git a/bfd/cpu-m68k.c b/bfd/cpu-m68k.c index ee45ffe..2e6f6c6 100644 --- a/bfd/cpu-m68k.c +++ b/bfd/cpu-m68k.c @@ -41,7 +41,7 @@ static const bfd_arch_info_type arch_info_struct[] = N(bfd_mach_m68040, "m68k:68040", FALSE, &arch_info_struct[6]), N(bfd_mach_m68060, "m68k:68060", FALSE, &arch_info_struct[7]), N(bfd_mach_cpu32, "m68k:cpu32", FALSE, &arch_info_struct[8]), - N(bfd_mach_cpu32_fido, "m68k:fido", FALSE, &arch_info_struct[9]), + N(bfd_mach_fido, "m68k:fido", FALSE, &arch_info_struct[9]), /* Various combinations of CF architecture features */ N(bfd_mach_mcf_isa_a_nodiv, "m68k:isa-a:nodiv", @@ -108,7 +108,7 @@ static const unsigned m68k_arch_features[] = m68040|m68881|m68851, m68060|m68881|m68851, cpu32|m68881, - cpu32|m68881|fido_a, + fido_a|m68881, mcfisa_a, mcfisa_a|mcfhwdiv, mcfisa_a|mcfhwdiv|mcfmac, @@ -214,6 +214,10 @@ bfd_m68k_compatible (const bfd_arch_info_type *a, if ((~features & (cpu32 | mcfisa_a)) == 0) return NULL; + /* Fido and Coldfire are incompatible. */ + if ((~features & (fido_a | mcfisa_a)) == 0) + return NULL; + /* ISA A+ and ISA B are incompatible. */ if ((~features & (mcfisa_aa | mcfisa_b)) == 0) return NULL; @@ -222,6 +226,22 @@ bfd_m68k_compatible (const bfd_arch_info_type *a, if ((~features & (mcfmac | mcfemac)) == 0) return NULL; + /* CPU32 is compatible with Fido except that Fido does not + support tbl instructions. Warn when the user wants to mix + the two. */ + if ((a->mach == bfd_mach_cpu32 && b->mach == bfd_mach_fido) + || (a->mach == bfd_mach_fido && b->mach == bfd_mach_cpu32)) + { + static int cpu32_fido_mix_warning; + if (!cpu32_fido_mix_warning) + { + cpu32_fido_mix_warning = 1; + (*_bfd_error_handler) ("warning: linking CPU32 objects with fido objects"); + } + return bfd_lookup_arch (a->arch, + bfd_m68k_features_to_mach (fido_a | m68881)); + } + return bfd_lookup_arch (a->arch, bfd_m68k_features_to_mach (features)); } else diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 1c04a69..ad7e56f 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -432,14 +432,9 @@ elf32_m68k_object_p (bfd *abfd) if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) features |= m68000; else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) - { - features |= cpu32; - switch (eflags & EF_M68K_CPU32_MASK) - { - case EF_M68K_CPU32_FIDO_A: - features |= fido_a; break; - } - } + features |= cpu32; + else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO) + features |= fido_a; else { switch (eflags & EF_M68K_CF_ISA_MASK) @@ -530,7 +525,9 @@ elf32_m68k_merge_private_bfd_data (ibfd, obfd) if ((in_flags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) variant_mask = 0; else if ((in_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) - variant_mask = EF_M68K_CPU32_MASK; + variant_mask = 0; + else if ((in_flags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO) + variant_mask = 0; else variant_mask = EF_M68K_CF_ISA_MASK; @@ -538,6 +535,12 @@ elf32_m68k_merge_private_bfd_data (ibfd, obfd) out_isa = (out_flags & variant_mask); if (in_isa > out_isa) out_flags ^= in_isa ^ out_isa; + if (((in_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32 + && (out_flags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO) + || ((in_flags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO + && (out_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32)) + out_flags = EF_M68K_FIDO; + else out_flags |= in_flags ^ in_isa; } elf_elfheader (obfd)->e_flags = out_flags; @@ -567,11 +570,9 @@ elf32_m68k_print_private_bfd_data (abfd, ptr) if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) fprintf (file, " [m68000]"); else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) - { - fprintf (file, " [cpu32]"); - if (eflags & EF_M68K_CPU32_FIDO_A) - fprintf (file, " [fido]"); - } + fprintf (file, " [cpu32]"); + else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO) + fprintf (file, " [fido]"); else { if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CFV4E) |