Re-enable linking for sh5:
[external/binutils.git] / bfd / cpu-sh.c
1 /* BFD library support routines for the Hitachi-SH architecture.
2    Copyright 1993, 1994, 1997, 1998, 2000, 2001
3    Free Software Foundation, Inc.
4    Hacked by Steve Chamberlain of Cygnus Support.
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
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
21
22 #include "bfd.h"
23 #include "sysdep.h"
24 #include "libbfd.h"
25
26 #if 0
27 /* This routine is provided two arch_infos and returns whether
28    they'd be compatible */
29
30 static const bfd_arch_info_type *
31 compatible (a,b)
32      const bfd_arch_info_type *a;
33      const bfd_arch_info_type *b;
34 {
35   if (a->arch != b->arch || a->mach != b->mach)
36    return NULL;
37   return a;
38 }
39 #endif
40
41 #define SH_NEXT      &arch_info_struct[0]
42 #define SH2_NEXT     &arch_info_struct[1]
43 #define SH_DSP_NEXT  &arch_info_struct[2]
44 #define SH3_NEXT     &arch_info_struct[3]
45 #define SH3_DSP_NEXT &arch_info_struct[4]
46 #define SH3E_NEXT    &arch_info_struct[5]
47 #define SH4_NEXT     NULL
48 #undef  SH4_NEXT
49 #define SH4_NEXT     &arch_info_struct[6]
50 #define SH64_NEXT    NULL
51
52 static const bfd_arch_info_type arch_info_struct[] =
53 {
54   {
55     32,                         /* 32 bits in a word */
56     32,                         /* 32 bits in an address */
57     8,                          /* 8 bits in a byte */
58     bfd_arch_sh,
59     bfd_mach_sh2,
60     "sh",                       /* arch_name  */
61     "sh2",                      /* printable name */
62     1,
63     false,                      /* not the default */
64     bfd_default_compatible,
65     bfd_default_scan,
66     SH2_NEXT
67   },
68   {
69     32,                         /* 32 bits in a word */
70     32,                         /* 32 bits in an address */
71     8,                          /* 8 bits in a byte */
72     bfd_arch_sh,
73     bfd_mach_sh_dsp,
74     "sh",                       /* arch_name  */
75     "sh-dsp",                   /* printable name */
76     1,
77     false,                      /* not the default */
78     bfd_default_compatible,
79     bfd_default_scan,
80     SH_DSP_NEXT
81   },
82   {
83     32,                         /* 32 bits in a word */
84     32,                         /* 32 bits in an address */
85     8,                          /* 8 bits in a byte */
86     bfd_arch_sh,
87     bfd_mach_sh3,
88     "sh",                       /* arch_name  */
89     "sh3",                      /* printable name */
90     1,
91     false,                      /* not the default */
92     bfd_default_compatible,
93     bfd_default_scan,
94     SH3_NEXT
95   },
96   {
97     32,                         /* 32 bits in a word */
98     32,                         /* 32 bits in an address */
99     8,                          /* 8 bits in a byte */
100     bfd_arch_sh,
101     bfd_mach_sh3_dsp,
102     "sh",                       /* arch_name  */
103     "sh3-dsp",                  /* printable name */
104     1,
105     false,                      /* not the default */
106     bfd_default_compatible,
107     bfd_default_scan,
108     SH3_DSP_NEXT
109   },
110   {
111     32,                         /* 32 bits in a word */
112     32,                         /* 32 bits in an address */
113     8,                          /* 8 bits in a byte */
114     bfd_arch_sh,
115     bfd_mach_sh3e,
116     "sh",                       /* arch_name  */
117     "sh3e",                     /* printable name */
118     1,
119     false,                      /* not the default */
120     bfd_default_compatible,
121     bfd_default_scan,
122     SH3E_NEXT
123   },
124   {
125     32,                         /* 32 bits in a word */
126     32,                         /* 32 bits in an address */
127     8,                          /* 8 bits in a byte */
128     bfd_arch_sh,
129     bfd_mach_sh4,
130     "sh",                       /* arch_name  */
131     "sh4",                      /* printable name */
132     1,
133     false,                      /* not the default */
134     bfd_default_compatible,
135     bfd_default_scan,
136     SH4_NEXT
137   },
138   {
139     64,                         /* 64 bits in a word */
140     64,                         /* 64 bits in an address */
141     8,                          /* 8 bits in a byte */
142     bfd_arch_sh,
143     bfd_mach_sh5,
144     "sh",                       /* arch_name  */
145     "sh5",                      /* printable name */
146     1,
147     false,                      /* not the default */
148     bfd_default_compatible,
149     bfd_default_scan,
150     SH64_NEXT
151   },
152 };
153
154 const bfd_arch_info_type bfd_sh_arch =
155 {
156   32,                           /* 32 bits in a word */
157   32,                           /* 32 bits in an address */
158   8,                            /* 8 bits in a byte */
159   bfd_arch_sh,
160   bfd_mach_sh,
161   "sh",                         /* arch_name  */
162   "sh",                         /* printable name */
163   1,
164   true,                         /* the default machine */
165   bfd_default_compatible,
166   bfd_default_scan,
167   SH_NEXT
168 };