This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] m68k: Add 51QE support (Part 2)


Hi,

Attached is a patch to complete the addition of MCF51QE support.

Without this patch, specifying -mcpu=51qe causes

  Not a defined coldfire architecture

This warning, from tc-m68k.c:m68k_elf_final_processing, is triggered
because -mcpu=51qe has features mcfisa_a|mcfisa_c|mcfusp, but
m68k_elf_final_processing cannot find a corresponding EF_M68K_* that
exactly matches the feature combination.

This patch adds EF_M68K_CF_ISA_C_NODIV and updates the switch
statements that handle EF_M68K_*.  Similarly, it adds
bfd_mach_mcf_isa_c_nodiv (and its valid variants) and updates
cpu-m68k.c and ieee.c.

OK to apply?

Kazu Hirata

bfd/
2007-08-29  Nathan Sidwell  <nathan@codesourcery.com>

	* archures.c: Add bfd_mach_mcf_isa_c_nodiv,
	bfd_mach_mcf_isa_c_nodiv_mac & bfd_mach_mcf_isa_c_nodiv_emac.
	* ieee.c (ieee_write_processor): Update coldfire architecture
	list.
	* bfd-in2.h: Rebuilt.
	* cpu-m68k.c (arch_info_struct): Add isa_c nodiv architectures.
	(m68k_arch_features): Likewise.
	* elf32-m68k.c (elf32_m68k_object_p): Add EF_M68K_CF_ISA_C_NODIV.
	(elf32_m68k_print_private_bfd_data): Likewise.

gas/
2007-08-29  Nathan Sidwell  <nathan@codesourcery.com>

	* config/tc-m68k.c (m68k_ip): Add mcfisa_c case.
	(m68k_elf_final_processing): Add EF_M68K_CF_ISA_C_NODIV.

include/elf/
2007-08-29  Nathan Sidwell  <nathan@codesourcery.com>

	* m68k.h (EF_M68K_CF_ISA_C_NODIV): New.

Index: bfd/archures.c
===================================================================
RCS file: /cvs/src/src/bfd/archures.c,v
retrieving revision 1.127
diff -u -d -p -r1.127 archures.c
--- bfd/archures.c	3 Jul 2007 14:26:39 -0000	1.127
+++ bfd/archures.c	28 Aug 2007 14:02:33 -0000
@@ -101,6 +101,9 @@ DESCRIPTION
 .#define bfd_mach_mcf_isa_c 26
 .#define bfd_mach_mcf_isa_c_mac 27
 .#define bfd_mach_mcf_isa_c_emac 28
