1 /* BFD support for the ARC processor
2 Copyright (C) 1994-2015 Free Software Foundation, Inc.
3 Contributed by Doug Evans (dje@cygnus.com).
5 This file is part of BFD, the Binary File Descriptor library.
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.
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.
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. */
26 #define ARC(mach, print_name, default_p, next) \
28 32, /* 32 bits in a word */ \
29 32, /* 32 bits in an address */ \
30 8, /* 8 bits in a byte */ \
35 4, /* section alignment power */ \
37 bfd_default_compatible, \
39 bfd_arch_default_fill, \
43 static const bfd_arch_info_type arch_info_struct[] =
45 ARC ( bfd_mach_arc_5, "arc5", FALSE, &arch_info_struct[1] ),
46 ARC ( bfd_mach_arc_5, "base", FALSE, &arch_info_struct[2] ),
47 ARC ( bfd_mach_arc_6, "arc6", FALSE, &arch_info_struct[3] ),
48 ARC ( bfd_mach_arc_7, "arc7", FALSE, &arch_info_struct[4] ),
49 ARC ( bfd_mach_arc_8, "arc8", FALSE, NULL ),
52 const bfd_arch_info_type bfd_arc_arch =
53 ARC ( bfd_mach_arc_6, "arc", TRUE, &arch_info_struct[0] );
55 /* Utility routines. */
57 /* Given cpu type NAME, return its bfd_mach_arc_xxx value.
58 Returns -1 if not found. */
60 int arc_get_mach (char *);
63 arc_get_mach (char *name)
65 const bfd_arch_info_type *p;
67 for (p = &bfd_arc_arch; p != NULL; p = p->next)
68 if (strcmp (name, p->printable_name) == 0)