]>
Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* BFD support for the ARC processor |
3db64b00 AM |
2 | Copyright 1994, 1995, 1997, 2001, 2002, 2007 |
3 | Free Software Foundation, Inc. | |
252b5132 RH |
4 | Contributed by Doug Evans (dje@cygnus.com). |
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 | |
3e110533 | 20 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 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 RH |
38 | bfd_default_scan, \ |
39 | next, \ | |
40 | } | |
41 | ||
252b5132 RH |
42 | static const bfd_arch_info_type arch_info_struct[] = |
43 | { | |
b34976b6 AM |
44 | ARC ( bfd_mach_arc_5, "arc5", FALSE, &arch_info_struct[1] ), |
45 | ARC ( bfd_mach_arc_5, "base", FALSE, &arch_info_struct[2] ), | |
46 | ARC ( bfd_mach_arc_6, "arc6", FALSE, &arch_info_struct[3] ), | |
47 | ARC ( bfd_mach_arc_7, "arc7", FALSE, &arch_info_struct[4] ), | |
48 | ARC ( bfd_mach_arc_8, "arc8", FALSE, NULL ), | |
252b5132 | 49 | }; |
252b5132 RH |
50 | |
51 | const bfd_arch_info_type bfd_arc_arch = | |
b34976b6 | 52 | ARC ( bfd_mach_arc_6, "arc", TRUE, &arch_info_struct[0] ); |
0d2bcfaf | 53 | |
252b5132 RH |
54 | /* Utility routines. */ |
55 | ||
56 | /* Given cpu type NAME, return its bfd_mach_arc_xxx value. | |
57 | Returns -1 if not found. */ | |
58 | ||
dc810e39 AM |
59 | int arc_get_mach PARAMS ((char *)); |
60 | ||
252b5132 RH |
61 | int |
62 | arc_get_mach (name) | |
63 | char *name; | |
64 | { | |
65 | const bfd_arch_info_type *p; | |
66 | ||
67 | for (p = &bfd_arc_arch; p != NULL; p = p->next) | |
0d2bcfaf NC |
68 | if (strcmp (name, p->printable_name) == 0) |
69 | return p->mach; | |
252b5132 RH |
70 | return -1; |
71 | } |