+.#define bfd_mach_mcf_isa_c_nodiv 29
+.#define bfd_mach_mcf_isa_c_nodiv_mac 30
+.#define bfd_mach_mcf_isa_c_nodiv_emac 31
 .  bfd_arch_vax,       {* DEC Vax *}
 .  bfd_arch_i960,      {* Intel 960 *}
 .    {* The order of the following is important.
Index: bfd/bfd-in2.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in2.h,v
retrieving revision 1.425
diff -u -d -p -r1.425 bfd-in2.h
--- bfd/bfd-in2.h	12 Jul 2007 07:16:40 -0000	1.425
+++ bfd/bfd-in2.h	28 Aug 2007 14:02:33 -0000
@@ -1772,6 +1772,9 @@ enum bfd_architecture
 #define bfd_mach_mcf_isa_c 26
 #define bfd_mach_mcf_isa_c_mac 27
 #define bfd_mach_mcf_isa_c_emac 28
+#define bfd_mach_mcf_isa_c_nodiv 29
+#define bfd_mach_mcf_isa_c_nodiv_mac 30
+#define bfd_mach_mcf_isa_c_nodiv_emac 31
   bfd_arch_vax,       /* DEC Vax */
   bfd_arch_i960,      /* Intel 960 */
     /* The order of the following is important.
Index: bfd/cpu-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-m68k.c,v
retrieving revision 1.19
diff -u -d -p -r1.19 cpu-m68k.c
--- bfd/cpu-m68k.c	3 Jul 2007 14:26:40 -0000	1.19
+++ bfd/cpu-m68k.c	28 Aug 2007 14:02:33 -0000
@@ -83,19 +83,25 @@ static const bfd_arch_info_type arch_inf
       FALSE, &arch_info_struct[27]),
     N(bfd_mach_mcf_isa_c_emac, "m68k:isa-c:emac",
       FALSE, &arch_info_struct[28]),
+    N(bfd_mach_mcf_isa_c_nodiv, "m68k:isa-c:nodiv",
+      FALSE, &arch_info_struct[29]),
+    N(bfd_mach_mcf_isa_c_nodiv_mac, "m68k:isa-c:nodiv:mac",
+      FALSE, &arch_info_struct[30]),
+    N(bfd_mach_mcf_isa_c_nodiv_emac, "m68k:isa-c:nodiv:emac",
+      FALSE, &arch_info_struct[31]),
 
     /* Legacy names for CF architectures */
-    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_a_nodiv, "m68k:5200", FALSE, &arch_info_struct[32]),
+    N(bfd_mach_mcf_isa_a_mac,"m68k:5206e", FALSE, &arch_info_struct[33]),
+    N(bfd_mach_mcf_isa_a_mac, "m68k:5307", FALSE, &arch_info_struct[34]),
+    N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:5407", FALSE, &arch_info_struct[35]),
+    N(bfd_mach_mcf_isa_aplus_emac, "m68k:528x", FALSE, &arch_info_struct[36]),
+    N(bfd_mach_mcf_isa_aplus_emac, "m68k:521x", FALSE, &arch_info_struct[37]),
+    N(bfd_mach_mcf_isa_a_emac, "m68k:5249", FALSE, &arch_info_struct[38]),
     N(bfd_mach_mcf_isa_b_float_emac, "m68k:547x",
-      FALSE, &arch_info_struct[36]),
+      FALSE, &arch_info_struct[39]),
     N(bfd_mach_mcf_isa_b_float_emac, "m68k:548x",
-      FALSE, &arch_info_struct[37]),
+      FALSE, &arch_info_struct[40]),
     N(bfd_mach_mcf_isa_b_float_emac, "m68k:cfv4e", FALSE, 0),
   };
 
@@ -135,6 +141,9 @@ static const unsigned m68k_arch_features
   mcfisa_a|mcfhwdiv|mcfisa_c|mcfusp,
   mcfisa_a|mcfhwdiv|mcfisa_c|mcfusp|mcfmac,
   mcfisa_a|mcfhwdiv|mcfisa_c|mcfusp|mcfemac,
+  mcfisa_a|mcfisa_c|mcfusp,
+  mcfisa_a|mcfisa_c|mcfusp|mcfmac,
+  mcfisa_a|mcfisa_c|mcfusp|mcfemac,
 };
 
 /* Return the count of bits set in MASK  */
Index: bfd/elf32-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68k.c,v
retrieving revision 1.103
diff -u -d -p -r1.103 elf32-m68k.c
--- bfd/elf32-m68k.c	3 Jul 2007 14:26:41 -0000	1.103
+++ bfd/elf32-m68k.c	28 Aug 2007 14:02:33 -0000
@@ -506,6 +506,9 @@ elf32_m68k_object_p (bfd *abfd)
 	case EF_M68K_CF_ISA_C:
 	  features |= mcfisa_a|mcfisa_c|mcfhwdiv|mcfusp;
 	  break;
