Commit | Line | Data |
---|---|---|
026df7c5 NC |
1 | /* bfd back-end for TMS320C[34]x support |
2 | Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. | |
3 | ||
4 | Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz) | |
5 | ||
6 | This file is part of BFD, the Binary File Descriptor library. | |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 2 of the License, or | |
11 | (at your option) any later version. | |
12 | ||
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with this program; if not, write to the Free Software | |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
21 | ||
22 | #include "bfd.h" | |
23 | #include "sysdep.h" | |
24 | #include "libbfd.h" | |
25 | ||
26 | static boolean | |
27 | c4x_scan (info, string) | |
28 | const struct bfd_arch_info *info; | |
29 | const char *string; | |
30 | { | |
31 | /* Allow strings of form [ti][Cc][34][0-9], let's not be too picky | |
32 | about strange numbered machines in C3x or C4x series. */ | |
33 | if (string[0] == 't' && string[1] == 'i') | |
34 | string += 2; | |
35 | if (*string == 'C' || *string == 'c') | |
36 | string++; | |
37 | if (string[1] < '0' && string[1] > '9') | |
38 | return false; | |
39 | ||
40 | if (*string == '3') | |
41 | return (info->mach == bfd_mach_c3x); | |
42 | else if (*string == '4') | |
43 | return info->mach == bfd_mach_c4x; | |
44 | ||
45 | return false; | |
46 | } | |
47 | ||
48 | ||
49 | const bfd_arch_info_type bfd_tic3x_arch = | |
50 | { | |
51 | 32, /* 32 bits in a word. */ | |
52 | 32, /* 32 bits in an address. */ | |
53 | 32, /* 32 bits in a byte. */ | |
54 | bfd_arch_tic4x, | |
55 | bfd_mach_c3x, /* Machine number. */ | |
56 | "c3x", /* Architecture name. */ | |
57 | "tms320c3x", /* Printable name. */ | |
58 | 0, /* Alignment power. */ | |
59 | false, /* Not the default architecture. */ | |
60 | bfd_default_compatible, | |
61 | c4x_scan, | |
62 | 0 | |
63 | }; | |
64 | ||
65 | const bfd_arch_info_type bfd_tic4x_arch = | |
66 | { | |
67 | 32, /* 32 bits in a word. */ | |
68 | 32, /* 32 bits in an address. */ | |
69 | 32, /* 32 bits in a byte. */ | |
70 | bfd_arch_tic4x, | |
71 | bfd_mach_c4x, /* Machine number. */ | |
72 | "c4x", /* Architecture name. */ | |
73 | "tms320c4x", /* Printable name. */ | |
74 | 0, /* Alignment power. */ | |
75 | true, /* The default architecture. */ | |
76 | bfd_default_compatible, | |
77 | c4x_scan, | |
78 | &bfd_tic3x_arch, | |
79 | }; | |
80 | ||
81 |