Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* BFD support for the ARC processor |
b90efa5b | 2 | Copyright (C) 1994-2015 Free Software Foundation, Inc. |
252b5132 RH |
3 | Contributed by Doug Evans (dje@cygnus.com). |
4 | ||
cd123cb7 | 5 | This file is part of BFD, the Binary File Descriptor library. |
252b5132 | 6 | |
cd123cb7 NC |
7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 3 of the License, or | |
10 | (at your option) any later version. | |
252b5132 | 11 | |
cd123cb7 NC |
12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
252b5132 | 16 | |
cd123cb7 NC |
17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software | |
19 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, | |
20 | MA 02110-1301, USA. */ | |
252b5132 | 21 | |
252b5132 | 22 | #include "sysdep.h" |
3db64b00 | 23 | #include "bfd.h" |
252b5132 RH |
24 | #include "libbfd.h" |
25 | ||
26 | #define ARC(mach, print_name, default_p, next) \ | |
27 | { \ | |
0d2bcfaf NC |
28 | 32, /* 32 bits in a word */ \ |
29 | 32, /* 32 bits in an address */ \ | |
30 | 8, /* 8 bits in a byte */ \ | |
252b5132 RH |
31 | bfd_arch_arc, \ |
32 | mach, \ | |
33 | "arc", \ | |
34 | print_name, \ | |
0d2bcfaf | 35 | 4, /* section alignment power */ \ |
252b5132 | 36 | default_p, \ |
bcee8eb8 | 37 | bfd_default_compatible, \ |
252b5132 | 38 | bfd_default_scan, \ |
b7761f11 | 39 | bfd_arch_default_fill, \ |
252b5132 RH |
40 | next, \ |
41 | } | |
42 | ||
252b5132 RH |
43 | static const bfd_arch_info_type arch_info_struct[] = |
44 | { | |
886a2506 NC |
45 | ARC (bfd_mach_arc_arc600, "ARC600", FALSE, &arch_info_struct[1]), |
46 | ARC (bfd_mach_arc_arc600, "A6" , FALSE, &arch_info_struct[2]), | |
47 | ARC (bfd_mach_arc_arc601, "ARC601", FALSE, &arch_info_struct[3]), | |
48 | ARC (bfd_mach_arc_arc700, "ARC700", FALSE, &arch_info_struct[4]), | |
49 | ARC (bfd_mach_arc_arc700, "A7", FALSE, &arch_info_struct[5]), | |
50 | ARC (bfd_mach_arc_arcv2, "ARCv2", FALSE, &arch_info_struct[6]), | |
51 | ARC (bfd_mach_arc_arcv2, "EM", FALSE, &arch_info_struct[7]), | |
52 | ARC (bfd_mach_arc_arcv2, "HS", FALSE, NULL), | |
252b5132 | 53 | }; |
252b5132 RH |
54 | |
55 | const bfd_arch_info_type bfd_arc_arch = | |
886a2506 | 56 | ARC (bfd_mach_arc_arcv2, "HS", TRUE, &arch_info_struct[0]); |
0d2bcfaf | 57 | |
252b5132 RH |
58 | /* Utility routines. */ |
59 | ||
60 | /* Given cpu type NAME, return its bfd_mach_arc_xxx value. | |
61 | Returns -1 if not found. */ | |
886a2506 | 62 | int arc_get_mach (char *name); |
dc810e39 | 63 | |
252b5132 | 64 | int |
2c3fc389 | 65 | arc_get_mach (char *name) |
252b5132 RH |
66 | { |
67 | const bfd_arch_info_type *p; | |
68 | ||
69 | for (p = &bfd_arc_arch; p != NULL; p = p->next) | |
0d2bcfaf NC |
70 | if (strcmp (name, p->printable_name) == 0) |
71 | return p->mach; | |
252b5132 RH |
72 | return -1; |
73 | } |