+	case EF_M68K_CF_ISA_C_NODIV:
+	  features |= mcfisa_a|mcfisa_c|mcfusp;
+	  break;
 	}
       switch (eflags & EF_M68K_CF_MAC_MASK)
 	{
@@ -658,6 +661,10 @@ elf32_m68k_print_private_bfd_data (abfd,
 	    case EF_M68K_CF_ISA_C:
 	      isa = "C";
 	      break;
+	    case EF_M68K_CF_ISA_C_NODIV:
+	      isa = "C";
+	      additional = " [nodiv]";
+	      break;
 	    }
 	  fprintf (file, " [isa %s]%s", isa, additional);
 	  if (eflags & EF_M68K_CF_FLOAT)
Index: bfd/ieee.c
===================================================================
RCS file: /cvs/src/src/bfd/ieee.c,v
retrieving revision 1.61
diff -u -d -p -r1.61 ieee.c
--- bfd/ieee.c	3 Jul 2007 14:26:42 -0000	1.61
+++ bfd/ieee.c	28 Aug 2007 14:02:33 -0000
@@ -3487,6 +3487,12 @@ ieee_write_processor (bfd *abfd)
 	  case bfd_mach_mcf_isa_b_float: id = "isa-b:float"; break;
 	  case bfd_mach_mcf_isa_b_float_mac: id = "isa-b:float:mac"; break;
 	  case bfd_mach_mcf_isa_b_float_emac: id = "isa-b:float:emac"; break;
+	  case bfd_mach_mcf_isa_c: id = "isa-c"; break;
+	  case bfd_mach_mcf_isa_c_mac: id = "isa-c:mac"; break;
+	  case bfd_mach_mcf_isa_c_emac: id = "isa-c:emac"; break;
+	  case bfd_mach_mcf_isa_c_nodiv: id = "isa-c:nodiv"; break;
+	  case bfd_mach_mcf_isa_c_nodiv_mac: id = "isa-c:nodiv:mac"; break;
+	  case bfd_mach_mcf_isa_c_nodiv_emac: id = "isa-c:nodiv:emac"; break;
 	  }
 
 	if (! ieee_write_id (abfd, id))
Index: gas/config/tc-m68k.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68k.c,v
retrieving revision 1.96
diff -u -d -p -r1.96 tc-m68k.c
--- gas/config/tc-m68k.c	28 Aug 2007 13:43:06 -0000	1.96
+++ gas/config/tc-m68k.c	28 Aug 2007 14:02:34 -0000
@@ -2186,6 +2186,9 @@ m68k_ip (char *instring)
 		case mcfisa_b:
 		  APPEND (_("ColdFire ISA_B"));
 		  break;
+		case mcfisa_c:
+		  APPEND (_("ColdFire ISA_C"));
+		  break;
 		case cfloat:
 		  APPEND (_("ColdFire fpu"));
 		  break;
@@ -7749,6 +7752,7 @@ m68k_elf_final_processing (void)
 	{EF_M68K_CF_ISA_B_NOUSP,mcfisa_a|mcfisa_b|mcfhwdiv},
 	{EF_M68K_CF_ISA_B,	mcfisa_a|mcfisa_b|mcfhwdiv|mcfusp},
 	{EF_M68K_CF_ISA_C,	mcfisa_a|mcfisa_c|mcfhwdiv|mcfusp},
+	{EF_M68K_CF_ISA_C_NODIV,mcfisa_a|mcfisa_c|mcfusp},
 	{0,0},
       };
       static const unsigned mac_features[][2] =
Index: include/elf/m68k.h
===================================================================
RCS file: /cvs/src/src/include/elf/m68k.h,v
retrieving revision 1.16
diff -u -d -p -r1.16 m68k.h
--- include/elf/m68k.h	8 Jan 2007 18:42:37 -0000	1.16
+++ include/elf/m68k.h	28 Aug 2007 14:02:34 -0000
@@ -71,6 +71,7 @@ END_RELOC_NUMBERS (R_68K_max)
 #define EF_M68K_CF_ISA_B_NOUSP	0x04  /* ISA_B except for USP */
 #define EF_M68K_CF_ISA_B	0x05
 #define EF_M68K_CF_ISA_C	0x06
+#define EF_M68K_CF_ISA_C_NODIV	0x07  /* ISA C except for div */
 #define EF_M68K_CF_MAC_MASK	0x30 
 #define EF_M68K_CF_MAC		0x10  /* MAC */
 #define EF_M68K_CF_EMAC		0x20  /* EMAC */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]