Add generated files.
[platform/upstream/binutils.git] / bfd / doc / archures.texi
1 @section Architectures
2 BFD keeps one atom in a BFD describing the
3 architecture of the data attached to the BFD: a pointer to a
4 @code{bfd_arch_info_type}.
5
6 Pointers to structures can be requested independently of a BFD
7 so that an architecture's information can be interrogated
8 without access to an open BFD.
9
10 The architecture information is provided by each architecture package.
11 The set of default architectures is selected by the macro
12 @code{SELECT_ARCHITECTURES}.  This is normally set up in the
13 @file{config/@var{target}.mt} file of your choice.  If the name is not
14 defined, then all the architectures supported are included.
15
16 When BFD starts up, all the architectures are called with an
17 initialize method.  It is up to the architecture back end to
18 insert as many items into the list of architectures as it wants to;
19 generally this would be one for each machine and one for the
20 default case (an item with a machine field of 0).
21
22 BFD's idea of an architecture is implemented in @file{archures.c}.
23
24 @subsection bfd_architecture
25
26
27 @strong{Description}@*
28 This enum gives the object file's CPU architecture, in a
29 global sense---i.e., what processor family does it belong to?
30 Another field indicates which processor within
31 the family is in use.  The machine gives a number which
32 distinguishes different versions of the architecture,
33 containing, for example, 2 and 3 for Intel i960 KA and i960 KB,
34 and 68020 and 68030 for Motorola 68020 and 68030.
35 @example
36 enum bfd_architecture
37 @{
38   bfd_arch_unknown,   /* File arch not known.  */
39   bfd_arch_obscure,   /* Arch known, not one of these.  */
40   bfd_arch_m68k,      /* Motorola 68xxx */
41 #define bfd_mach_m68000 1
42 #define bfd_mach_m68008 2
43 #define bfd_mach_m68010 3
44 #define bfd_mach_m68020 4
45 #define bfd_mach_m68030 5
46 #define bfd_mach_m68040 6
47 #define bfd_mach_m68060 7
48 #define bfd_mach_cpu32  8
49 #define bfd_mach_fido   9
50 #define bfd_mach_mcf_isa_a_nodiv 10
51 #define bfd_mach_mcf_isa_a 11
52 #define bfd_mach_mcf_isa_a_mac 12
53 #define bfd_mach_mcf_isa_a_emac 13
54 #define bfd_mach_mcf_isa_aplus 14
55 #define bfd_mach_mcf_isa_aplus_mac 15
56 #define bfd_mach_mcf_isa_aplus_emac 16
57 #define bfd_mach_mcf_isa_b_nousp 17
58 #define bfd_mach_mcf_isa_b_nousp_mac 18
59 #define bfd_mach_mcf_isa_b_nousp_emac 19
60 #define bfd_mach_mcf_isa_b 20
61 #define bfd_mach_mcf_isa_b_mac 21
62 #define bfd_mach_mcf_isa_b_emac 22
63 #define bfd_mach_mcf_isa_b_float 23
64 #define bfd_mach_mcf_isa_b_float_mac 24
65 #define bfd_mach_mcf_isa_b_float_emac 25
66 #define bfd_mach_mcf_isa_c 26
67 #define bfd_mach_mcf_isa_c_mac 27
68 #define bfd_mach_mcf_isa_c_emac 28
69 #define bfd_mach_mcf_isa_c_nodiv 29
70 #define bfd_mach_mcf_isa_c_nodiv_mac 30
71 #define bfd_mach_mcf_isa_c_nodiv_emac 31
72   bfd_arch_vax,       /* DEC Vax */
73   bfd_arch_i960,      /* Intel 960 */
74     /* The order of the following is important.
75        lower number indicates a machine type that
76        only accepts a subset of the instructions
77        available to machines with higher numbers.
78        The exception is the "ca", which is
79        incompatible with all other machines except
80        "core".  */
81
82 #define bfd_mach_i960_core      1
83 #define bfd_mach_i960_ka_sa     2
84 #define bfd_mach_i960_kb_sb     3
85 #define bfd_mach_i960_mc        4
86 #define bfd_mach_i960_xa        5
87 #define bfd_mach_i960_ca        6
88 #define bfd_mach_i960_jx        7
89 #define bfd_mach_i960_hx        8
90
91   bfd_arch_or1k,      /* OpenRISC 1000 */
92 #define bfd_mach_or1k           1
93 #define bfd_mach_or1knd         2
94
95   bfd_arch_sparc,     /* SPARC */
96 #define bfd_mach_sparc                 1
97 /* The difference between v8plus and v9 is that v9 is a true 64 bit env.  */
98 #define bfd_mach_sparc_sparclet        2
99 #define bfd_mach_sparc_sparclite       3
100 #define bfd_mach_sparc_v8plus          4
101 #define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns.  */
102 #define bfd_mach_sparc_sparclite_le    6
103 #define bfd_mach_sparc_v9              7
104 #define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns.  */
105 #define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns.  */
106 #define bfd_mach_sparc_v9b             10 /* with cheetah add'ns.  */
107 /* Nonzero if MACH has the v9 instruction set.  */
108 #define bfd_mach_sparc_v9_p(mach) \
109   ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
110    && (mach) != bfd_mach_sparc_sparclite_le)
111 /* Nonzero if MACH is a 64 bit sparc architecture.  */
112 #define bfd_mach_sparc_64bit_p(mach) \
113   ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
114   bfd_arch_spu,       /* PowerPC SPU */
115 #define bfd_mach_spu           256
116   bfd_arch_mips,      /* MIPS Rxxxx */
117 #define bfd_mach_mips3000              3000
118 #define bfd_mach_mips3900              3900
119 #define bfd_mach_mips4000              4000
120 #define bfd_mach_mips4010              4010
121 #define bfd_mach_mips4100              4100
122 #define bfd_mach_mips4111              4111
123 #define bfd_mach_mips4120              4120
124 #define bfd_mach_mips4300              4300
125 #define bfd_mach_mips4400              4400
126 #define bfd_mach_mips4600              4600
127 #define bfd_mach_mips4650              4650
128 #define bfd_mach_mips5000              5000
129 #define bfd_mach_mips5400              5400
130 #define bfd_mach_mips5500              5500
131 #define bfd_mach_mips5900              5900
132 #define bfd_mach_mips6000              6000
133 #define bfd_mach_mips7000              7000
134 #define bfd_mach_mips8000              8000
135 #define bfd_mach_mips9000              9000
136 #define bfd_mach_mips10000             10000
137 #define bfd_mach_mips12000             12000
138 #define bfd_mach_mips14000             14000
139 #define bfd_mach_mips16000             16000
140 #define bfd_mach_mips16                16
141 #define bfd_mach_mips5                 5
142 #define bfd_mach_mips_loongson_2e      3001
143 #define bfd_mach_mips_loongson_2f      3002
144 #define bfd_mach_mips_loongson_3a      3003
145 #define bfd_mach_mips_sb1              12310201 /* octal 'SB', 01 */
146 #define bfd_mach_mips_octeon           6501
147 #define bfd_mach_mips_octeonp          6601
148 #define bfd_mach_mips_octeon2          6502
149 #define bfd_mach_mips_xlr              887682   /* decimal 'XLR'  */
150 #define bfd_mach_mipsisa32             32
151 #define bfd_mach_mipsisa32r2           33
152 #define bfd_mach_mipsisa32r3           34
153 #define bfd_mach_mipsisa32r5           36
154 #define bfd_mach_mipsisa32r6           37
155 #define bfd_mach_mipsisa64             64
156 #define bfd_mach_mipsisa64r2           65
157 #define bfd_mach_mipsisa64r3           66
158 #define bfd_mach_mipsisa64r5           68
159 #define bfd_mach_mipsisa64r6           69
160 #define bfd_mach_mips_micromips        96
161   bfd_arch_i386,      /* Intel 386 */
162 #define bfd_mach_i386_intel_syntax     (1 << 0)
163 #define bfd_mach_i386_i8086            (1 << 1)
164 #define bfd_mach_i386_i386             (1 << 2)
165 #define bfd_mach_x86_64                (1 << 3)
166 #define bfd_mach_x64_32                (1 << 4)
167 #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
168 #define bfd_mach_x86_64_intel_syntax   (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
169 #define bfd_mach_x64_32_intel_syntax   (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
170   bfd_arch_l1om,   /* Intel L1OM */
171 #define bfd_mach_l1om                  (1 << 5)
172 #define bfd_mach_l1om_intel_syntax     (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
173   bfd_arch_k1om,   /* Intel K1OM */
174 #define bfd_mach_k1om                  (1 << 6)
175 #define bfd_mach_k1om_intel_syntax     (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
176 #define bfd_mach_i386_nacl             (1 << 7)
177 #define bfd_mach_i386_i386_nacl        (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
178 #define bfd_mach_x86_64_nacl           (bfd_mach_x86_64 | bfd_mach_i386_nacl)
179 #define bfd_mach_x64_32_nacl           (bfd_mach_x64_32 | bfd_mach_i386_nacl)
180   bfd_arch_we32k,     /* AT&T WE32xxx */
181   bfd_arch_tahoe,     /* CCI/Harris Tahoe */
182   bfd_arch_i860,      /* Intel 860 */
183   bfd_arch_i370,      /* IBM 360/370 Mainframes */
184   bfd_arch_romp,      /* IBM ROMP PC/RT */
185   bfd_arch_convex,    /* Convex */
186   bfd_arch_m88k,      /* Motorola 88xxx */
187   bfd_arch_m98k,      /* Motorola 98xxx */
188   bfd_arch_pyramid,   /* Pyramid Technology */
189   bfd_arch_h8300,     /* Renesas H8/300 (formerly Hitachi H8/300) */
190 #define bfd_mach_h8300    1
191 #define bfd_mach_h8300h   2
192 #define bfd_mach_h8300s   3
193 #define bfd_mach_h8300hn  4
194 #define bfd_mach_h8300sn  5
195 #define bfd_mach_h8300sx  6
196 #define bfd_mach_h8300sxn 7
197   bfd_arch_pdp11,     /* DEC PDP-11 */
198   bfd_arch_plugin,
199   bfd_arch_powerpc,   /* PowerPC */
200 #define bfd_mach_ppc           32
201 #define bfd_mach_ppc64         64
202 #define bfd_mach_ppc_403       403
203 #define bfd_mach_ppc_403gc     4030
204 #define bfd_mach_ppc_405       405
205 #define bfd_mach_ppc_505       505
206 #define bfd_mach_ppc_601       601
207 #define bfd_mach_ppc_602       602
208 #define bfd_mach_ppc_603       603
209 #define bfd_mach_ppc_ec603e    6031
210 #define bfd_mach_ppc_604       604
211 #define bfd_mach_ppc_620       620
212 #define bfd_mach_ppc_630       630
213 #define bfd_mach_ppc_750       750
214 #define bfd_mach_ppc_860       860
215 #define bfd_mach_ppc_a35       35
216 #define bfd_mach_ppc_rs64ii    642
217 #define bfd_mach_ppc_rs64iii   643
218 #define bfd_mach_ppc_7400      7400
219 #define bfd_mach_ppc_e500      500
220 #define bfd_mach_ppc_e500mc    5001
221 #define bfd_mach_ppc_e500mc64  5005
222 #define bfd_mach_ppc_e5500     5006
223 #define bfd_mach_ppc_e6500     5007
224 #define bfd_mach_ppc_titan     83
225 #define bfd_mach_ppc_vle       84
226   bfd_arch_rs6000,    /* IBM RS/6000 */
227 #define bfd_mach_rs6k          6000
228 #define bfd_mach_rs6k_rs1      6001
229 #define bfd_mach_rs6k_rsc      6003
230 #define bfd_mach_rs6k_rs2      6002
231   bfd_arch_hppa,      /* HP PA RISC */
232 #define bfd_mach_hppa10        10
233 #define bfd_mach_hppa11        11
234 #define bfd_mach_hppa20        20
235 #define bfd_mach_hppa20w       25
236   bfd_arch_d10v,      /* Mitsubishi D10V */
237 #define bfd_mach_d10v          1
238 #define bfd_mach_d10v_ts2      2
239 #define bfd_mach_d10v_ts3      3
240   bfd_arch_d30v,      /* Mitsubishi D30V */
241   bfd_arch_dlx,       /* DLX */
242   bfd_arch_m68hc11,   /* Motorola 68HC11 */
243   bfd_arch_m68hc12,   /* Motorola 68HC12 */
244 #define bfd_mach_m6812_default 0
245 #define bfd_mach_m6812         1
246 #define bfd_mach_m6812s        2
247   bfd_arch_m9s12x,   /* Freescale S12X */
248   bfd_arch_m9s12xg,  /* Freescale XGATE */
249   bfd_arch_z8k,       /* Zilog Z8000 */
250 #define bfd_mach_z8001         1
251 #define bfd_mach_z8002         2
252   bfd_arch_h8500,     /* Renesas H8/500 (formerly Hitachi H8/500) */
253   bfd_arch_sh,        /* Renesas / SuperH SH (formerly Hitachi SH) */
254 #define bfd_mach_sh            1
255 #define bfd_mach_sh2        0x20
256 #define bfd_mach_sh_dsp     0x2d
257 #define bfd_mach_sh2a       0x2a
258 #define bfd_mach_sh2a_nofpu 0x2b
259 #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
260 #define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
261 #define bfd_mach_sh2a_or_sh4  0x2a3
262 #define bfd_mach_sh2a_or_sh3e 0x2a4
263 #define bfd_mach_sh2e       0x2e
264 #define bfd_mach_sh3        0x30
265 #define bfd_mach_sh3_nommu  0x31
266 #define bfd_mach_sh3_dsp    0x3d
267 #define bfd_mach_sh3e       0x3e
268 #define bfd_mach_sh4        0x40
269 #define bfd_mach_sh4_nofpu  0x41
270 #define bfd_mach_sh4_nommu_nofpu  0x42
271 #define bfd_mach_sh4a       0x4a
272 #define bfd_mach_sh4a_nofpu 0x4b
273 #define bfd_mach_sh4al_dsp  0x4d
274 #define bfd_mach_sh5        0x50
275   bfd_arch_alpha,     /* Dec Alpha */
276 #define bfd_mach_alpha_ev4  0x10
277 #define bfd_mach_alpha_ev5  0x20
278 #define bfd_mach_alpha_ev6  0x30
279   bfd_arch_arm,       /* Advanced Risc Machines ARM.  */
280 #define bfd_mach_arm_unknown   0
281 #define bfd_mach_arm_2         1
282 #define bfd_mach_arm_2a        2
283 #define bfd_mach_arm_3         3
284 #define bfd_mach_arm_3M        4
285 #define bfd_mach_arm_4         5
286 #define bfd_mach_arm_4T        6
287 #define bfd_mach_arm_5         7
288 #define bfd_mach_arm_5T        8
289 #define bfd_mach_arm_5TE       9
290 #define bfd_mach_arm_XScale    10
291 #define bfd_mach_arm_ep9312    11
292 #define bfd_mach_arm_iWMMXt    12
293 #define bfd_mach_arm_iWMMXt2   13
294   bfd_arch_nds32,     /* Andes NDS32 */
295 #define bfd_mach_n1            1
296 #define bfd_mach_n1h           2
297 #define bfd_mach_n1h_v2        3
298 #define bfd_mach_n1h_v3        4
299 #define bfd_mach_n1h_v3m       5
300   bfd_arch_ns32k,     /* National Semiconductors ns32000 */
301   bfd_arch_w65,       /* WDC 65816 */
302   bfd_arch_tic30,     /* Texas Instruments TMS320C30 */
303   bfd_arch_tic4x,     /* Texas Instruments TMS320C3X/4X */
304 #define bfd_mach_tic3x         30
305 #define bfd_mach_tic4x         40
306   bfd_arch_tic54x,    /* Texas Instruments TMS320C54X */
307   bfd_arch_tic6x,     /* Texas Instruments TMS320C6X */
308   bfd_arch_tic80,     /* TI TMS320c80 (MVP) */
309   bfd_arch_v850,      /* NEC V850 */
310   bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI) */
311 #define bfd_mach_v850          1
312 #define bfd_mach_v850e         'E'
313 #define bfd_mach_v850e1        '1'
314 #define bfd_mach_v850e2        0x4532
315 #define bfd_mach_v850e2v3      0x45325633
316 #define bfd_mach_v850e3v5      0x45335635 /* ('E'|'3'|'V'|'5') */
317   bfd_arch_arc,       /* ARC Cores */
318 #define bfd_mach_arc_5         5
319 #define bfd_mach_arc_6         6
320 #define bfd_mach_arc_7         7
321 #define bfd_mach_arc_8         8
322  bfd_arch_m32c,     /* Renesas M16C/M32C.  */
323 #define bfd_mach_m16c        0x75
324 #define bfd_mach_m32c        0x78
325   bfd_arch_m32r,      /* Renesas M32R (formerly Mitsubishi M32R/D) */
326 #define bfd_mach_m32r          1 /* For backwards compatibility.  */
327 #define bfd_mach_m32rx         'x'
328 #define bfd_mach_m32r2         '2'
329   bfd_arch_mn10200,   /* Matsushita MN10200 */
330   bfd_arch_mn10300,   /* Matsushita MN10300 */
331 #define bfd_mach_mn10300               300
332 #define bfd_mach_am33          330
333 #define bfd_mach_am33_2        332
334   bfd_arch_fr30,
335 #define bfd_mach_fr30          0x46523330
336   bfd_arch_frv,
337 #define bfd_mach_frv           1
338 #define bfd_mach_frvsimple     2
339 #define bfd_mach_fr300         300
340 #define bfd_mach_fr400         400
341 #define bfd_mach_fr450         450
342 #define bfd_mach_frvtomcat     499     /* fr500 prototype */
343 #define bfd_mach_fr500         500
344 #define bfd_mach_fr550         550
345   bfd_arch_moxie,       /* The moxie processor */
346 #define bfd_mach_moxie         1
347   bfd_arch_mcore,
348   bfd_arch_mep,
349 #define bfd_mach_mep           1
350 #define bfd_mach_mep_h1        0x6831
351 #define bfd_mach_mep_c5        0x6335
352   bfd_arch_metag,
353 #define bfd_mach_metag         1
354   bfd_arch_ia64,      /* HP/Intel ia64 */
355 #define bfd_mach_ia64_elf64    64
356 #define bfd_mach_ia64_elf32    32
357   bfd_arch_ip2k,      /* Ubicom IP2K microcontrollers. */
358 #define bfd_mach_ip2022        1
359 #define bfd_mach_ip2022ext     2
360  bfd_arch_iq2000,     /* Vitesse IQ2000.  */
361 #define bfd_mach_iq2000        1
362 #define bfd_mach_iq10          2
363   bfd_arch_epiphany,   /* Adapteva EPIPHANY */
364 #define bfd_mach_epiphany16    1
365 #define bfd_mach_epiphany32    2
366   bfd_arch_mt,
367 #define bfd_mach_ms1           1
368 #define bfd_mach_mrisc2        2
369 #define bfd_mach_ms2           3
370   bfd_arch_pj,
371   bfd_arch_avr,       /* Atmel AVR microcontrollers.  */
372 #define bfd_mach_avr1          1
373 #define bfd_mach_avr2          2
374 #define bfd_mach_avr25         25
375 #define bfd_mach_avr3          3
376 #define bfd_mach_avr31         31
377 #define bfd_mach_avr35         35
378 #define bfd_mach_avr4          4
379 #define bfd_mach_avr5          5
380 #define bfd_mach_avr51         51
381 #define bfd_mach_avr6          6
382 #define bfd_mach_avrtiny   100
383 #define bfd_mach_avrxmega1 101
384 #define bfd_mach_avrxmega2 102
385 #define bfd_mach_avrxmega3 103
386 #define bfd_mach_avrxmega4 104
387 #define bfd_mach_avrxmega5 105
388 #define bfd_mach_avrxmega6 106
389 #define bfd_mach_avrxmega7 107
390   bfd_arch_bfin,        /* ADI Blackfin */
391 #define bfd_mach_bfin          1
392   bfd_arch_cr16,       /* National Semiconductor CompactRISC (ie CR16). */
393 #define bfd_mach_cr16          1
394   bfd_arch_cr16c,       /* National Semiconductor CompactRISC. */
395 #define bfd_mach_cr16c         1
396   bfd_arch_crx,       /*  National Semiconductor CRX.  */
397 #define bfd_mach_crx           1
398   bfd_arch_cris,      /* Axis CRIS */
399 #define bfd_mach_cris_v0_v10   255
400 #define bfd_mach_cris_v32      32
401 #define bfd_mach_cris_v10_v32  1032
402   bfd_arch_rl78,
403 #define bfd_mach_rl78  0x75
404   bfd_arch_rx,        /* Renesas RX.  */
405 #define bfd_mach_rx            0x75
406   bfd_arch_s390,      /* IBM s390 */
407 #define bfd_mach_s390_31       31
408 #define bfd_mach_s390_64       64
409   bfd_arch_score,     /* Sunplus score */
410 #define bfd_mach_score3         3
411 #define bfd_mach_score7         7
412   bfd_arch_mmix,      /* Donald Knuth's educational processor.  */
413   bfd_arch_xstormy16,
414 #define bfd_mach_xstormy16     1
415   bfd_arch_msp430,    /* Texas Instruments MSP430 architecture.  */
416 #define bfd_mach_msp11          11
417 #define bfd_mach_msp110         110
418 #define bfd_mach_msp12          12
419 #define bfd_mach_msp13          13
420 #define bfd_mach_msp14          14
421 #define bfd_mach_msp15          15
422 #define bfd_mach_msp16          16
423 #define bfd_mach_msp20          20
424 #define bfd_mach_msp21          21
425 #define bfd_mach_msp22          22
426 #define bfd_mach_msp23          23
427 #define bfd_mach_msp24          24
428 #define bfd_mach_msp26          26
429 #define bfd_mach_msp31          31
430 #define bfd_mach_msp32          32
431 #define bfd_mach_msp33          33
432 #define bfd_mach_msp41          41
433 #define bfd_mach_msp42          42
434 #define bfd_mach_msp43          43
435 #define bfd_mach_msp44          44
436 #define bfd_mach_msp430x        45
437 #define bfd_mach_msp46          46
438 #define bfd_mach_msp47          47
439 #define bfd_mach_msp54          54
440   bfd_arch_xc16x,     /* Infineon's XC16X Series.               */
441 #define bfd_mach_xc16x         1
442 #define bfd_mach_xc16xl        2
443 #define bfd_mach_xc16xs        3
444   bfd_arch_xgate,   /* Freescale XGATE */
445 #define bfd_mach_xgate         1
446   bfd_arch_xtensa,    /* Tensilica's Xtensa cores.  */
447 #define bfd_mach_xtensa        1
448   bfd_arch_z80,
449 #define bfd_mach_z80strict      1 /* No undocumented opcodes.  */
450 #define bfd_mach_z80            3 /* With ixl, ixh, iyl, and iyh.  */
451 #define bfd_mach_z80full        7 /* All undocumented instructions.  */
452 #define bfd_mach_r800           11 /* R800: successor with multiplication.  */
453   bfd_arch_lm32,      /* Lattice Mico32 */
454 #define bfd_mach_lm32      1
455   bfd_arch_microblaze,/* Xilinx MicroBlaze. */
456   bfd_arch_tilepro,   /* Tilera TILEPro */
457   bfd_arch_tilegx, /* Tilera TILE-Gx */
458 #define bfd_mach_tilepro   1
459 #define bfd_mach_tilegx    1
460 #define bfd_mach_tilegx32  2
461   bfd_arch_aarch64,   /* AArch64  */
462 #define bfd_mach_aarch64 0
463 #define bfd_mach_aarch64_ilp32 32
464   bfd_arch_nios2,
465 #define bfd_mach_nios2 0
466   bfd_arch_last
467   @};
468 @end example
469
470 @subsection bfd_arch_info
471
472
473 @strong{Description}@*
474 This structure contains information on architectures for use
475 within BFD.
476 @example
477
478 typedef struct bfd_arch_info
479 @{
480   int bits_per_word;
481   int bits_per_address;
482   int bits_per_byte;
483   enum bfd_architecture arch;
484   unsigned long mach;
485   const char *arch_name;
486   const char *printable_name;
487   unsigned int section_align_power;
488   /* TRUE if this is the default machine for the architecture.
489      The default arch should be the first entry for an arch so that
490      all the entries for that arch can be accessed via @code{next}.  */
491   bfd_boolean the_default;
492   const struct bfd_arch_info * (*compatible)
493     (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
494
495   bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
496
497   /* Allocate via bfd_malloc and return a fill buffer of size COUNT.  If
498      IS_BIGENDIAN is TRUE, the order of bytes is big endian.  If CODE is
499      TRUE, the buffer contains code.  */
500   void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
501                  bfd_boolean code);
502
503   const struct bfd_arch_info *next;
504 @}
505 bfd_arch_info_type;
506
507 @end example
508
509 @findex bfd_printable_name
510 @subsubsection @code{bfd_printable_name}
511 @strong{Synopsis}
512 @example
513 const char *bfd_printable_name (bfd *abfd);
514 @end example
515 @strong{Description}@*
516 Return a printable string representing the architecture and machine
517 from the pointer to the architecture info structure.
518
519 @findex bfd_scan_arch
520 @subsubsection @code{bfd_scan_arch}
521 @strong{Synopsis}
522 @example
523 const bfd_arch_info_type *bfd_scan_arch (const char *string);
524 @end example
525 @strong{Description}@*
526 Figure out if BFD supports any cpu which could be described with
527 the name @var{string}.  Return a pointer to an @code{arch_info}
528 structure if a machine is found, otherwise NULL.
529
530 @findex bfd_arch_list
531 @subsubsection @code{bfd_arch_list}
532 @strong{Synopsis}
533 @example
534 const char **bfd_arch_list (void);
535 @end example
536 @strong{Description}@*
537 Return a freshly malloced NULL-terminated vector of the names
538 of all the valid BFD architectures.  Do not modify the names.
539
540 @findex bfd_arch_get_compatible
541 @subsubsection @code{bfd_arch_get_compatible}
542 @strong{Synopsis}
543 @example
544 const bfd_arch_info_type *bfd_arch_get_compatible
545    (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
546 @end example
547 @strong{Description}@*
548 Determine whether two BFDs' architectures and machine types
549 are compatible.  Calculates the lowest common denominator
550 between the two architectures and machine types implied by
551 the BFDs and returns a pointer to an @code{arch_info} structure
552 describing the compatible machine.
553
554 @findex bfd_default_arch_struct
555 @subsubsection @code{bfd_default_arch_struct}
556 @strong{Description}@*
557 The @code{bfd_default_arch_struct} is an item of
558 @code{bfd_arch_info_type} which has been initialized to a fairly
559 generic state.  A BFD starts life by pointing to this
560 structure, until the correct back end has determined the real
561 architecture of the file.
562 @example
563 extern const bfd_arch_info_type bfd_default_arch_struct;
564 @end example
565
566 @findex bfd_set_arch_info
567 @subsubsection @code{bfd_set_arch_info}
568 @strong{Synopsis}
569 @example
570 void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
571 @end example
572 @strong{Description}@*
573 Set the architecture info of @var{abfd} to @var{arg}.
574
575 @findex bfd_default_set_arch_mach
576 @subsubsection @code{bfd_default_set_arch_mach}
577 @strong{Synopsis}
578 @example
579 bfd_boolean bfd_default_set_arch_mach
580    (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
581 @end example
582 @strong{Description}@*
583 Set the architecture and machine type in BFD @var{abfd}
584 to @var{arch} and @var{mach}.  Find the correct
585 pointer to a structure and insert it into the @code{arch_info}
586 pointer.
587
588 @findex bfd_get_arch
589 @subsubsection @code{bfd_get_arch}
590 @strong{Synopsis}
591 @example
592 enum bfd_architecture bfd_get_arch (bfd *abfd);
593 @end example
594 @strong{Description}@*
595 Return the enumerated type which describes the BFD @var{abfd}'s
596 architecture.
597
598 @findex bfd_get_mach
599 @subsubsection @code{bfd_get_mach}
600 @strong{Synopsis}
601 @example
602 unsigned long bfd_get_mach (bfd *abfd);
603 @end example
604 @strong{Description}@*
605 Return the long type which describes the BFD @var{abfd}'s
606 machine.
607
608 @findex bfd_arch_bits_per_byte
609 @subsubsection @code{bfd_arch_bits_per_byte}
610 @strong{Synopsis}
611 @example
612 unsigned int bfd_arch_bits_per_byte (bfd *abfd);
613 @end example
614 @strong{Description}@*
615 Return the number of bits in one of the BFD @var{abfd}'s
616 architecture's bytes.
617
618 @findex bfd_arch_bits_per_address
619 @subsubsection @code{bfd_arch_bits_per_address}
620 @strong{Synopsis}
621 @example
622 unsigned int bfd_arch_bits_per_address (bfd *abfd);
623 @end example
624 @strong{Description}@*
625 Return the number of bits in one of the BFD @var{abfd}'s
626 architecture's addresses.
627
628 @findex bfd_default_compatible
629 @subsubsection @code{bfd_default_compatible}
630 @strong{Synopsis}
631 @example
632 const bfd_arch_info_type *bfd_default_compatible
633    (const bfd_arch_info_type *a, const bfd_arch_info_type *b);
634 @end example
635 @strong{Description}@*
636 The default function for testing for compatibility.
637
638 @findex bfd_default_scan
639 @subsubsection @code{bfd_default_scan}
640 @strong{Synopsis}
641 @example
642 bfd_boolean bfd_default_scan
643    (const struct bfd_arch_info *info, const char *string);
644 @end example
645 @strong{Description}@*
646 The default function for working out whether this is an
647 architecture hit and a machine hit.
648
649 @findex bfd_get_arch_info
650 @subsubsection @code{bfd_get_arch_info}
651 @strong{Synopsis}
652 @example
653 const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
654 @end example
655 @strong{Description}@*
656 Return the architecture info struct in @var{abfd}.
657
658 @findex bfd_lookup_arch
659 @subsubsection @code{bfd_lookup_arch}
660 @strong{Synopsis}
661 @example
662 const bfd_arch_info_type *bfd_lookup_arch
663    (enum bfd_architecture arch, unsigned long machine);
664 @end example
665 @strong{Description}@*
666 Look for the architecture info structure which matches the
667 arguments @var{arch} and @var{machine}. A machine of 0 matches the
668 machine/architecture structure which marks itself as the
669 default.
670
671 @findex bfd_printable_arch_mach
672 @subsubsection @code{bfd_printable_arch_mach}
673 @strong{Synopsis}
674 @example
675 const char *bfd_printable_arch_mach
676    (enum bfd_architecture arch, unsigned long machine);
677 @end example
678 @strong{Description}@*
679 Return a printable string representing the architecture and
680 machine type.
681
682 This routine is depreciated.
683
684 @findex bfd_octets_per_byte
685 @subsubsection @code{bfd_octets_per_byte}
686 @strong{Synopsis}
687 @example
688 unsigned int bfd_octets_per_byte (bfd *abfd);
689 @end example
690 @strong{Description}@*
691 Return the number of octets (8-bit quantities) per target byte
692 (minimum addressable unit).  In most cases, this will be one, but some
693 DSP targets have 16, 32, or even 48 bits per byte.
694
695 @findex bfd_arch_mach_octets_per_byte
696 @subsubsection @code{bfd_arch_mach_octets_per_byte}
697 @strong{Synopsis}
698 @example
699 unsigned int bfd_arch_mach_octets_per_byte
700    (enum bfd_architecture arch, unsigned long machine);
701 @end example
702 @strong{Description}@*
703 See bfd_octets_per_byte.
704
705 This routine is provided for those cases where a bfd * is not
706 available
707
708 @findex bfd_arch_default_fill
709 @subsubsection @code{bfd_arch_default_fill}
710 @strong{Synopsis}
711 @example
712 void *bfd_arch_default_fill (bfd_size_type count,
713     bfd_boolean is_bigendian,
714     bfd_boolean code);
715 @end example
716 @strong{Description}@*
717 Allocate via bfd_malloc and return a fill buffer of size COUNT.
718 If IS_BIGENDIAN is TRUE, the order of bytes is big endian.  If
719 CODE is TRUE, the buffer contains code.
720