]>
Commit | Line | Data |
---|---|---|
1c0d3aa6 | 1 | /* BFD support for the score processor |
6f2750fe | 2 | Copyright (C) 2006-2016 Free Software Foundation, Inc. |
1c0d3aa6 | 3 | Contributed by |
c3b7224a | 4 | Brain.lin ([email protected]) |
1c0d3aa6 | 5 | Mei Ligang ([email protected]) |
c3b7224a | 6 | Pei-Lin Tsai ([email protected]) |
1c0d3aa6 NC |
7 | |
8 | This file is part of BFD, the Binary File Descriptor library. | |
9 | ||
10 | This program is free software; you can redistribute it and/or modify | |
11 | it under the terms of the GNU General Public License as published by | |
cd123cb7 | 12 | the Free Software Foundation; either version 3 of the License, or |
1c0d3aa6 NC |
13 | (at your option) any later version. |
14 | ||
15 | This program is distributed in the hope that it will be useful, | |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | GNU General Public License for more details. | |
19 | ||
20 | You should have received a copy of the GNU General Public License | |
21 | along with this program; if not, write to the Free Software | |
cd123cb7 NC |
22 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
23 | MA 02110-1301, USA. */ | |
1c0d3aa6 | 24 | |
c3b7224a | 25 | #include "sysdep.h" |
691bf19c | 26 | #include "bfd.h" |
1c0d3aa6 NC |
27 | #include "libbfd.h" |
28 | ||
c3b7224a NC |
29 | /* This routine is provided two arch_infos and works out which Score |
30 | machine which would be compatible with both and returns a pointer | |
31 | to its info structure. */ | |
32 | ||
33 | static const bfd_arch_info_type * | |
34 | compatible (const bfd_arch_info_type * a, const bfd_arch_info_type * b) | |
1c0d3aa6 | 35 | { |
c3b7224a NC |
36 | /* If a & b are for different architectures we can do nothing. */ |
37 | if (a->arch != b->arch) | |
38 | return NULL; | |
39 | ||
40 | if (a->mach != b->mach) | |
41 | return NULL; | |
42 | ||
43 | return a; | |
44 | } | |
45 | ||
46 | #define N(addr_bits, machine, print, default, next) \ | |
47 | { \ | |
48 | 32, /* 16 bits in a word. */ \ | |
49 | 32, /* Bits in an address. */ \ | |
50 | 8, /* 8 bits in a byte. */ \ | |
51 | bfd_arch_score, \ | |
52 | machine, /* Machine number. */ \ | |
53 | "score", /* Architecture name. */ \ | |
54 | print, /* Printable name. */ \ | |
55 | 4, /* Section align power. */ \ | |
56 | default, /* The default machine. */ \ | |
57 | compatible, \ | |
58 | bfd_default_scan, \ | |
b7761f11 | 59 | bfd_arch_default_fill, \ |
c3b7224a NC |
60 | next \ |
61 | } | |
62 | ||
63 | static const bfd_arch_info_type arch_info_struct[] = | |
64 | { | |
65 | N (16, bfd_mach_score3, "score3", FALSE, NULL), | |
1c0d3aa6 | 66 | }; |
c3b7224a NC |
67 | |
68 | const bfd_arch_info_type bfd_score_arch = | |
69 | N (16, bfd_mach_score7, "score7", TRUE, & arch_info_struct[0]); |