archures.texi revision 1.1.1.10
1@section Architectures 2BFD keeps one atom in a BFD describing the 3architecture of the data attached to the BFD: a pointer to a 4@code{bfd_arch_info_type}. 5 6Pointers to structures can be requested independently of a BFD 7so that an architecture's information can be interrogated 8without access to an open BFD. 9 10The architecture information is provided by each architecture package. 11The 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 14defined, then all the architectures supported are included. 15 16When BFD starts up, all the architectures are called with an 17initialize method. It is up to the architecture back end to 18insert as many items into the list of architectures as it wants to; 19generally this would be one for each machine and one for the 20default case (an item with a machine field of 0). 21 22BFD's idea of an architecture is implemented in @file{archures.c}. 23 24@subsection bfd_architecture 25 26 27This enum gives the object file's CPU architecture, in a 28global sense---i.e., what processor family does it belong to? 29Another field indicates which processor within 30the family is in use. The machine gives a number which 31distinguishes different versions of the architecture, 32containing, for example, 68020 for Motorola 68020. 33@example 34enum bfd_architecture 35@{ 36 bfd_arch_unknown, /* File arch not known. */ 37 bfd_arch_obscure, /* Arch known, not one of these. */ 38 bfd_arch_m68k, /* Motorola 68xxx. */ 39#define bfd_mach_m68000 1 40#define bfd_mach_m68008 2 41#define bfd_mach_m68010 3 42#define bfd_mach_m68020 4 43#define bfd_mach_m68030 5 44#define bfd_mach_m68040 6 45#define bfd_mach_m68060 7 46#define bfd_mach_cpu32 8 47#define bfd_mach_fido 9 48#define bfd_mach_mcf_isa_a_nodiv 10 49#define bfd_mach_mcf_isa_a 11 50#define bfd_mach_mcf_isa_a_mac 12 51#define bfd_mach_mcf_isa_a_emac 13 52#define bfd_mach_mcf_isa_aplus 14 53#define bfd_mach_mcf_isa_aplus_mac 15 54#define bfd_mach_mcf_isa_aplus_emac 16 55#define bfd_mach_mcf_isa_b_nousp 17 56#define bfd_mach_mcf_isa_b_nousp_mac 18 57#define bfd_mach_mcf_isa_b_nousp_emac 19 58#define bfd_mach_mcf_isa_b 20 59#define bfd_mach_mcf_isa_b_mac 21 60#define bfd_mach_mcf_isa_b_emac 22 61#define bfd_mach_mcf_isa_b_float 23 62#define bfd_mach_mcf_isa_b_float_mac 24 63#define bfd_mach_mcf_isa_b_float_emac 25 64#define bfd_mach_mcf_isa_c 26 65#define bfd_mach_mcf_isa_c_mac 27 66#define bfd_mach_mcf_isa_c_emac 28 67#define bfd_mach_mcf_isa_c_nodiv 29 68#define bfd_mach_mcf_isa_c_nodiv_mac 30 69#define bfd_mach_mcf_isa_c_nodiv_emac 31 70 bfd_arch_vax, /* DEC Vax. */ 71 72 bfd_arch_or1k, /* OpenRISC 1000. */ 73#define bfd_mach_or1k 1 74#define bfd_mach_or1knd 2 75 76 bfd_arch_sparc, /* SPARC. */ 77#define bfd_mach_sparc 1 78/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ 79#define bfd_mach_sparc_sparclet 2 80#define bfd_mach_sparc_sparclite 3 81#define bfd_mach_sparc_v8plus 4 82#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ 83#define bfd_mach_sparc_sparclite_le 6 84#define bfd_mach_sparc_v9 7 85#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ 86#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ 87#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ 88#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ 89#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ 90#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ 91#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ 92#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ 93#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ 94#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ 95#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ 96#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ 97#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ 98#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ 99#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ 100/* Nonzero if MACH has the v9 instruction set. */ 101#define bfd_mach_sparc_v9_p(mach) \ 102 ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ 103 && (mach) != bfd_mach_sparc_sparclite_le) 104/* Nonzero if MACH is a 64 bit sparc architecture. */ 105#define bfd_mach_sparc_64bit_p(mach) \ 106 ((mach) >= bfd_mach_sparc_v9 \ 107 && (mach) != bfd_mach_sparc_v8plusb \ 108 && (mach) != bfd_mach_sparc_v8plusc \ 109 && (mach) != bfd_mach_sparc_v8plusd \ 110 && (mach) != bfd_mach_sparc_v8pluse \ 111 && (mach) != bfd_mach_sparc_v8plusv \ 112 && (mach) != bfd_mach_sparc_v8plusm \ 113 && (mach) != bfd_mach_sparc_v8plusm8) 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_allegrex 10111431 /* octal 'AL', 31. */ 143#define bfd_mach_mips_loongson_2e 3001 144#define bfd_mach_mips_loongson_2f 3002 145#define bfd_mach_mips_gs464 3003 146#define bfd_mach_mips_gs464e 3004 147#define bfd_mach_mips_gs264e 3005 148#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ 149#define bfd_mach_mips_octeon 6501 150#define bfd_mach_mips_octeonp 6601 151#define bfd_mach_mips_octeon2 6502 152#define bfd_mach_mips_octeon3 6503 153#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ 154#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ 155#define bfd_mach_mipsisa32 32 156#define bfd_mach_mipsisa32r2 33 157#define bfd_mach_mipsisa32r3 34 158#define bfd_mach_mipsisa32r5 36 159#define bfd_mach_mipsisa32r6 37 160#define bfd_mach_mipsisa64 64 161#define bfd_mach_mipsisa64r2 65 162#define bfd_mach_mipsisa64r3 66 163#define bfd_mach_mipsisa64r5 68 164#define bfd_mach_mipsisa64r6 69 165#define bfd_mach_mips_micromips 96 166 bfd_arch_i386, /* Intel 386. */ 167#define bfd_mach_i386_intel_syntax (1 << 0) 168#define bfd_mach_i386_i8086 (1 << 1) 169#define bfd_mach_i386_i386 (1 << 2) 170#define bfd_mach_x86_64 (1 << 3) 171#define bfd_mach_x64_32 (1 << 4) 172#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) 173#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) 174#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) 175 bfd_arch_iamcu, /* Intel MCU. */ 176#define bfd_mach_iamcu (1 << 8) 177#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) 178#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) 179 bfd_arch_romp, /* IBM ROMP PC/RT. */ 180 bfd_arch_convex, /* Convex. */ 181 bfd_arch_m98k, /* Motorola 98xxx. */ 182 bfd_arch_pyramid, /* Pyramid Technology. */ 183 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ 184#define bfd_mach_h8300 1 185#define bfd_mach_h8300h 2 186#define bfd_mach_h8300s 3 187#define bfd_mach_h8300hn 4 188#define bfd_mach_h8300sn 5 189#define bfd_mach_h8300sx 6 190#define bfd_mach_h8300sxn 7 191 bfd_arch_pdp11, /* DEC PDP-11. */ 192 bfd_arch_powerpc, /* PowerPC. */ 193#define bfd_mach_ppc 32 194#define bfd_mach_ppc64 64 195#define bfd_mach_ppc_403 403 196#define bfd_mach_ppc_403gc 4030 197#define bfd_mach_ppc_405 405 198#define bfd_mach_ppc_505 505 199#define bfd_mach_ppc_601 601 200#define bfd_mach_ppc_602 602 201#define bfd_mach_ppc_603 603 202#define bfd_mach_ppc_ec603e 6031 203#define bfd_mach_ppc_604 604 204#define bfd_mach_ppc_620 620 205#define bfd_mach_ppc_630 630 206#define bfd_mach_ppc_750 750 207#define bfd_mach_ppc_860 860 208#define bfd_mach_ppc_a35 35 209#define bfd_mach_ppc_rs64ii 642 210#define bfd_mach_ppc_rs64iii 643 211#define bfd_mach_ppc_7400 7400 212#define bfd_mach_ppc_e500 500 213#define bfd_mach_ppc_e500mc 5001 214#define bfd_mach_ppc_e500mc64 5005 215#define bfd_mach_ppc_e5500 5006 216#define bfd_mach_ppc_e6500 5007 217#define bfd_mach_ppc_titan 83 218#define bfd_mach_ppc_vle 84 219 bfd_arch_rs6000, /* IBM RS/6000. */ 220#define bfd_mach_rs6k 6000 221#define bfd_mach_rs6k_rs1 6001 222#define bfd_mach_rs6k_rsc 6003 223#define bfd_mach_rs6k_rs2 6002 224 bfd_arch_hppa, /* HP PA RISC. */ 225#define bfd_mach_hppa10 10 226#define bfd_mach_hppa11 11 227#define bfd_mach_hppa20 20 228#define bfd_mach_hppa20w 25 229 bfd_arch_d10v, /* Mitsubishi D10V. */ 230#define bfd_mach_d10v 1 231#define bfd_mach_d10v_ts2 2 232#define bfd_mach_d10v_ts3 3 233 bfd_arch_d30v, /* Mitsubishi D30V. */ 234 bfd_arch_dlx, /* DLX. */ 235 bfd_arch_m68hc11, /* Motorola 68HC11. */ 236 bfd_arch_m68hc12, /* Motorola 68HC12. */ 237#define bfd_mach_m6812_default 0 238#define bfd_mach_m6812 1 239#define bfd_mach_m6812s 2 240 bfd_arch_m9s12x, /* Freescale S12X. */ 241 bfd_arch_m9s12xg, /* Freescale XGATE. */ 242 bfd_arch_s12z, /* Freescale S12Z. */ 243#define bfd_mach_s12z_default 0 244 bfd_arch_z8k, /* Zilog Z8000. */ 245#define bfd_mach_z8001 1 246#define bfd_mach_z8002 2 247 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ 248#define bfd_mach_sh 1 249#define bfd_mach_sh2 0x20 250#define bfd_mach_sh_dsp 0x2d 251#define bfd_mach_sh2a 0x2a 252#define bfd_mach_sh2a_nofpu 0x2b 253#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 254#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 255#define bfd_mach_sh2a_or_sh4 0x2a3 256#define bfd_mach_sh2a_or_sh3e 0x2a4 257#define bfd_mach_sh2e 0x2e 258#define bfd_mach_sh3 0x30 259#define bfd_mach_sh3_nommu 0x31 260#define bfd_mach_sh3_dsp 0x3d 261#define bfd_mach_sh3e 0x3e 262#define bfd_mach_sh4 0x40 263#define bfd_mach_sh4_nofpu 0x41 264#define bfd_mach_sh4_nommu_nofpu 0x42 265#define bfd_mach_sh4a 0x4a 266#define bfd_mach_sh4a_nofpu 0x4b 267#define bfd_mach_sh4al_dsp 0x4d 268 bfd_arch_alpha, /* Dec Alpha. */ 269#define bfd_mach_alpha_ev4 0x10 270#define bfd_mach_alpha_ev5 0x20 271#define bfd_mach_alpha_ev6 0x30 272 bfd_arch_arm, /* Advanced Risc Machines ARM. */ 273#define bfd_mach_arm_unknown 0 274#define bfd_mach_arm_2 1 275#define bfd_mach_arm_2a 2 276#define bfd_mach_arm_3 3 277#define bfd_mach_arm_3M 4 278#define bfd_mach_arm_4 5 279#define bfd_mach_arm_4T 6 280#define bfd_mach_arm_5 7 281#define bfd_mach_arm_5T 8 282#define bfd_mach_arm_5TE 9 283#define bfd_mach_arm_XScale 10 284#define bfd_mach_arm_ep9312 11 285#define bfd_mach_arm_iWMMXt 12 286#define bfd_mach_arm_iWMMXt2 13 287#define bfd_mach_arm_5TEJ 14 288#define bfd_mach_arm_6 15 289#define bfd_mach_arm_6KZ 16 290#define bfd_mach_arm_6T2 17 291#define bfd_mach_arm_6K 18 292#define bfd_mach_arm_7 19 293#define bfd_mach_arm_6M 20 294#define bfd_mach_arm_6SM 21 295#define bfd_mach_arm_7EM 22 296#define bfd_mach_arm_8 23 297#define bfd_mach_arm_8R 24 298#define bfd_mach_arm_8M_BASE 25 299#define bfd_mach_arm_8M_MAIN 26 300#define bfd_mach_arm_8_1M_MAIN 27 301#define bfd_mach_arm_9 28 302 bfd_arch_nds32, /* Andes NDS32. */ 303#define bfd_mach_n1 1 304#define bfd_mach_n1h 2 305#define bfd_mach_n1h_v2 3 306#define bfd_mach_n1h_v3 4 307#define bfd_mach_n1h_v3m 5 308 bfd_arch_ns32k, /* National Semiconductors ns32000. */ 309 bfd_arch_tic30, /* Texas Instruments TMS320C30. */ 310 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ 311#define bfd_mach_tic3x 30 312#define bfd_mach_tic4x 40 313 bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ 314 bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ 315 bfd_arch_v850, /* NEC V850. */ 316 bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ 317#define bfd_mach_v850 1 318#define bfd_mach_v850e 'E' 319#define bfd_mach_v850e1 '1' 320#define bfd_mach_v850e2 0x4532 321#define bfd_mach_v850e2v3 0x45325633 322#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ 323 bfd_arch_arc, /* ARC Cores. */ 324#define bfd_mach_arc_a4 0 325#define bfd_mach_arc_a5 1 326#define bfd_mach_arc_arc600 2 327#define bfd_mach_arc_arc601 4 328#define bfd_mach_arc_arc700 3 329#define bfd_mach_arc_arcv2 5 330 bfd_arch_m32c, /* Renesas M16C/M32C. */ 331#define bfd_mach_m16c 0x75 332#define bfd_mach_m32c 0x78 333 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ 334#define bfd_mach_m32r 1 /* For backwards compatibility. */ 335#define bfd_mach_m32rx 'x' 336#define bfd_mach_m32r2 '2' 337 bfd_arch_mn10200, /* Matsushita MN10200. */ 338 bfd_arch_mn10300, /* Matsushita MN10300. */ 339#define bfd_mach_mn10300 300 340#define bfd_mach_am33 330 341#define bfd_mach_am33_2 332 342 bfd_arch_fr30, 343#define bfd_mach_fr30 0x46523330 344 bfd_arch_frv, 345#define bfd_mach_frv 1 346#define bfd_mach_frvsimple 2 347#define bfd_mach_fr300 300 348#define bfd_mach_fr400 400 349#define bfd_mach_fr450 450 350#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ 351#define bfd_mach_fr500 500 352#define bfd_mach_fr550 550 353 bfd_arch_moxie, /* The moxie processor. */ 354#define bfd_mach_moxie 1 355 bfd_arch_ft32, /* The ft32 processor. */ 356#define bfd_mach_ft32 1 357#define bfd_mach_ft32b 2 358 bfd_arch_mcore, 359 bfd_arch_mep, 360#define bfd_mach_mep 1 361#define bfd_mach_mep_h1 0x6831 362#define bfd_mach_mep_c5 0x6335 363 bfd_arch_metag, 364#define bfd_mach_metag 1 365 bfd_arch_ia64, /* HP/Intel ia64. */ 366#define bfd_mach_ia64_elf64 64 367#define bfd_mach_ia64_elf32 32 368 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ 369#define bfd_mach_ip2022 1 370#define bfd_mach_ip2022ext 2 371 bfd_arch_iq2000, /* Vitesse IQ2000. */ 372#define bfd_mach_iq2000 1 373#define bfd_mach_iq10 2 374 bfd_arch_bpf, /* Linux eBPF. */ 375#define bfd_mach_bpf 1 376#define bfd_mach_xbpf 2 377 bfd_arch_epiphany, /* Adapteva EPIPHANY. */ 378#define bfd_mach_epiphany16 1 379#define bfd_mach_epiphany32 2 380 bfd_arch_mt, 381#define bfd_mach_ms1 1 382#define bfd_mach_mrisc2 2 383#define bfd_mach_ms2 3 384 bfd_arch_pj, 385 bfd_arch_avr, /* Atmel AVR microcontrollers. */ 386#define bfd_mach_avr1 1 387#define bfd_mach_avr2 2 388#define bfd_mach_avr25 25 389#define bfd_mach_avr3 3 390#define bfd_mach_avr31 31 391#define bfd_mach_avr35 35 392#define bfd_mach_avr4 4 393#define bfd_mach_avr5 5 394#define bfd_mach_avr51 51 395#define bfd_mach_avr6 6 396#define bfd_mach_avrtiny 100 397#define bfd_mach_avrxmega1 101 398#define bfd_mach_avrxmega2 102 399#define bfd_mach_avrxmega3 103 400#define bfd_mach_avrxmega4 104 401#define bfd_mach_avrxmega5 105 402#define bfd_mach_avrxmega6 106 403#define bfd_mach_avrxmega7 107 404 bfd_arch_bfin, /* ADI Blackfin. */ 405#define bfd_mach_bfin 1 406 bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ 407#define bfd_mach_cr16 1 408 bfd_arch_crx, /* National Semiconductor CRX. */ 409#define bfd_mach_crx 1 410 bfd_arch_cris, /* Axis CRIS. */ 411#define bfd_mach_cris_v0_v10 255 412#define bfd_mach_cris_v32 32 413#define bfd_mach_cris_v10_v32 1032 414 bfd_arch_riscv, 415#define bfd_mach_riscv32 132 416#define bfd_mach_riscv64 164 417 bfd_arch_rl78, 418#define bfd_mach_rl78 0x75 419 bfd_arch_rx, /* Renesas RX. */ 420#define bfd_mach_rx 0x75 421#define bfd_mach_rx_v2 0x76 422#define bfd_mach_rx_v3 0x77 423 bfd_arch_s390, /* IBM s390. */ 424#define bfd_mach_s390_31 31 425#define bfd_mach_s390_64 64 426 bfd_arch_score, /* Sunplus score. */ 427#define bfd_mach_score3 3 428#define bfd_mach_score7 7 429 bfd_arch_mmix, /* Donald Knuth's educational processor. */ 430 bfd_arch_xstormy16, 431#define bfd_mach_xstormy16 1 432 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ 433#define bfd_mach_msp11 11 434#define bfd_mach_msp110 110 435#define bfd_mach_msp12 12 436#define bfd_mach_msp13 13 437#define bfd_mach_msp14 14 438#define bfd_mach_msp15 15 439#define bfd_mach_msp16 16 440#define bfd_mach_msp20 20 441#define bfd_mach_msp21 21 442#define bfd_mach_msp22 22 443#define bfd_mach_msp23 23 444#define bfd_mach_msp24 24 445#define bfd_mach_msp26 26 446#define bfd_mach_msp31 31 447#define bfd_mach_msp32 32 448#define bfd_mach_msp33 33 449#define bfd_mach_msp41 41 450#define bfd_mach_msp42 42 451#define bfd_mach_msp43 43 452#define bfd_mach_msp44 44 453#define bfd_mach_msp430x 45 454#define bfd_mach_msp46 46 455#define bfd_mach_msp47 47 456#define bfd_mach_msp54 54 457 bfd_arch_xgate, /* Freescale XGATE. */ 458#define bfd_mach_xgate 1 459 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ 460#define bfd_mach_xtensa 1 461 bfd_arch_z80, 462/* Zilog Z80 without undocumented opcodes. */ 463#define bfd_mach_z80strict 1 464/* Zilog Z180: successor with additional instructions, but without 465 halves of ix and iy. */ 466#define bfd_mach_z180 2 467/* Zilog Z80 with ixl, ixh, iyl, and iyh. */ 468#define bfd_mach_z80 3 469/* Zilog eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode. */ 470#define bfd_mach_ez80_z80 4 471/* Zilog eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode. */ 472#define bfd_mach_ez80_adl 5 473/* Z80N */ 474#define bfd_mach_z80n 6 475/* Zilog Z80 with all undocumented instructions. */ 476#define bfd_mach_z80full 7 477/* GameBoy Z80 (reduced instruction set). */ 478#define bfd_mach_gbz80 8 479/* ASCII R800: successor with multiplication. */ 480#define bfd_mach_r800 11 481 bfd_arch_lm32, /* Lattice Mico32. */ 482#define bfd_mach_lm32 1 483 bfd_arch_microblaze,/* Xilinx MicroBlaze. */ 484 bfd_arch_kvx, /* Kalray VLIW core of the MPPA processor family */ 485#define bfd_mach_kv3_unknown 0 486#define bfd_mach_kv3_1 1 487#define bfd_mach_kv3_1_64 2 488#define bfd_mach_kv3_1_usr 3 489#define bfd_mach_kv3_2 4 490#define bfd_mach_kv3_2_64 5 491#define bfd_mach_kv3_2_usr 6 492#define bfd_mach_kv4_1 7 493#define bfd_mach_kv4_1_64 8 494#define bfd_mach_kv4_1_usr 9 495 bfd_arch_tilepro, /* Tilera TILEPro. */ 496 bfd_arch_tilegx, /* Tilera TILE-Gx. */ 497#define bfd_mach_tilepro 1 498#define bfd_mach_tilegx 1 499#define bfd_mach_tilegx32 2 500 bfd_arch_aarch64, /* AArch64. */ 501#define bfd_mach_aarch64 0 502#define bfd_mach_aarch64_8R 1 503#define bfd_mach_aarch64_ilp32 32 504#define bfd_mach_aarch64_llp64 64 505 bfd_arch_nios2, /* Nios II. */ 506#define bfd_mach_nios2 0 507#define bfd_mach_nios2r1 1 508#define bfd_mach_nios2r2 2 509 bfd_arch_visium, /* Visium. */ 510#define bfd_mach_visium 1 511 bfd_arch_wasm32, /* WebAssembly. */ 512#define bfd_mach_wasm32 1 513 bfd_arch_pru, /* PRU. */ 514#define bfd_mach_pru 0 515 bfd_arch_nfp, /* Netronome Flow Processor */ 516#define bfd_mach_nfp3200 0x3200 517#define bfd_mach_nfp6000 0x6000 518 bfd_arch_csky, /* C-SKY. */ 519#define bfd_mach_ck_unknown 0 520#define bfd_mach_ck510 1 521#define bfd_mach_ck610 2 522#define bfd_mach_ck801 3 523#define bfd_mach_ck802 4 524#define bfd_mach_ck803 5 525#define bfd_mach_ck807 6 526#define bfd_mach_ck810 7 527#define bfd_mach_ck860 8 528 bfd_arch_loongarch, /* LoongArch */ 529#define bfd_mach_loongarch32 1 530#define bfd_mach_loongarch64 2 531 bfd_arch_amdgcn, /* AMDGCN */ 532#define bfd_mach_amdgcn_unknown 0x000 533#define bfd_mach_amdgcn_gfx900 0x02c 534#define bfd_mach_amdgcn_gfx904 0x02e 535#define bfd_mach_amdgcn_gfx906 0x02f 536#define bfd_mach_amdgcn_gfx908 0x030 537#define bfd_mach_amdgcn_gfx90a 0x03f 538#define bfd_mach_amdgcn_gfx1010 0x033 539#define bfd_mach_amdgcn_gfx1011 0x034 540#define bfd_mach_amdgcn_gfx1012 0x035 541#define bfd_mach_amdgcn_gfx1030 0x036 542#define bfd_mach_amdgcn_gfx1031 0x037 543#define bfd_mach_amdgcn_gfx1032 0x038 544#define bfd_mach_amdgcn_gfx1100 0x041 545#define bfd_mach_amdgcn_gfx1101 0x046 546#define bfd_mach_amdgcn_gfx1102 0x047 547 bfd_arch_last 548 @}; 549@end example 550 551@subsection bfd_arch_info 552 553 554This structure contains information on architectures for use 555within BFD. 556@example 557 558typedef struct bfd_arch_info 559@{ 560 int bits_per_word; 561 int bits_per_address; 562 int bits_per_byte; 563 enum bfd_architecture arch; 564 unsigned long mach; 565 const char *arch_name; 566 const char *printable_name; 567 unsigned int section_align_power; 568 /* TRUE if this is the default machine for the architecture. 569 The default arch should be the first entry for an arch so that 570 all the entries for that arch can be accessed via @code{next}. */ 571 bool the_default; 572 const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, 573 const struct bfd_arch_info *); 574 575 bool (*scan) (const struct bfd_arch_info *, const char *); 576 577 /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If 578 IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is 579 TRUE, the buffer contains code. */ 580 void *(*fill) (bfd_size_type count, bool is_bigendian, bool code); 581 582 const struct bfd_arch_info *next; 583 584 /* On some architectures the offset for a relocation can point into 585 the middle of an instruction. This field specifies the maximum 586 offset such a relocation can have (in octets). This affects the 587 behaviour of the disassembler, since a value greater than zero 588 means that it may need to disassemble an instruction twice, once 589 to get its length and then a second time to display it. If the 590 value is negative then this has to be done for every single 591 instruction, regardless of the offset of the reloc. */ 592 signed int max_reloc_offset_into_insn; 593@} 594bfd_arch_info_type; 595 596@end example 597 598@findex bfd_printable_name 599@subsubsection @code{bfd_printable_name} 600@deftypefn {Function} const char *bfd_printable_name (bfd *abfd); 601Return a printable string representing the architecture and machine 602from the pointer to the architecture info structure. 603 604@end deftypefn 605@findex bfd_scan_arch 606@subsubsection @code{bfd_scan_arch} 607@deftypefn {Function} const bfd_arch_info_type *bfd_scan_arch (const char *string); 608Figure out if BFD supports any cpu which could be described with 609the name @var{string}. Return a pointer to an @code{arch_info} 610structure if a machine is found, otherwise NULL. 611 612@end deftypefn 613@findex bfd_arch_list 614@subsubsection @code{bfd_arch_list} 615@deftypefn {Function} const char **bfd_arch_list (void); 616Return a freshly malloced NULL-terminated vector of the names 617of all the valid BFD architectures. Do not modify the names. 618 619@end deftypefn 620@findex bfd_arch_get_compatible 621@subsubsection @code{bfd_arch_get_compatible} 622@deftypefn {Function} const bfd_arch_info_type *bfd_arch_get_compatible (const bfd *abfd, const bfd *bbfd, bool accept_unknowns); 623Determine whether two BFDs' architectures and machine types 624are compatible. Calculates the lowest common denominator 625between the two architectures and machine types implied by 626the BFDs and returns a pointer to an @code{arch_info} structure 627describing the compatible machine. 628 629@end deftypefn 630@findex bfd_default_arch_struct 631@subsubsection @code{bfd_default_arch_struct} 632The @code{bfd_default_arch_struct} is an item of 633@code{bfd_arch_info_type} which has been initialized to a fairly 634generic state. A BFD starts life by pointing to this 635structure, until the correct back end has determined the real 636architecture of the file. 637@example 638extern const bfd_arch_info_type bfd_default_arch_struct; 639 640@end example 641 642@findex bfd_set_arch_info 643@subsubsection @code{bfd_set_arch_info} 644@deftypefn {Function} void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); 645Set the architecture info of @var{abfd} to @var{arg}. 646 647@end deftypefn 648@findex bfd_default_set_arch_mach 649@subsubsection @code{bfd_default_set_arch_mach} 650@deftypefn {Function} bool bfd_default_set_arch_mach (bfd *abfd, enum bfd_architecture arch, unsigned long mach); 651Set the architecture and machine type in BFD @var{abfd} 652to @var{arch} and @var{mach}. Find the correct 653pointer to a structure and insert it into the @code{arch_info} 654pointer. 655 656@end deftypefn 657@findex bfd_get_arch 658@subsubsection @code{bfd_get_arch} 659@deftypefn {Function} enum bfd_architecture bfd_get_arch (const bfd *abfd); 660Return the enumerated type which describes the BFD @var{abfd}'s 661architecture. 662 663@end deftypefn 664@findex bfd_get_mach 665@subsubsection @code{bfd_get_mach} 666@deftypefn {Function} unsigned long bfd_get_mach (const bfd *abfd); 667Return the long type which describes the BFD @var{abfd}'s 668machine. 669 670@end deftypefn 671@findex bfd_arch_bits_per_byte 672@subsubsection @code{bfd_arch_bits_per_byte} 673@deftypefn {Function} unsigned int bfd_arch_bits_per_byte (const bfd *abfd); 674Return the number of bits in one of the BFD @var{abfd}'s 675architecture's bytes. 676 677@end deftypefn 678@findex bfd_arch_bits_per_address 679@subsubsection @code{bfd_arch_bits_per_address} 680@deftypefn {Function} unsigned int bfd_arch_bits_per_address (const bfd *abfd); 681Return the number of bits in one of the BFD @var{abfd}'s 682architecture's addresses. 683 684@end deftypefn 685@findex bfd_default_compatible 686@subsubsection @code{bfd_default_compatible} 687@deftypefn {Function} const bfd_arch_info_type *bfd_default_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b); 688The default function for testing for compatibility. 689 690@end deftypefn 691@findex bfd_default_scan 692@subsubsection @code{bfd_default_scan} 693@deftypefn {Function} bool bfd_default_scan (const struct bfd_arch_info *info, const char *string); 694The default function for working out whether this is an 695architecture hit and a machine hit. 696 697@end deftypefn 698@findex bfd_get_arch_info 699@subsubsection @code{bfd_get_arch_info} 700@deftypefn {Function} const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); 701Return the architecture info struct in @var{abfd}. 702 703@end deftypefn 704@findex bfd_lookup_arch 705@subsubsection @code{bfd_lookup_arch} 706@deftypefn {Function} const bfd_arch_info_type *bfd_lookup_arch (enum bfd_architecture arch, unsigned long machine); 707Look for the architecture info structure which matches the 708arguments @var{arch} and @var{machine}. A machine of 0 matches the 709machine/architecture structure which marks itself as the 710default. 711 712@end deftypefn 713@findex bfd_printable_arch_mach 714@subsubsection @code{bfd_printable_arch_mach} 715@deftypefn {Function} const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); 716Return a printable string representing the architecture and 717machine type. 718 719This routine is depreciated. 720 721@end deftypefn 722@findex bfd_octets_per_byte 723@subsubsection @code{bfd_octets_per_byte} 724@deftypefn {Function} unsigned int bfd_octets_per_byte (const bfd *abfd, const asection *sec); 725Return the number of octets (8-bit quantities) per target byte 726(minimum addressable unit). In most cases, this will be one, but some 727DSP targets have 16, 32, or even 48 bits per byte. 728 729@end deftypefn 730@findex bfd_arch_mach_octets_per_byte 731@subsubsection @code{bfd_arch_mach_octets_per_byte} 732@deftypefn {Function} unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); 733See bfd_octets_per_byte. 734 735This routine is provided for those cases where a bfd * is not 736available 737 738@end deftypefn 739@findex bfd_arch_default_fill 740@subsubsection @code{bfd_arch_default_fill} 741@deftypefn {Function} void *bfd_arch_default_fill (bfd_size_type count, bool is_bigendian, bool code); 742Allocate via bfd_malloc and return a fill buffer of size COUNT. 743If IS_BIGENDIAN is TRUE, the order of bytes is big endian. If 744CODE is TRUE, the buffer contains code. 745 746@end deftypefn 747