2 # Convert a canonical host type into a BFD host type.
3 # Set shell variable targ to canonical target name, and run
4 # using ``. config.bfd''.
5 # Sets the following shell variables:
6 # targ_defvec Default vector for this target
7 # targ_selvecs Vectors to build for this target
8 # targ_archs Architectures for this target
9 # targ_cflags $(CFLAGS) for this target (FIXME: pretty bogus)
10 # targ_underscore Whether underscores are used: yes or no
12 # Part of this file is processed by targmatch.sed to generate the
13 # targmatch.h file. The #ifdef and #endif lines that appear below are
14 # copied directly into targmatch.h.
16 # The binutils c++filt program wants to know whether underscores are
17 # stripped or not. That is why we set targ_underscore. c++filt uses
18 # this information to choose a default. This information is
19 # duplicated in the symbol_leading_char field of the BFD target
20 # vector, but c++filt does not deal with object files and is not
21 # linked against libbfd.a. It is not terribly important that c++filt
22 # get this right; it is just convenient.
29 targ_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
31 alpha*) targ_archs=bfd_alpha_arch ;;
32 arm*) targ_archs=bfd_arm_arch ;;
33 strongarm*) targ_archs=bfd_arm_arch ;;
34 thumb*) targ_archs=bfd_arm_arch ;;
35 c30*) targ_archs=bfd_tic30_arch ;;
36 hppa*) targ_archs=bfd_hppa_arch ;;
37 i[3456]86) targ_archs=bfd_i386_arch ;;
38 m68*) targ_archs=bfd_m68k_arch ;;
39 m88*) targ_archs=bfd_m88k_arch ;;
40 mips*) targ_archs=bfd_mips_arch ;;
41 powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
42 rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
43 sparc*) targ_archs=bfd_sparc_arch ;;
44 v850*) targ_archs=bfd_v850_arch ;;
45 z8k*) targ_archs=bfd_z8k_arch ;;
46 *) targ_archs=bfd_${targ_cpu}_arch ;;
50 # WHEN ADDING ENTRIES TO THIS MATRIX:
51 # Make sure that the left side always has two dashes. Otherwise you
52 # can get spurious matches. Even for unambiguous cases, do this as a
53 # convention, else the table becomes a real mess to understand and maintain.
56 # START OF targmatch.h
58 alpha*-*-netbsd* | alpha*-*-freebsd*)
59 targ_defvec=bfd_elf64_alpha_vec
60 targ_selvecs=ecoffalpha_little_vec
63 targ_defvec=ecoffalpha_little_vec
64 targ_selvecs=nlm32_alpha_vec
67 targ_defvec=ecoffalpha_little_vec
68 targ_selvecs=bfd_elf64_alpha_vec
70 alpha*-*-linux-gnu* | alpha*-*-elf*)
71 targ_defvec=bfd_elf64_alpha_vec
72 targ_selvecs=ecoffalpha_little_vec
75 targ_defvec=vms_alpha_vec
78 targ_defvec=ecoffalpha_little_vec
83 targ_defvec=bfd_elf32_littlearc_vec
84 targ_selvecs=bfd_elf32_bigarc_vec
88 targ_defvec=riscix_vec
91 targ_defvec=arm_epoc_pe_little_vec
92 targ_selvecs="arm_epoc_pe_little_vec arm_epoc_pe_big_vec arm_epoc_pei_little_vec arm_epoc_pei_big_vec"
96 targ_defvec=armpe_little_vec
97 targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec"
100 arm-*-aout | armel-*-aout)
101 targ_defvec=aout_arm_little_vec
102 targ_selvecs=aout_arm_big_vec
105 targ_defvec=aout_arm_big_vec
106 targ_selvecs=aout_arm_little_vec
109 targ_defvec=armcoff_little_vec
110 targ_selvecs=armcoff_big_vec
113 arm-*-elf | arm*-*-linux-gnu)
114 targ_defvec=bfd_elf32_littlearm_vec
115 targ_selvecs=bfd_elf32_bigarm_vec
118 targ_defvec=bfd_elf32_littlearm_oabi_vec
119 targ_selvecs=bfd_elf32_bigarm_oabi_vec
123 targ_defvec=armcoff_little_vec
124 targ_selvecs=armcoff_big_vec
128 targ_defvec=bfd_elf32_littlearm_oabi_vec
129 targ_selvecs=bfd_elf32_bigarm_oabi_vec
132 targ_defvec=bfd_elf32_littlearm_vec
133 targ_selvecs=bfd_elf32_bigarm_vec
136 targ_defvec=arm_epoc_pe_little_vec
137 targ_selvecs="arm_epoc_pe_little_vec arm_epoc_pe_big_vec arm_epoc_pei_little_vec arm_epoc_pei_big_vec"
141 targ_defvec=armpe_little_vec
142 targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec"
146 targ_defvec=bfd_elf32_littlearm_vec
147 targ_selvecs=bfd_elf32_bigarm_vec
150 targ_defvec=armcoff_little_vec
151 targ_selvecs=armcoff_big_vec
155 a29k-*-ebmon* | a29k-*-udi* | a29k-*-coff* | a29k-*-sym1* | \
156 a29k-*-vxworks* | a29k-*-sysv*)
157 targ_defvec=a29kcoff_big_vec
158 targ_selvecs=sunos_big_vec
161 a29k-*-aout* | a29k-*-bsd* | a29k-*-vsta*)
162 targ_defvec=sunos_big_vec
166 c30-*-*aout* | tic30-*-*aout*)
167 targ_defvec=tic30_aout_vec
169 c30-*-*coff* | tic30-*-*coff*)
170 targ_defvec=tic30_coff_vec
174 targ_defvec=bfd_elf32_d10v_vec
178 targ_defvec=bfd_elf32_d30v_vec
182 targ_defvec=bfd_elf32_fr30_vec
187 targ_defvec=h8300coff_vec
192 targ_defvec=h8500coff_vec
196 hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*)
197 targ_defvec=bfd_elf32_hppa_vec
199 #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) || defined (HOST_HPPAMPEIX)
202 targ_selvecs=bfd_elf32_hppa_vec
204 hppa*-*-hpux* | hppa*-*-hiux* | hppa*-*-mpeix*)
209 targ_selvecs=bfd_elf32_hppa_vec
211 #endif /* defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) */
213 i[3456]86-*-sco3.2v5*coff)
214 targ_defvec=i386coff_vec
215 targ_selvecs=bfd_elf32_i386_vec
217 i[3456]86-*-sysv4* | i[3456]86-*-unixware | i[3456]86-*-solaris2* | \
218 i[3456]86-*-elf | i[3456]86-*-sco3.2v5* | \
219 i[3456]86-*-dgux* | i[3456]86-*-sysv5*)
220 targ_defvec=bfd_elf32_i386_vec
221 targ_selvecs=i386coff_vec
223 i[3456]86-*-rtemself*)
224 targ_defvec=bfd_elf32_i386_vec
225 targ_selvecs="i386coff_vec i386aout_vec"
227 i[3456]86-*-msdosdjgpp* | i[3456]*-*-go32* | i[3456]86-go32-rtems* )
228 targ_defvec=go32coff_vec
229 targ_selvecs="go32stubbedcoff_vec i386aout_vec"
231 i[3456]86-*-sysv* | i[3456]86-*-isc* | i[3456]86-*-sco* | i[3456]86-*-coff | \
233 targ_defvec=i386coff_vec
236 targ_defvec=i386coff_vec
237 targ_selvecs="bfd_elf32_i386_vec i386aout_vec"
239 i[3456]86-sequent-bsd*)
240 targ_defvec=i386dynix_vec
244 targ_defvec=i386bsd_vec
247 i[3456]86-*-freebsdaout* | i[3456]86-*-freebsd[12].* | \
248 i[3456]86-*-freebsd[12])
249 targ_defvec=i386freebsd_vec
250 targ_selvecs=i386bsd_vec
253 i[3456]86-*-freebsd*)
254 targ_defvec=bfd_elf32_i386_vec
255 targ_selvecs=i386coff_vec
257 i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
258 targ_defvec=i386netbsd_vec
259 targ_selvecs=i386bsd_vec
262 i[3456]86-*-netware*)
263 targ_defvec=bfd_elf32_i386_vec
264 targ_selvecs="nlm32_i386_vec i386coff_vec i386aout_vec"
266 i[3456]86-*-linux*aout*)
267 targ_defvec=i386linux_vec
268 targ_selvecs=bfd_elf32_i386_vec
271 i[3456]86-*-linux-gnu*)
272 targ_defvec=bfd_elf32_i386_vec
273 targ_selvecs=i386linux_vec
276 targ_defvec=i386lynx_coff_vec
277 targ_selvecs=i386lynx_aout_vec
280 targ_defvec=bfd_elf32_i386_vec
282 i[3456]86-*-mach* | i[3456]86-*-osf1mk*)
283 targ_defvec=i386mach3_vec
284 targ_cflags=-DSTAT_FOR_EXEC
288 targ_defvec=i386os9k_vec
291 targ_defvec=i386aout_vec
292 targ_selvecs=i386msdos_vec
295 targ_defvec=bfd_elf32_i386_vec
296 targ_selvecs="i386msdos_vec i386aout_vec"
299 targ_defvec=i386pe_vec
300 targ_selvecs="i386pe_vec i386pei_vec"
302 i[3456]86-*-beoself* | i[3456]86-*-beos*)
303 targ_defvec=bfd_elf32_i386_vec
304 targ_selvecs="i386pe_vec i386pei_vec"
306 i[3456]86-*-mingw32* | i[3456]86-*-cygwin* | i[3456]86-*-winnt | i[3456]86-*-pe)
307 targ_defvec=i386pe_vec
308 targ_selvecs="i386pe_vec i386pei_vec"
311 targ_defvec=i386coff_vec
313 i[3456]86-*-aout* | i[3456]86*-*-vsta*)
314 targ_defvec=i386aout_vec
317 i860-*-mach3* | i860-*-osf1* | i860-*-coff*)
318 targ_defvec=i860coff_vec
320 i860-*-sysv4* | i860-*-elf*)
321 targ_defvec=bfd_elf32_i860_vec
324 i960-*-vxworks4* | i960-*-vxworks5.0)
325 targ_defvec=b_out_vec_little_host
326 targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec"
329 i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv* | i960-*-rtems*)
330 targ_defvec=icoff_little_vec
331 targ_selvecs="icoff_big_vec b_out_vec_little_host b_out_vec_big_host ieee_vec"
334 i960-*-vxworks* | i960-*-aout* | i960-*-bout* | i960-*-nindy*)
335 targ_defvec=b_out_vec_little_host
336 targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec"
340 targ_defvec=bfd_elf32_i960_vec
341 targ_selvecs="icoff_little_vec icoff_big_vec"
345 targ_defvec=bfd_elf32_m32r_vec
349 targ_defvec=apollocoff_vec
352 targ_defvec=m68kcoffun_vec
356 targ_defvec=m68ksysvcoff_vec
359 targ_defvec=hp300bsd_vec
363 targ_defvec=aout0_big_vec
364 # We include cisco_core_vec here, rather than making a separate cisco
365 # configuration, so that cisco-core.c gets routinely tested at
366 # least for compilation.
367 targ_selvecs="cisco_core_vec ieee_vec"
370 m68*-*-elf* | m68*-*-sysv4*)
371 targ_defvec=bfd_elf32_m68k_vec
372 targ_selvecs="m68kcoff_vec ieee_vec"
375 targ_defvec=m68kcoff_vec
376 targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec"
378 m68*-*-coff* | m68*-*-sysv*)
379 targ_defvec=m68kcoff_vec
380 targ_selvecs="m68kcoff_vec versados_vec ieee_vec"
383 targ_defvec=hp300hpux_vec
387 targ_defvec=m68klinux_vec
388 targ_selvecs=bfd_elf32_m68k_vec
392 targ_defvec=bfd_elf32_m68k_vec
393 targ_selvecs=m68klinux_vec
396 targ_defvec=bfd_elf32_m68k_vec
397 # targ_selvecs=m68kmach3_vec
398 # targ_cflags=-DSTAT_FOR_EXEC
401 targ_defvec=m68klynx_coff_vec
402 targ_selvecs=m68klynx_aout_vec
405 targ_defvec=m68k4knetbsd_vec
406 targ_selvecs="m68knetbsd_vec hp300bsd_vec sunos_big_vec"
409 m68*-*-netbsd* | m68*-*-openbsd*)
410 targ_defvec=m68knetbsd_vec
411 targ_selvecs="m68k4knetbsd_vec hp300bsd_vec sunos_big_vec"
414 m68*-*-sunos* | m68*-*-os68k* | m68*-*-vxworks* | m68*-netx-* | \
415 m68*-*-bsd* | m68*-*-vsta*)
416 targ_defvec=sunos_big_vec
420 targ_defvec=sunos_big_vec
421 targ_selvecs="m68kcoff_vec versados_vec tekhex_vec"
425 targ_defvec=bfd_elf32_m68k_vec
426 targ_selvecs=m68kcoff_vec
429 targ_defvec=m68kaux_coff_vec
432 targ_defvec=bfd_elf32_m68k_vec
433 targ_selvecs=ieee_vec
437 m88*-harris-cxux* | m88*-*-dgux* | m88*-*-sysv4*)
438 targ_defvec=bfd_elf32_m88k_vec
439 targ_selvecs=m88kbcs_vec
442 targ_defvec=m88kmach3_vec
443 targ_cflags=-DSTAT_FOR_EXEC
446 targ_defvec=m88kbcs_vec
451 targ_defvec=bfd_elf32_mcore_big_vec
452 targ_selvecs="bfd_elf32_mcore_big_vec bfd_elf32_mcore_little_vec"
455 targ_defvec=mcore_pe_big_vec
456 targ_selvecs="mcore_pe_big_vec mcore_pe_little_vec mcore_pei_big_vec mcore_pei_little_vec"
460 targ_defvec=ecoff_big_vec
461 targ_selvecs=ecoff_little_vec
463 mips-dec-netbsd* | mips*el*-*-netbsd*)
464 targ_defvec=bfd_elf32_littlemips_vec
465 targ_selvecs="bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec"
468 targ_defvec=bfd_elf32_bigmips_vec
469 targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
472 targ_defvec=aout_mips_little_vec
476 targ_defvec=aout_mips_little_vec
477 targ_cflags=-DSTAT_FOR_EXEC
479 mips*-dec-* | mips*el-*-ecoff*)
480 targ_defvec=ecoff_little_vec
481 targ_selvecs=ecoff_big_vec
484 targ_defvec=ecoff_big_vec
485 targ_selvecs=ecoff_little_vec
488 targ_defvec=bfd_elf32_bigmips_vec
489 targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
492 targ_defvec=bfd_elf32_bigmips_vec
493 targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
495 mips*-sgi-* | mips*-*-bsd*)
496 targ_defvec=ecoff_big_vec
497 targ_selvecs=ecoff_little_vec
500 targ_defvec=ecoff_biglittle_vec
501 targ_selvecs="ecoff_little_vec ecoff_big_vec"
504 targ_defvec=aout_mips_little_vec
505 targ_cflags=-DSTAT_FOR_EXEC
508 targ_defvec=bfd_elf32_bigmips_vec
509 targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
511 mips*-*-sysv* | mips*-*-riscos*)
512 targ_defvec=ecoff_big_vec
513 targ_selvecs=ecoff_little_vec
515 mips*el-*-elf* | mips*el-*-rtems* | mips*el-*-vxworks*)
516 targ_defvec=bfd_elf32_littlemips_vec
517 targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
519 mips*-*-elf* | mips*-*-rtems* | mips*-*-vxworks*)
520 targ_defvec=bfd_elf32_bigmips_vec
521 targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
524 targ_defvec=bfd_elf32_bigmips_vec
525 targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
527 mips*el*-*-linux-gnu* | mips*el*-*-openbsd*)
528 targ_defvec=bfd_elf32_littlemips_vec
529 targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec"
531 mips*-*-linux-gnu* | mips*-*-openbsd*)
532 targ_defvec=bfd_elf32_bigmips_vec
533 targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec"
537 targ_defvec=bfd_elf32_mn10200_vec
541 targ_defvec=bfd_elf32_mn10300_vec
544 ns32k-pc532-mach* | ns32k-pc532-ux*)
545 targ_defvec=pc532machaout_vec
548 ns32k-*-netbsd* | ns32k-*-lites* | ns32k-*-openbsd*)
549 targ_defvec=pc532netbsd_vec
553 powerpc-*-aix* | powerpc-*-beos*)
554 targ_defvec=rs6000coff_vec
556 powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
557 powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
559 targ_defvec=bfd_elf32_powerpc_vec
560 targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
562 powerpc-*-macos* | powerpc-*-mpw*)
563 targ_defvec=pmac_xcoff_vec
566 targ_defvec=bfd_elf32_powerpc_vec
567 targ_selvecs="nlm32_powerpc_vec rs6000coff_vec"
569 powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
570 powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
572 targ_defvec=bfd_elf32_powerpcle_vec
573 targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
576 powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*)
577 targ_defvec=bfd_powerpcle_pe_vec
578 targ_selvecs="bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec"
582 targ_defvec=rs6000coff_vec
585 sh-*-elf* | sh-*-rtemself*)
586 targ_defvec=bfd_elf32_sh_vec
587 targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
590 sh-*-* | sh-*-rtems*)
591 targ_defvec=shcoff_vec
592 targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
597 targ_defvec=sunos_big_vec
598 targ_selvecs=sparcle_aout_vec
602 targ_defvec=sunos_big_vec
605 sparclite-*-elf* | sparc86x-*-elf*)
606 targ_defvec=bfd_elf32_sparc_vec
609 targ_defvec=sparclinux_vec
610 targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
614 targ_defvec=bfd_elf32_sparc_vec
615 targ_selvecs="sparclinux_vec sunos_big_vec"
618 targ_defvec=sparclynx_coff_vec
619 targ_selvecs=sparclynx_aout_vec
621 sparc-*-netbsd* | sparc-*-openbsd*)
622 targ_defvec=sparcnetbsd_vec
625 sparc-*-elf* | sparc-*-solaris2*)
626 targ_defvec=bfd_elf32_sparc_vec
627 targ_selvecs=sunos_big_vec
630 targ_defvec=bfd_elf32_sparc_vec
633 targ_defvec=bfd_elf32_sparc_vec
634 targ_selvecs="nlm32_sparc_vec sunos_big_vec"
638 targ_defvec=sunos_big_vec
641 sparc64-*-linux-gnu*)
642 targ_defvec=bfd_elf64_sparc_vec
643 targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
646 targ_defvec=bfd_elf64_sparc_vec
647 targ_selvecs=bfd_elf32_sparc_vec
651 targ_defvec=sparccoff_vec
653 sparc*-*-* | sparc*-*-rtems*)
654 targ_defvec=sunos_big_vec
658 #if HAVE_host_aout_vec
660 targ_defvec=host_aout_vec
666 targ_defvec=tic80coff_vec
672 targ_defvec=bfd_elf32_v850_vec
675 targ_defvec=bfd_elf32_v850_vec
678 targ_defvec=bfd_elf32_v850_vec
680 #if HAVE_host_aout_vec
681 vax-*-bsd* | vax-*-ultrix*)
682 targ_defvec=host_aout_vec
688 targ_defvec=vms_vax_vec
692 targ_defvec=we32kcoff_vec
700 targ_defvec=z8kcoff_vec
709 targ_defvec=a_out_adobe_vec
714 targ_defvec=newsos3_vec
719 targ_defvec=m68kcoff_vec
720 targ_selvecs=ieee_vec
724 echo 1>&2 "*** BFD does not support target ${targ}."
725 echo 1>&2 "*** Look in bfd/config.bfd for supported targets."
730 # If we support any ELF target, then automatically add support for the
731 # generic ELF targets. This permits an objdump with some ELF support
732 # to be used on an arbitrary ELF file for anything other than
733 # relocation information.
734 case "${targ_defvec} ${targ_selvecs}" in
736 targ_selvecs="${targ_selvecs} bfd_elf64_little_generic_vec bfd_elf64_big_generic_vec bfd_elf32_little_generic_vec bfd_elf32_big_generic_vec"
739 targ_selvecs="${targ_selvecs} bfd_elf32_little_generic_vec bfd_elf32_big_generic_vec"