diff options
Diffstat (limited to 'contrib/binutils/bfd/cpu-sh.c')
-rw-r--r-- | contrib/binutils/bfd/cpu-sh.c | 61 |
1 files changed, 55 insertions, 6 deletions
diff --git a/contrib/binutils/bfd/cpu-sh.c b/contrib/binutils/bfd/cpu-sh.c index 7f6dd68..9f7ef20 100644 --- a/contrib/binutils/bfd/cpu-sh.c +++ b/contrib/binutils/bfd/cpu-sh.c @@ -23,15 +23,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libbfd.h" -int bfd_default_scan_num_mach(); - static boolean scan_mach (info, string) const struct bfd_arch_info *info; const char *string; { - if (strcmp(string,"sh") == 0) return true; - if (strcmp(string,"SH") == 0) return true; + if (strcasecmp (info->printable_name, string) == 0) + return true; return false; } @@ -51,18 +49,69 @@ compatible (a,b) } #endif +#define SH_NEXT &arch_info_struct[0] +#define SH3_NEXT &arch_info_struct[1] +#define SH3E_NEXT &arch_info_struct[2] +#define SH4_NEXT NULL + +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_sh3, + "sh", /* arch_name */ + "sh3", /* printable name */ + 1, + false, /* not the default */ + bfd_default_compatible, + 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_sh3e, + "sh", /* arch_name */ + "sh3e", /* printable name */ + 1, + false, /* not the default */ + bfd_default_compatible, + 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 = { 32, /* 32 bits in a word */ 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_sh, - 0, /* only 1 machine */ + bfd_mach_sh, "sh", /* arch_name */ "sh", /* printable name */ 1, true, /* the default machine */ bfd_default_compatible, scan_mach, - 0, + SH_NEXT }; |