* libxcoff.h (struct xcoff_backend_data_rec): Constify src param
[binutils-gdb.git] / bfd / cpu-sh.c
index 44adf9217ff801690d53a12d7d6f75638566b570..134b4e43516f08a66623abc0044267524fc34e65 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD library support routines for the Hitachi-SH architecture.
-   Copyright (C) 1993 Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1997, 1998, 2000 Free Software Foundation, Inc.
    Hacked by Steve Chamberlain of Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -22,8 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "sysdep.h"
 #include "libbfd.h"
 
-
-static boolean 
+static boolean
 scan_mach (info, string)
      const struct bfd_arch_info *info;
      const char *string;
@@ -33,7 +32,6 @@ scan_mach (info, string)
   return false;
 }
 
-
 #if 0
 /* This routine is provided two arch_infos and returns whether
    they'd be compatible */
@@ -49,12 +47,44 @@ compatible (a,b)
 }
 #endif
 
-#define SH_NEXT &arch_info_struct[0]
-#define SH3_NEXT &arch_info_struct[1]
-#define SH3E_NEXT NULL
+#define SH_NEXT      &arch_info_struct[0]
+#define SH2_NEXT     &arch_info_struct[1]
+#define SH_DSP_NEXT  &arch_info_struct[2]
+#define SH3_NEXT     &arch_info_struct[3]
+#define SH3_DSP_NEXT &arch_info_struct[4]
+#define SH3E_NEXT    &arch_info_struct[5]
+#define SH4_NEXT     NULL
 
-static const bfd_arch_info_type arch_info_struct[] = 
+static const bfd_arch_info_type arch_info_struct[] =
 {
+  {
+    32,                                /* 32 bits in a word */
+    32,                                /* 32 bits in an address */
+    8,                         /* 8 bits in a byte */
+    bfd_arch_sh,
+    bfd_mach_sh2,
+    "sh",                      /* arch_name  */
+    "sh2",                     /* printable name */
+    1,
+    false,                     /* not the default */
+    bfd_default_compatible,
+    scan_mach,
+    SH2_NEXT
+  },
+  {
+    32,                                /* 32 bits in a word */
+    32,                                /* 32 bits in an address */
+    8,                         /* 8 bits in a byte */
+    bfd_arch_sh,
+    bfd_mach_sh_dsp,
+    "sh",                      /* arch_name  */
+    "sh-dsp",                  /* printable name */
+    1,
+    false,                     /* not the default */
+    bfd_default_compatible,
+    scan_mach,
+    SH_DSP_NEXT
+  },
   {
     32,                                /* 32 bits in a word */
     32,                                /* 32 bits in an address */
@@ -69,6 +99,20 @@ static const bfd_arch_info_type arch_info_struct[] =
     scan_mach,
     SH3_NEXT
   },
+  {
+    32,                                /* 32 bits in a word */
+    32,                                /* 32 bits in an address */
+    8,                         /* 8 bits in a byte */
+    bfd_arch_sh,
+    bfd_mach_sh3_dsp,
+    "sh",                      /* arch_name  */
+    "sh3-dsp",                 /* printable name */
+    1,
+    false,                     /* not the default */
+    bfd_default_compatible,
+    scan_mach,
+    SH3_DSP_NEXT
+  },
   {
     32,                                /* 32 bits in a word */
     32,                                /* 32 bits in an address */
@@ -83,6 +127,20 @@ static const bfd_arch_info_type arch_info_struct[] =
     scan_mach,
     SH3E_NEXT
   },
+  {
+    32,                                /* 32 bits in a word */
+    32,                                /* 32 bits in an address */
+    8,                         /* 8 bits in a byte */
+    bfd_arch_sh,
+    bfd_mach_sh4,
+    "sh",                      /* arch_name  */
+    "sh4",                     /* printable name */
+    1,
+    false,                     /* not the default */
+    bfd_default_compatible,
+    scan_mach,
+    SH4_NEXT
+  },
 };
 
 const bfd_arch_info_type bfd_sh_arch =