aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog13
-rw-r--r--bfd/archures.c3
-rw-r--r--bfd/bfd-in2.h3
-rw-r--r--bfd/cpu-m68k.c31
-rw-r--r--bfd/elf32-m68k.c42
5 files changed, 83 insertions, 9 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ad991c8..5758423 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,16 @@
+2007-04-23 Nathan Sidwell <nathan@codesourcery.com>
+
+ * archures.c (bfd_mach_mcf_isa_c, bfd_mach_mcf_isa_c_mac,
+ bfd_mach_mcf_isa_c_emac): New.
+ * elf32-m68k.c (ISAC_PLT_ENTRY_SIZE, elf_isac_plt0_entry,
+ elf_isac_plt_entry, elf_isac_plt_info): New.
+ (elf32_m68k_object_p): Add ISA_C.
+ (elf32_m68k_print_private_bfd_data): Print ISA_C.
+ (elf32_m68k_get_plt_info): Detect ISA_C.
+ * cpu-m68k.c (arch_info): Add ISAC.
+ (m68k_arch_features): Likewise,
+ (bfd_m68k_compatible): ISAs B & C are not compatible.
+
2007-04-21 Nick Clifton <nickc@redhat.com>
* ecoff.c (_bfd_ecoff_write_armap): Initialise rehash.
diff --git a/bfd/archures.c b/bfd/archures.c
index f43e2e6..3002043 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -97,6 +97,9 @@ DESCRIPTION
.#define bfd_mach_mcf_isa_b_float 23
.#define bfd_mach_mcf_isa_b_float_mac 24
.#define bfd_mach_mcf_isa_b_float_emac 25
+.#define bfd_mach_mcf_isa_c 26
+.#define bfd_mach_mcf_isa_c_mac 27
+.#define bfd_mach_mcf_isa_c_emac 28
. bfd_arch_vax, {* DEC Vax *}
. bfd_arch_i960, {* Intel 960 *}
. {* The order of the following is important.
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index d34456a..8154435 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1761,6 +1761,9 @@ enum bfd_architecture
#define bfd_mach_mcf_isa_b_float 23
#define bfd_mach_mcf_isa_b_float_mac 24
#define bfd_mach_mcf_isa_b_float_emac 25
+#define bfd_mach_mcf_isa_c 26
+#define bfd_mach_mcf_isa_c_mac 27
+#define bfd_mach_mcf_isa_c_emac 28
bfd_arch_vax, /* DEC Vax */
bfd_arch_i960, /* Intel 960 */
/* The order of the following is important.
diff --git a/bfd/cpu-m68k.c b/bfd/cpu-m68k.c
index 2e6f6c6..7e424a8 100644
--- a/bfd/cpu-m68k.c
+++ b/bfd/cpu-m68k.c
@@ -76,19 +76,25 @@ static const bfd_arch_info_type arch_info_struct[] =
FALSE, &arch_info_struct[24]),
N(bfd_mach_mcf_isa_b_float_emac, "m68k:isa-b:float:emac",
FALSE, &arch_info_struct[25]),
+ N(bfd_mach_mcf_isa_c, "m68k:isa-c",
+ FALSE, &arch_info_struct[26]),
+ N(bfd_mach_mcf_isa_c_mac, "m68k:isa-c:mac",
+ FALSE, &arch_info_struct[27]),
+ N(bfd_mach_mcf_isa_c_emac, "m68k:isa-c:emac",
+ FALSE, &arch_info_struct[28]),
/* Legacy names for CF architectures */
- N(bfd_mach_mcf_isa_a_nodiv, "m68k:5200", FALSE, &arch_info_struct[26]),
- N(bfd_mach_mcf_isa_a_mac,"m68k:5206e", FALSE, &arch_info_struct[27]),
- N(bfd_mach_mcf_isa_a_mac, "m68k:5307", FALSE, &arch_info_struct[28]),
- N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:5407", FALSE, &arch_info_struct[29]),
- N(bfd_mach_mcf_isa_aplus_emac, "m68k:528x", FALSE, &arch_info_struct[30]),
- N(bfd_mach_mcf_isa_aplus_emac, "m68k:521x", FALSE, &arch_info_struct[31]),
- N(bfd_mach_mcf_isa_a_emac, "m68k:5249", FALSE, &arch_info_struct[32]),
+ N(bfd_mach_mcf_isa_a_nodiv, "m68k:5200", FALSE, &arch_info_struct[29]),
+ N(bfd_mach_mcf_isa_a_mac,"m68k:5206e", FALSE, &arch_info_struct[30]),
+ N(bfd_mach_mcf_isa_a_mac, "m68k:5307", FALSE, &arch_info_struct[31]),
+ N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:5407", FALSE, &arch_info_struct[32]),
+ N(bfd_mach_mcf_isa_aplus_emac, "m68k:528x", FALSE, &arch_info_struct[33]),
+ N(bfd_mach_mcf_isa_aplus_emac, "m68k:521x", FALSE, &arch_info_struct[34]),
+ N(bfd_mach_mcf_isa_a_emac, "m68k:5249", FALSE, &arch_info_struct[35]),
N(bfd_mach_mcf_isa_b_float_emac, "m68k:547x",
- FALSE, &arch_info_struct[33]),
+ FALSE, &arch_info_struct[36]),
N(bfd_mach_mcf_isa_b_float_emac, "m68k:548x",
- FALSE, &arch_info_struct[34]),
+ FALSE, &arch_info_struct[37]),
N(bfd_mach_mcf_isa_b_float_emac, "m68k:cfv4e", FALSE, 0),
};
@@ -125,6 +131,9 @@ static const unsigned m68k_arch_features[] =
mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat,
mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat|mcfmac,
mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat|mcfemac,
+ mcfisa_a|mcfhwdiv|mcfisa_c|mcfusp,
+ mcfisa_a|mcfhwdiv|mcfisa_c|mcfusp|mcfmac,
+ mcfisa_a|mcfhwdiv|mcfisa_c|mcfusp|mcfemac,
};
/* Return the count of bits set in MASK */
@@ -222,6 +231,10 @@ bfd_m68k_compatible (const bfd_arch_info_type *a,
if ((~features & (mcfisa_aa | mcfisa_b)) == 0)
return NULL;
+ /* ISA B and ISA C are incompatible. */
+ if ((~features & (mcfisa_b | mcfisa_c)) == 0)
+ return NULL;
+
/* MAC and EMAC code cannot be merged. */
if ((~features & (mcfmac | mcfemac)) == 0)
return NULL;
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 948a996..6cc0212 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -300,6 +300,40 @@ static const struct elf_m68k_plt_info elf_isab_plt_info = {
elf_isab_plt_entry, { 2, 20 }, 12
};
+#define ISAC_PLT_ENTRY_SIZE 24
+
+static const bfd_byte elf_isac_plt0_entry[ISAC_PLT_ENTRY_SIZE] =
+{
+ 0x20, 0x3c, /* move.l #offset,%d0 */
+ 0, 0, 0, 0, /* replaced with .got + 4 - . */
+ 0x2e, 0xbb, 0x08, 0xfa, /* move.l (-6,%pc,%d0:l),(%sp) */
+ 0x20, 0x3c, /* move.l #offset,%d0 */
+ 0, 0, 0, 0, /* replaced with .got + 8 - . */
+ 0x20, 0x7b, 0x08, 0xfa, /* move.l (-6,%pc,%d0:l), %a0 */
+ 0x4e, 0xd0, /* jmp (%a0) */
+ 0x4e, 0x71 /* nop */
+};
+
+/* Subsequent entries in a procedure linkage table look like this. */
+
+static const bfd_byte elf_isac_plt_entry[ISAC_PLT_ENTRY_SIZE] =
+{
+ 0x20, 0x3c, /* move.l #offset,%d0 */
+ 0, 0, 0, 0, /* replaced with (.got entry) - . */
+ 0x20, 0x7b, 0x08, 0xfa, /* move.l (-6,%pc,%d0:l), %a0 */
+ 0x4e, 0xd0, /* jmp (%a0) */
+ 0x2f, 0x3c, /* move.l #offset,-(%sp) */
+ 0, 0, 0, 0, /* replaced with offset into relocation table */
+ 0x61, 0xff, /* bsr.l .plt */
+ 0, 0, 0, 0 /* replaced with .plt - . */
+};
+
+static const struct elf_m68k_plt_info elf_isac_plt_info = {
+ ISAC_PLT_ENTRY_SIZE,
+ elf_isac_plt0_entry, { 2, 12},
+ elf_isac_plt_entry, { 2, 20 }, 12
+};
+
#define CPU32_PLT_ENTRY_SIZE 24
/* Procedure linkage table entries for the cpu32 */
static const bfd_byte elf_cpu32_plt0_entry[CPU32_PLT_ENTRY_SIZE] =
@@ -468,6 +502,9 @@ elf32_m68k_object_p (bfd *abfd)
case EF_M68K_CF_ISA_B:
features |= mcfisa_a|mcfisa_b|mcfhwdiv|mcfusp;
break;
+ case EF_M68K_CF_ISA_C:
+ features |= mcfisa_a|mcfisa_c|mcfhwdiv|mcfusp;
+ break;
}
switch (eflags & EF_M68K_CF_MAC_MASK)
{
@@ -617,6 +654,9 @@ elf32_m68k_print_private_bfd_data (abfd, ptr)
case EF_M68K_CF_ISA_B:
isa = "B";
break;
+ case EF_M68K_CF_ISA_C:
+ isa = "C";
+ break;
}
fprintf (file, " [isa %s]%s", isa, additional);
if (eflags & EF_M68K_CF_FLOAT)
@@ -1145,6 +1185,8 @@ elf_m68k_get_plt_info (bfd *output_bfd)
return &elf_cpu32_plt_info;
if (features & mcfisa_b)
return &elf_isab_plt_info;
+ if (features & mcfisa_c)
+ return &elf_isac_plt_info;
return &elf_m68k_plt_info;
}