1fddef416Sniklas@section Architectures
2fddef416SniklasBFD keeps one atom in a BFD describing the
3fddef416Sniklasarchitecture of the data attached to the BFD: a pointer to a
4fddef416Sniklas@code{bfd_arch_info_type}.
5fddef416Sniklas
6fddef416SniklasPointers to structures can be requested independently of a BFD
7fddef416Sniklasso that an architecture's information can be interrogated
8fddef416Sniklaswithout access to an open BFD.
9fddef416Sniklas
10fddef416SniklasThe architecture information is provided by each architecture package.
11fddef416SniklasThe set of default architectures is selected by the macro
12fddef416Sniklas@code{SELECT_ARCHITECTURES}.  This is normally set up in the
13fddef416Sniklas@file{config/@var{target}.mt} file of your choice.  If the name is not
14fddef416Sniklasdefined, then all the architectures supported are included.
15fddef416Sniklas
16fddef416SniklasWhen BFD starts up, all the architectures are called with an
17fddef416Sniklasinitialize method.  It is up to the architecture back end to
18fddef416Sniklasinsert as many items into the list of architectures as it wants to;
19fddef416Sniklasgenerally this would be one for each machine and one for the
20fddef416Sniklasdefault case (an item with a machine field of 0).
21fddef416Sniklas
22fddef416SniklasBFD's idea of an architecture is implemented in @file{archures.c}.
23f7cc78ecSespie
24fddef416Sniklas@subsection bfd_architecture
25fddef416Sniklas
26f7cc78ecSespie
27fddef416Sniklas@strong{Description}@*
28fddef416SniklasThis enum gives the object file's CPU architecture, in a
29fddef416Sniklasglobal sense---i.e., what processor family does it belong to?
30fddef416SniklasAnother field indicates which processor within
31fddef416Sniklasthe family is in use.  The machine gives a number which
32fddef416Sniklasdistinguishes different versions of the architecture,
33fddef416Sniklascontaining, for example, 2 and 3 for Intel i960 KA and i960 KB,
34fddef416Sniklasand 68020 and 68030 for Motorola 68020 and 68030.
35fddef416Sniklas@example
36fddef416Sniklasenum bfd_architecture
37fddef416Sniklas@{
38d2201f2fSdrahn  bfd_arch_unknown,   /* File arch not known.  */
39d2201f2fSdrahn  bfd_arch_obscure,   /* Arch known, not one of these.  */
40fddef416Sniklas  bfd_arch_m68k,      /* Motorola 68xxx */
41f7cc78ecSespie#define bfd_mach_m68000 1
42f7cc78ecSespie#define bfd_mach_m68008 2
43f7cc78ecSespie#define bfd_mach_m68010 3
44f7cc78ecSespie#define bfd_mach_m68020 4
45f7cc78ecSespie#define bfd_mach_m68030 5
46f7cc78ecSespie#define bfd_mach_m68040 6
47f7cc78ecSespie#define bfd_mach_m68060 7
48f7cc78ecSespie#define bfd_mach_cpu32  8
495f210c2aSfgsch#define bfd_mach_mcf5200  9
505f210c2aSfgsch#define bfd_mach_mcf5206e 10
515f210c2aSfgsch#define bfd_mach_mcf5307  11
525f210c2aSfgsch#define bfd_mach_mcf5407  12
53*cf2f2c56Smiod#define bfd_mach_mcf528x  13
54fddef416Sniklas  bfd_arch_vax,       /* DEC Vax */
55fddef416Sniklas  bfd_arch_i960,      /* Intel 960 */
56fddef416Sniklas    /* The order of the following is important.
57fddef416Sniklas       lower number indicates a machine type that
58fddef416Sniklas       only accepts a subset of the instructions
59fddef416Sniklas       available to machines with higher numbers.
60fddef416Sniklas       The exception is the "ca", which is
61fddef416Sniklas       incompatible with all other machines except
62fddef416Sniklas       "core".  */
63fddef416Sniklas
64fddef416Sniklas#define bfd_mach_i960_core      1
65fddef416Sniklas#define bfd_mach_i960_ka_sa     2
66fddef416Sniklas#define bfd_mach_i960_kb_sb     3
67fddef416Sniklas#define bfd_mach_i960_mc        4
68fddef416Sniklas#define bfd_mach_i960_xa        5
69fddef416Sniklas#define bfd_mach_i960_ca        6
70fddef416Sniklas#define bfd_mach_i960_jx        7
71fddef416Sniklas#define bfd_mach_i960_hx        8
72fddef416Sniklas
73d2201f2fSdrahn  bfd_arch_or32,      /* OpenRISC 32 */
74d2201f2fSdrahn
75fddef416Sniklas  bfd_arch_a29k,      /* AMD 29000 */
76fddef416Sniklas  bfd_arch_sparc,     /* SPARC */
77fddef416Sniklas#define bfd_mach_sparc                 1
78fddef416Sniklas/* The difference between v8plus and v9 is that v9 is a true 64 bit env.  */
79fddef416Sniklas#define bfd_mach_sparc_sparclet        2
80fddef416Sniklas#define bfd_mach_sparc_sparclite       3
81fddef416Sniklas#define bfd_mach_sparc_v8plus          4
82d2201f2fSdrahn#define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns.  */
83f7cc78ecSespie#define bfd_mach_sparc_sparclite_le    6
84f7cc78ecSespie#define bfd_mach_sparc_v9              7
85d2201f2fSdrahn#define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns.  */
86d2201f2fSdrahn#define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns.  */
87d2201f2fSdrahn#define bfd_mach_sparc_v9b             10 /* with cheetah add'ns.  */
88fddef416Sniklas/* Nonzero if MACH has the v9 instruction set.  */
89fddef416Sniklas#define bfd_mach_sparc_v9_p(mach) \
905f210c2aSfgsch  ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
915f210c2aSfgsch   && (mach) != bfd_mach_sparc_sparclite_le)
92fddef416Sniklas  bfd_arch_mips,      /* MIPS Rxxxx */
93f7cc78ecSespie#define bfd_mach_mips3000              3000
94f7cc78ecSespie#define bfd_mach_mips3900              3900
95f7cc78ecSespie#define bfd_mach_mips4000              4000
96f7cc78ecSespie#define bfd_mach_mips4010              4010
97f7cc78ecSespie#define bfd_mach_mips4100              4100
98f7cc78ecSespie#define bfd_mach_mips4111              4111
99d2201f2fSdrahn#define bfd_mach_mips4120              4120
100f7cc78ecSespie#define bfd_mach_mips4300              4300
101f7cc78ecSespie#define bfd_mach_mips4400              4400
102f7cc78ecSespie#define bfd_mach_mips4600              4600
103f7cc78ecSespie#define bfd_mach_mips4650              4650
104f7cc78ecSespie#define bfd_mach_mips5000              5000
105d2201f2fSdrahn#define bfd_mach_mips5400              5400
106d2201f2fSdrahn#define bfd_mach_mips5500              5500
107f7cc78ecSespie#define bfd_mach_mips6000              6000
108*cf2f2c56Smiod#define bfd_mach_mips7000              7000
109f7cc78ecSespie#define bfd_mach_mips8000              8000
110f7cc78ecSespie#define bfd_mach_mips10000             10000
1115f210c2aSfgsch#define bfd_mach_mips12000             12000
112f7cc78ecSespie#define bfd_mach_mips16                16
1135f210c2aSfgsch#define bfd_mach_mips5                 5
1145f210c2aSfgsch#define bfd_mach_mips_sb1              12310201 /* octal 'SB', 01 */
115d2201f2fSdrahn#define bfd_mach_mipsisa32             32
116d2201f2fSdrahn#define bfd_mach_mipsisa32r2           33
117d2201f2fSdrahn#define bfd_mach_mipsisa64             64
118*cf2f2c56Smiod#define bfd_mach_mipsisa64r2           65
119fddef416Sniklas  bfd_arch_i386,      /* Intel 386 */
120d2201f2fSdrahn#define bfd_mach_i386_i386 1
121d2201f2fSdrahn#define bfd_mach_i386_i8086 2
122d2201f2fSdrahn#define bfd_mach_i386_i386_intel_syntax 3
123d2201f2fSdrahn#define bfd_mach_x86_64 64
124d2201f2fSdrahn#define bfd_mach_x86_64_intel_syntax 65
125fddef416Sniklas  bfd_arch_we32k,     /* AT&T WE32xxx */
126fddef416Sniklas  bfd_arch_tahoe,     /* CCI/Harris Tahoe */
127fddef416Sniklas  bfd_arch_i860,      /* Intel 860 */
128f7cc78ecSespie  bfd_arch_i370,      /* IBM 360/370 Mainframes */
129fddef416Sniklas  bfd_arch_romp,      /* IBM ROMP PC/RT */
130fddef416Sniklas  bfd_arch_alliant,   /* Alliant */
131fddef416Sniklas  bfd_arch_convex,    /* Convex */
132fddef416Sniklas  bfd_arch_m88k,      /* Motorola 88xxx */
133d2201f2fSdrahn  bfd_arch_m98k,      /* Motorola 98xxx */
134fddef416Sniklas  bfd_arch_pyramid,   /* Pyramid Technology */
135d2201f2fSdrahn  bfd_arch_h8300,     /* Renesas H8/300 (formerly Hitachi H8/300) */
136fddef416Sniklas#define bfd_mach_h8300    1
137fddef416Sniklas#define bfd_mach_h8300h   2
138fddef416Sniklas#define bfd_mach_h8300s   3
139d2201f2fSdrahn#define bfd_mach_h8300hn  4
140d2201f2fSdrahn#define bfd_mach_h8300sn  5
141*cf2f2c56Smiod#define bfd_mach_h8300sx  6
142*cf2f2c56Smiod#define bfd_mach_h8300sxn 7
143d2201f2fSdrahn  bfd_arch_pdp11,     /* DEC PDP-11 */
144fddef416Sniklas  bfd_arch_powerpc,   /* PowerPC */
145d2201f2fSdrahn#define bfd_mach_ppc           32
146d2201f2fSdrahn#define bfd_mach_ppc64         64
1475f210c2aSfgsch#define bfd_mach_ppc_403       403
1485f210c2aSfgsch#define bfd_mach_ppc_403gc     4030
1495f210c2aSfgsch#define bfd_mach_ppc_505       505
1505f210c2aSfgsch#define bfd_mach_ppc_601       601
1515f210c2aSfgsch#define bfd_mach_ppc_602       602
1525f210c2aSfgsch#define bfd_mach_ppc_603       603
1535f210c2aSfgsch#define bfd_mach_ppc_ec603e    6031
1545f210c2aSfgsch#define bfd_mach_ppc_604       604
1555f210c2aSfgsch#define bfd_mach_ppc_620       620
1565f210c2aSfgsch#define bfd_mach_ppc_630       630
1575f210c2aSfgsch#define bfd_mach_ppc_750       750
1585f210c2aSfgsch#define bfd_mach_ppc_860       860
1595f210c2aSfgsch#define bfd_mach_ppc_a35       35
1605f210c2aSfgsch#define bfd_mach_ppc_rs64ii    642
1615f210c2aSfgsch#define bfd_mach_ppc_rs64iii   643
1625f210c2aSfgsch#define bfd_mach_ppc_7400      7400
163d2201f2fSdrahn#define bfd_mach_ppc_e500      500
164fddef416Sniklas  bfd_arch_rs6000,    /* IBM RS/6000 */
165d2201f2fSdrahn#define bfd_mach_rs6k          6000
1665f210c2aSfgsch#define bfd_mach_rs6k_rs1      6001
1675f210c2aSfgsch#define bfd_mach_rs6k_rsc      6003
1685f210c2aSfgsch#define bfd_mach_rs6k_rs2      6002
169fddef416Sniklas  bfd_arch_hppa,      /* HP PA RISC */
170*cf2f2c56Smiod#define bfd_mach_hppa10        10
171*cf2f2c56Smiod#define bfd_mach_hppa11        11
172*cf2f2c56Smiod#define bfd_mach_hppa20        20
173*cf2f2c56Smiod#define bfd_mach_hppa20w       25
174fddef416Sniklas  bfd_arch_d10v,      /* Mitsubishi D10V */
175d2201f2fSdrahn#define bfd_mach_d10v          1
176f7cc78ecSespie#define bfd_mach_d10v_ts2      2
177f7cc78ecSespie#define bfd_mach_d10v_ts3      3
178f7cc78ecSespie  bfd_arch_d30v,      /* Mitsubishi D30V */
179d2201f2fSdrahn  bfd_arch_dlx,       /* DLX */
1805f210c2aSfgsch  bfd_arch_m68hc11,   /* Motorola 68HC11 */
1815f210c2aSfgsch  bfd_arch_m68hc12,   /* Motorola 68HC12 */
182d2201f2fSdrahn#define bfd_mach_m6812_default 0
183d2201f2fSdrahn#define bfd_mach_m6812         1
184d2201f2fSdrahn#define bfd_mach_m6812s        2
185fddef416Sniklas  bfd_arch_z8k,       /* Zilog Z8000 */
186fddef416Sniklas#define bfd_mach_z8001         1
187fddef416Sniklas#define bfd_mach_z8002         2
188d2201f2fSdrahn  bfd_arch_h8500,     /* Renesas H8/500 (formerly Hitachi H8/500) */
189d2201f2fSdrahn  bfd_arch_sh,        /* Renesas / SuperH SH (formerly Hitachi SH) */
190d2201f2fSdrahn#define bfd_mach_sh            1
191f7cc78ecSespie#define bfd_mach_sh2        0x20
192f7cc78ecSespie#define bfd_mach_sh_dsp     0x2d
193d2201f2fSdrahn#define bfd_mach_sh2e       0x2e
194f7cc78ecSespie#define bfd_mach_sh3        0x30
195f7cc78ecSespie#define bfd_mach_sh3_dsp    0x3d
196f7cc78ecSespie#define bfd_mach_sh3e       0x3e
197f7cc78ecSespie#define bfd_mach_sh4        0x40
198*cf2f2c56Smiod#define bfd_mach_sh4_nofpu  0x41
199*cf2f2c56Smiod#define bfd_mach_sh4a       0x4a
200*cf2f2c56Smiod#define bfd_mach_sh4a_nofpu 0x4b
201*cf2f2c56Smiod#define bfd_mach_sh4al_dsp  0x4d
202d2201f2fSdrahn#define bfd_mach_sh5        0x50
203fddef416Sniklas  bfd_arch_alpha,     /* Dec Alpha */
204f7cc78ecSespie#define bfd_mach_alpha_ev4  0x10
205f7cc78ecSespie#define bfd_mach_alpha_ev5  0x20
206f7cc78ecSespie#define bfd_mach_alpha_ev6  0x30
207d2201f2fSdrahn  bfd_arch_arm,       /* Advanced Risc Machines ARM.  */
208d2201f2fSdrahn#define bfd_mach_arm_unknown   0
209f7cc78ecSespie#define bfd_mach_arm_2         1
210f7cc78ecSespie#define bfd_mach_arm_2a        2
211f7cc78ecSespie#define bfd_mach_arm_3         3
212f7cc78ecSespie#define bfd_mach_arm_3M        4
213f7cc78ecSespie#define bfd_mach_arm_4         5
214f7cc78ecSespie#define bfd_mach_arm_4T        6
215f7cc78ecSespie#define bfd_mach_arm_5         7
216f7cc78ecSespie#define bfd_mach_arm_5T        8
2175f210c2aSfgsch#define bfd_mach_arm_5TE       9
2185f210c2aSfgsch#define bfd_mach_arm_XScale    10
219d2201f2fSdrahn#define bfd_mach_arm_ep9312    11
220d2201f2fSdrahn#define bfd_mach_arm_iWMMXt    12
221fddef416Sniklas  bfd_arch_ns32k,     /* National Semiconductors ns32000 */
222fddef416Sniklas  bfd_arch_w65,       /* WDC 65816 */
223f7cc78ecSespie  bfd_arch_tic30,     /* Texas Instruments TMS320C30 */
224d2201f2fSdrahn  bfd_arch_tic4x,     /* Texas Instruments TMS320C3X/4X */
225d2201f2fSdrahn#define bfd_mach_tic3x         30
226d2201f2fSdrahn#define bfd_mach_tic4x         40
2275f210c2aSfgsch  bfd_arch_tic54x,    /* Texas Instruments TMS320C54X */
228f7cc78ecSespie  bfd_arch_tic80,     /* TI TMS320c80 (MVP) */
229f7cc78ecSespie  bfd_arch_v850,      /* NEC V850 */
230d2201f2fSdrahn#define bfd_mach_v850          1
231f7cc78ecSespie#define bfd_mach_v850e         'E'
232*cf2f2c56Smiod#define bfd_mach_v850e1        '1'
2335f210c2aSfgsch  bfd_arch_arc,       /* ARC Cores */
234d2201f2fSdrahn#define bfd_mach_arc_5         5
235d2201f2fSdrahn#define bfd_mach_arc_6         6
236d2201f2fSdrahn#define bfd_mach_arc_7         7
237d2201f2fSdrahn#define bfd_mach_arc_8         8
238d2201f2fSdrahn  bfd_arch_m32r,      /* Renesas M32R (formerly Mitsubishi M32R/D) */
239d2201f2fSdrahn#define bfd_mach_m32r          1 /* For backwards compatibility.  */
240f7cc78ecSespie#define bfd_mach_m32rx         'x'
241*cf2f2c56Smiod#define bfd_mach_m32r2         '2'
242fddef416Sniklas  bfd_arch_mn10200,   /* Matsushita MN10200 */
243fddef416Sniklas  bfd_arch_mn10300,   /* Matsushita MN10300 */
244f7cc78ecSespie#define bfd_mach_mn10300               300
245f7cc78ecSespie#define bfd_mach_am33          330
246*cf2f2c56Smiod#define bfd_mach_am33_2        332
247f7cc78ecSespie  bfd_arch_fr30,
248f7cc78ecSespie#define bfd_mach_fr30          0x46523330
249d2201f2fSdrahn  bfd_arch_frv,
250d2201f2fSdrahn#define bfd_mach_frv           1
251d2201f2fSdrahn#define bfd_mach_frvsimple     2
252d2201f2fSdrahn#define bfd_mach_fr300         300
253d2201f2fSdrahn#define bfd_mach_fr400         400
254d2201f2fSdrahn#define bfd_mach_frvtomcat     499     /* fr500 prototype */
255d2201f2fSdrahn#define bfd_mach_fr500         500
256*cf2f2c56Smiod#define bfd_mach_fr550         550
257f7cc78ecSespie  bfd_arch_mcore,
2585f210c2aSfgsch  bfd_arch_ia64,      /* HP/Intel ia64 */
259d2201f2fSdrahn#define bfd_mach_ia64_elf64    64
260d2201f2fSdrahn#define bfd_mach_ia64_elf32    32
261d2201f2fSdrahn  bfd_arch_ip2k,      /* Ubicom IP2K microcontrollers. */
262d2201f2fSdrahn#define bfd_mach_ip2022        1
263d2201f2fSdrahn#define bfd_mach_ip2022ext     2
264d2201f2fSdrahn bfd_arch_iq2000,     /* Vitesse IQ2000.  */
265d2201f2fSdrahn#define bfd_mach_iq2000        1
266d2201f2fSdrahn#define bfd_mach_iq10          2
267f7cc78ecSespie  bfd_arch_pj,
268d2201f2fSdrahn  bfd_arch_avr,       /* Atmel AVR microcontrollers.  */
269f7cc78ecSespie#define bfd_mach_avr1          1
270f7cc78ecSespie#define bfd_mach_avr2          2
271f7cc78ecSespie#define bfd_mach_avr3          3
272f7cc78ecSespie#define bfd_mach_avr4          4
2735f210c2aSfgsch#define bfd_mach_avr5          5
2745f210c2aSfgsch  bfd_arch_cris,      /* Axis CRIS */
275d2201f2fSdrahn  bfd_arch_s390,      /* IBM s390 */
276d2201f2fSdrahn#define bfd_mach_s390_31       31
277d2201f2fSdrahn#define bfd_mach_s390_64       64
278d2201f2fSdrahn  bfd_arch_openrisc,  /* OpenRISC */
279d2201f2fSdrahn  bfd_arch_mmix,      /* Donald Knuth's educational processor.  */
280d2201f2fSdrahn  bfd_arch_xstormy16,
281d2201f2fSdrahn#define bfd_mach_xstormy16     1
282d2201f2fSdrahn  bfd_arch_msp430,    /* Texas Instruments MSP430 architecture.  */
283d2201f2fSdrahn#define bfd_mach_msp11          11
284*cf2f2c56Smiod#define bfd_mach_msp110         110
285d2201f2fSdrahn#define bfd_mach_msp12          12
286d2201f2fSdrahn#define bfd_mach_msp13          13
287d2201f2fSdrahn#define bfd_mach_msp14          14
288*cf2f2c56Smiod#define bfd_mach_msp15          15
289*cf2f2c56Smiod#define bfd_mach_msp16          16
290d2201f2fSdrahn#define bfd_mach_msp31          31
291d2201f2fSdrahn#define bfd_mach_msp32          32
292d2201f2fSdrahn#define bfd_mach_msp33          33
293*cf2f2c56Smiod#define bfd_mach_msp41          41
294*cf2f2c56Smiod#define bfd_mach_msp42          42
295d2201f2fSdrahn#define bfd_mach_msp43          43
296d2201f2fSdrahn#define bfd_mach_msp44          44
297d2201f2fSdrahn  bfd_arch_xtensa,    /* Tensilica's Xtensa cores.  */
298d2201f2fSdrahn#define bfd_mach_xtensa        1
299fddef416Sniklas  bfd_arch_last
300fddef416Sniklas  @};
301fddef416Sniklas@end example
302f7cc78ecSespie
303fddef416Sniklas@subsection bfd_arch_info
304fddef416Sniklas
305f7cc78ecSespie
306fddef416Sniklas@strong{Description}@*
307fddef416SniklasThis structure contains information on architectures for use
308fddef416Sniklaswithin BFD.
309fddef416Sniklas@example
310fddef416Sniklas
311fddef416Sniklastypedef struct bfd_arch_info
312fddef416Sniklas@{
313fddef416Sniklas  int bits_per_word;
314fddef416Sniklas  int bits_per_address;
315fddef416Sniklas  int bits_per_byte;
316fddef416Sniklas  enum bfd_architecture arch;
317fddef416Sniklas  unsigned long mach;
318fddef416Sniklas  const char *arch_name;
319fddef416Sniklas  const char *printable_name;
320fddef416Sniklas  unsigned int section_align_power;
321d2201f2fSdrahn  /* TRUE if this is the default machine for the architecture.
322d2201f2fSdrahn     The default arch should be the first entry for an arch so that
323d2201f2fSdrahn     all the entries for that arch can be accessed via @code{next}.  */
324d2201f2fSdrahn  bfd_boolean the_default;
325fddef416Sniklas  const struct bfd_arch_info * (*compatible)
326*cf2f2c56Smiod    (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
327fddef416Sniklas
328*cf2f2c56Smiod  bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
329fddef416Sniklas
330fddef416Sniklas  const struct bfd_arch_info *next;
331d2201f2fSdrahn@}
332d2201f2fSdrahnbfd_arch_info_type;
333d2201f2fSdrahn
334fddef416Sniklas@end example
335f7cc78ecSespie
336fddef416Sniklas@findex bfd_printable_name
337fddef416Sniklas@subsubsection @code{bfd_printable_name}
338fddef416Sniklas@strong{Synopsis}
339fddef416Sniklas@example
340fddef416Sniklasconst char *bfd_printable_name (bfd *abfd);
341fddef416Sniklas@end example
342fddef416Sniklas@strong{Description}@*
343fddef416SniklasReturn a printable string representing the architecture and machine
344fddef416Sniklasfrom the pointer to the architecture info structure.
345f7cc78ecSespie
346fddef416Sniklas@findex bfd_scan_arch
347fddef416Sniklas@subsubsection @code{bfd_scan_arch}
348fddef416Sniklas@strong{Synopsis}
349fddef416Sniklas@example
350fddef416Sniklasconst bfd_arch_info_type *bfd_scan_arch (const char *string);
351fddef416Sniklas@end example
352fddef416Sniklas@strong{Description}@*
353fddef416SniklasFigure out if BFD supports any cpu which could be described with
354fddef416Sniklasthe name @var{string}.  Return a pointer to an @code{arch_info}
355fddef416Sniklasstructure if a machine is found, otherwise NULL.
356f7cc78ecSespie
357f7cc78ecSespie@findex bfd_arch_list
358f7cc78ecSespie@subsubsection @code{bfd_arch_list}
359f7cc78ecSespie@strong{Synopsis}
360f7cc78ecSespie@example
361f7cc78ecSespieconst char **bfd_arch_list (void);
362f7cc78ecSespie@end example
363f7cc78ecSespie@strong{Description}@*
364f7cc78ecSespieReturn a freshly malloced NULL-terminated vector of the names
365f7cc78ecSespieof all the valid BFD architectures.  Do not modify the names.
366f7cc78ecSespie
367fddef416Sniklas@findex bfd_arch_get_compatible
368fddef416Sniklas@subsubsection @code{bfd_arch_get_compatible}
369fddef416Sniklas@strong{Synopsis}
370fddef416Sniklas@example
371*cf2f2c56Smiodconst bfd_arch_info_type *bfd_arch_get_compatible
372*cf2f2c56Smiod   (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
373fddef416Sniklas@end example
374fddef416Sniklas@strong{Description}@*
375d2201f2fSdrahnDetermine whether two BFDs' architectures and machine types
376d2201f2fSdrahnare compatible.  Calculates the lowest common denominator
377d2201f2fSdrahnbetween the two architectures and machine types implied by
378d2201f2fSdrahnthe BFDs and returns a pointer to an @code{arch_info} structure
379d2201f2fSdrahndescribing the compatible machine.
380f7cc78ecSespie
381fddef416Sniklas@findex bfd_default_arch_struct
382fddef416Sniklas@subsubsection @code{bfd_default_arch_struct}
383fddef416Sniklas@strong{Description}@*
384fddef416SniklasThe @code{bfd_default_arch_struct} is an item of
385fddef416Sniklas@code{bfd_arch_info_type} which has been initialized to a fairly
386fddef416Sniklasgeneric state.  A BFD starts life by pointing to this
387fddef416Sniklasstructure, until the correct back end has determined the real
388fddef416Sniklasarchitecture of the file.
389fddef416Sniklas@example
390fddef416Sniklasextern const bfd_arch_info_type bfd_default_arch_struct;
391fddef416Sniklas@end example
392f7cc78ecSespie
393fddef416Sniklas@findex bfd_set_arch_info
394fddef416Sniklas@subsubsection @code{bfd_set_arch_info}
395fddef416Sniklas@strong{Synopsis}
396fddef416Sniklas@example
397fddef416Sniklasvoid bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
398fddef416Sniklas@end example
399fddef416Sniklas@strong{Description}@*
400fddef416SniklasSet the architecture info of @var{abfd} to @var{arg}.
401f7cc78ecSespie
402fddef416Sniklas@findex bfd_default_set_arch_mach
403fddef416Sniklas@subsubsection @code{bfd_default_set_arch_mach}
404fddef416Sniklas@strong{Synopsis}
405fddef416Sniklas@example
406*cf2f2c56Smiodbfd_boolean bfd_default_set_arch_mach
407*cf2f2c56Smiod   (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
408fddef416Sniklas@end example
409fddef416Sniklas@strong{Description}@*
410fddef416SniklasSet the architecture and machine type in BFD @var{abfd}
411fddef416Sniklasto @var{arch} and @var{mach}.  Find the correct
412fddef416Sniklaspointer to a structure and insert it into the @code{arch_info}
413fddef416Sniklaspointer.
414f7cc78ecSespie
415fddef416Sniklas@findex bfd_get_arch
416fddef416Sniklas@subsubsection @code{bfd_get_arch}
417fddef416Sniklas@strong{Synopsis}
418fddef416Sniklas@example
419fddef416Sniklasenum bfd_architecture bfd_get_arch (bfd *abfd);
420fddef416Sniklas@end example
421fddef416Sniklas@strong{Description}@*
422fddef416SniklasReturn the enumerated type which describes the BFD @var{abfd}'s
423fddef416Sniklasarchitecture.
424f7cc78ecSespie
425fddef416Sniklas@findex bfd_get_mach
426fddef416Sniklas@subsubsection @code{bfd_get_mach}
427fddef416Sniklas@strong{Synopsis}
428fddef416Sniklas@example
429fddef416Sniklasunsigned long bfd_get_mach (bfd *abfd);
430fddef416Sniklas@end example
431fddef416Sniklas@strong{Description}@*
432fddef416SniklasReturn the long type which describes the BFD @var{abfd}'s
433fddef416Sniklasmachine.
434f7cc78ecSespie
435fddef416Sniklas@findex bfd_arch_bits_per_byte
436fddef416Sniklas@subsubsection @code{bfd_arch_bits_per_byte}
437fddef416Sniklas@strong{Synopsis}
438fddef416Sniklas@example
439fddef416Sniklasunsigned int bfd_arch_bits_per_byte (bfd *abfd);
440fddef416Sniklas@end example
441fddef416Sniklas@strong{Description}@*
442fddef416SniklasReturn the number of bits in one of the BFD @var{abfd}'s
443fddef416Sniklasarchitecture's bytes.
444f7cc78ecSespie
445fddef416Sniklas@findex bfd_arch_bits_per_address
446fddef416Sniklas@subsubsection @code{bfd_arch_bits_per_address}
447fddef416Sniklas@strong{Synopsis}
448fddef416Sniklas@example
449fddef416Sniklasunsigned int bfd_arch_bits_per_address (bfd *abfd);
450fddef416Sniklas@end example
451fddef416Sniklas@strong{Description}@*
452fddef416SniklasReturn the number of bits in one of the BFD @var{abfd}'s
453fddef416Sniklasarchitecture's addresses.
454f7cc78ecSespie
455fddef416Sniklas@findex bfd_default_compatible
456fddef416Sniklas@subsubsection @code{bfd_default_compatible}
457fddef416Sniklas@strong{Synopsis}
458fddef416Sniklas@example
459fddef416Sniklasconst bfd_arch_info_type *bfd_default_compatible
460*cf2f2c56Smiod   (const bfd_arch_info_type *a, const bfd_arch_info_type *b);
461fddef416Sniklas@end example
462fddef416Sniklas@strong{Description}@*
463fddef416SniklasThe default function for testing for compatibility.
464f7cc78ecSespie
465fddef416Sniklas@findex bfd_default_scan
466fddef416Sniklas@subsubsection @code{bfd_default_scan}
467fddef416Sniklas@strong{Synopsis}
468fddef416Sniklas@example
469*cf2f2c56Smiodbfd_boolean bfd_default_scan
470*cf2f2c56Smiod   (const struct bfd_arch_info *info, const char *string);
471fddef416Sniklas@end example
472fddef416Sniklas@strong{Description}@*
473fddef416SniklasThe default function for working out whether this is an
474fddef416Sniklasarchitecture hit and a machine hit.
475f7cc78ecSespie
476fddef416Sniklas@findex bfd_get_arch_info
477fddef416Sniklas@subsubsection @code{bfd_get_arch_info}
478fddef416Sniklas@strong{Synopsis}
479fddef416Sniklas@example
480fddef416Sniklasconst bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
481fddef416Sniklas@end example
482fddef416Sniklas@strong{Description}@*
483fddef416SniklasReturn the architecture info struct in @var{abfd}.
484f7cc78ecSespie
485fddef416Sniklas@findex bfd_lookup_arch
486fddef416Sniklas@subsubsection @code{bfd_lookup_arch}
487fddef416Sniklas@strong{Synopsis}
488fddef416Sniklas@example
489fddef416Sniklasconst bfd_arch_info_type *bfd_lookup_arch
490*cf2f2c56Smiod   (enum bfd_architecture arch, unsigned long machine);
491fddef416Sniklas@end example
492fddef416Sniklas@strong{Description}@*
493*cf2f2c56SmiodLook for the architecture info structure which matches the
494fddef416Sniklasarguments @var{arch} and @var{machine}. A machine of 0 matches the
495fddef416Sniklasmachine/architecture structure which marks itself as the
496fddef416Sniklasdefault.
497f7cc78ecSespie
498fddef416Sniklas@findex bfd_printable_arch_mach
499fddef416Sniklas@subsubsection @code{bfd_printable_arch_mach}
500fddef416Sniklas@strong{Synopsis}
501fddef416Sniklas@example
502fddef416Sniklasconst char *bfd_printable_arch_mach
503fddef416Sniklas   (enum bfd_architecture arch, unsigned long machine);
504fddef416Sniklas@end example
505fddef416Sniklas@strong{Description}@*
506fddef416SniklasReturn a printable string representing the architecture and
507fddef416Sniklasmachine type.
508fddef416Sniklas
509fddef416SniklasThis routine is depreciated.
510f7cc78ecSespie
511f7cc78ecSespie@findex bfd_octets_per_byte
512f7cc78ecSespie@subsubsection @code{bfd_octets_per_byte}
513f7cc78ecSespie@strong{Synopsis}
514f7cc78ecSespie@example
515f7cc78ecSespieunsigned int bfd_octets_per_byte (bfd *abfd);
516f7cc78ecSespie@end example
517f7cc78ecSespie@strong{Description}@*
518f7cc78ecSespieReturn the number of octets (8-bit quantities) per target byte
519f7cc78ecSespie(minimum addressable unit).  In most cases, this will be one, but some
520f7cc78ecSespieDSP targets have 16, 32, or even 48 bits per byte.
521f7cc78ecSespie
522f7cc78ecSespie@findex bfd_arch_mach_octets_per_byte
523f7cc78ecSespie@subsubsection @code{bfd_arch_mach_octets_per_byte}
524f7cc78ecSespie@strong{Synopsis}
525f7cc78ecSespie@example
526*cf2f2c56Smiodunsigned int bfd_arch_mach_octets_per_byte
527*cf2f2c56Smiod   (enum bfd_architecture arch, unsigned long machine);
528f7cc78ecSespie@end example
529f7cc78ecSespie@strong{Description}@*
530f7cc78ecSespieSee bfd_octets_per_byte.
5315f210c2aSfgsch
532f7cc78ecSespieThis routine is provided for those cases where a bfd * is not
533f7cc78ecSespieavailable
534f7cc78ecSespie
535