Commit | Line | Data |
---|---|---|
026df7c5 | 1 | /* bfd back-end for TMS320C[34]x support |
82704155 | 2 | Copyright (C) 1996-2019 Free Software Foundation, Inc. |
026df7c5 NC |
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 | |
cd123cb7 | 10 | the Free Software Foundation; either version 3 of the License, or |
026df7c5 NC |
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 | |
cd123cb7 NC |
20 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
21 | MA 02110-1301, USA. */ | |
026df7c5 | 22 | |
026df7c5 | 23 | #include "sysdep.h" |
3db64b00 | 24 | #include "bfd.h" |
026df7c5 NC |
25 | #include "libbfd.h" |
26 | ||
b34976b6 | 27 | static bfd_boolean |
2c3fc389 NC |
28 | tic4x_scan (const struct bfd_arch_info *info, |
29 | const char *string) | |
026df7c5 NC |
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') | |
b34976b6 | 38 | return FALSE; |
026df7c5 NC |
39 | |
40 | if (*string == '3') | |
be33c5dd | 41 | return (info->mach == bfd_mach_tic3x); |
026df7c5 | 42 | else if (*string == '4') |
be33c5dd | 43 | return info->mach == bfd_mach_tic4x; |
026df7c5 | 44 | |
b34976b6 | 45 | return FALSE; |
026df7c5 NC |
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, | |
be33c5dd SS |
55 | bfd_mach_tic3x, /* Machine number. */ |
56 | "tic3x", /* Architecture name. */ | |
026df7c5 NC |
57 | "tms320c3x", /* Printable name. */ |
58 | 0, /* Alignment power. */ | |
b34976b6 AM |
59 | FALSE, /* Not the default architecture. */ |
60 | bfd_default_compatible, | |
be33c5dd | 61 | tic4x_scan, |
b7761f11 | 62 | bfd_arch_default_fill, |
026df7c5 NC |
63 | 0 |
64 | }; | |
65 | ||
66 | const bfd_arch_info_type bfd_tic4x_arch = | |
67 | { | |
68 | 32, /* 32 bits in a word. */ | |
69 | 32, /* 32 bits in an address. */ | |
70 | 32, /* 32 bits in a byte. */ | |
71 | bfd_arch_tic4x, | |
be33c5dd SS |
72 | bfd_mach_tic4x, /* Machine number. */ |
73 | "tic4x", /* Architecture name. */ | |
026df7c5 NC |
74 | "tms320c4x", /* Printable name. */ |
75 | 0, /* Alignment power. */ | |
b34976b6 AM |
76 | TRUE, /* The default architecture. */ |
77 | bfd_default_compatible, | |
be33c5dd | 78 | tic4x_scan, |
b7761f11 | 79 | bfd_arch_default_fill, |
026df7c5 NC |
80 | &bfd_tic3x_arch, |
81 | }; | |
82 | ||
83 |