1# config.bfd
2#
3#   Copyright (C) 2012-2020 Free Software Foundation, Inc.
4#
5# This file is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; see the file COPYING3.  If not see
17# <http://www.gnu.org/licenses/>.
18#
19# Convert a canonical host type into a BFD host type.
20# Set shell variable targ to canonical target name, and run
21# using ``. config.bfd''.
22# Sets the following shell variables:
23#  targ_defvec		Default vector for this target
24#  targ_selvecs		Vectors to build for this target
25#  targ64_selvecs	Vectors to build if --enable-64-bit-bfd is given
26#			or if host is 64 bit.
27#  targ_archs		Architectures for this target
28#  targ_cflags		$(CFLAGS) for this target (FIXME: pretty bogus)
29#  targ_underscore	Whether underscores are used: yes or no
30
31# Part of this file is processed by targmatch.sed to generate the
32# targmatch.h file.  The #ifdef and #endif lines that appear below are
33# copied directly into targmatch.h.
34
35# The binutils c++filt program wants to know whether underscores are
36# stripped or not.  That is why we set targ_underscore.  c++filt uses
37# this information to choose a default.  This information is
38# duplicated in the symbol_leading_char field of the BFD target
39# vector, but c++filt does not deal with object files and is not
40# linked against libbfd.a.  It is not terribly important that c++filt
41# get this right; it is just convenient.
42
43targ_defvec=
44targ_selvecs=
45targ64_selvecs=
46targ_cflags=
47targ_underscore=no
48
49# Catch obsolete configurations.
50case $targ in
51 openrisc-*-* | or32-*-*)
52    echo "*** Configuration $targ is obsolete." >&2
53    echo "*** Use or1k-*-elf or or1k-*-linux as the target instead" >&2
54    exit 1
55    ;;
56 c30-*-*aout* | tic30-*-*aout* | \
57 null)
58    if test "x$enable_obsolete" != xyes; then
59      echo "*** Configuration $targ is obsolete." >&2
60      echo "*** Specify --enable-obsolete to build it anyway." >&2
61      echo "*** Support will be REMOVED in the next major release of BINUTILS," >&2
62      echo "*** unless a maintainer comes forward." >&2
63      exit 1
64    fi;;
65esac
66
67case $targ in
68 *-*-netbsdelf* | i[3-7]86-*-netbsd*-gnu* | i[3-7]86-*-knetbsd*-gnu | \
69 mips*-*-irix5* | mips*-*-irix6*)
70    # Not obsolete
71    ;;
72 *-adobe-* | \
73 *-go32-rtems* | \
74 *-sony-* | \
75 *-tandem-* | \
76 *-*-ieee* | \
77 *-*-netware* | \
78 *-*-rtemsaout* | \
79 *-*-rtemscoff* | \
80 a29k-* | \
81 arm*-*-aout | \
82 arm-*-coff | \
83 arm-*-netbsd* | \
84 arm-*-openbsd* | \
85 arm-*-oabi | \
86 arm-*-riscix* | \
87 arm-epoc-pe* | \
88 cr16c-*-* | \
89 h8300*-*-coff | \
90 h8500*-*-coff | \
91 hppa*-*-rtems* | \
92 i[3-7]86-*-unixware* | \
93 i[3-7]86-*-dgux* | \
94 i[3-7]86-*-chorus* | \
95 i[3-7]86-*-sysv* | \
96 i[3-7]86-*-isc* | \
97 i[3-7]86-*-sco* | \
98 i[3-7]86-*-coff | \
99 i[3-7]86-*-aix* | \
100 i[3-7]86-sequent-bsd* | \
101 i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | i[3-7]86-*-freebsd[12] | \
102 i[3-7]86-*-netbsdaout* | i[3-7]86-*-netbsd* | \
103 i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3] | \
104 i[3-7]86-*-linux*aout* | \
105 i[3-7]86-*-mach* | i[3-7]86-*-osf1mk* | \
106 i[3-7]86-*-os9k | \
107 i[3-7]86-none-* | \
108 i[3-7]86-*-aout* | i[3-7]86*-*-vsta* | \
109 i370-* | \
110 i860-*-* | \
111 i960-*-* | \
112 m68*-*-*bsd* | \
113 m68*-*-aout* | \
114 m68*-*-coff* | \
115 m68*-*-hpux* | \
116 m68*-*-linux*aout* | \
117 m68*-*-lynxos* | \
118 m68*-*-os68k* | \
119 m68*-*-psos* | \
120 m68*-*-sunos* | \
121 m68*-*-sysv* | \
122 m68*-*-vsta* | \
123 m68*-*-vxworks* | \
124 m68*-apollo-* | \
125 m68*-apple-aux* | \
126 m68*-bull-sysv* | \
127 m68*-ericsson-* | \
128 m68*-motorola-sysv* | \
129 m68*-netx-* | \
130 m88*-*-* | \
131 maxq-*-coff | \
132 mips*-*-bsd* | \
133 mips*-*-ecoff* | \
134 mips*-*-lnews* | \
135 mips*-*-mach3* | \
136 mips*-*-pe* | \
137 mips*-*-riscos* | \
138 mips*-*-sysv* | \
139 mips*-big-* | \
140 mips*-dec-* | \
141 mips*-sgi-* | \
142 mips*el-*-rtems* | \
143 powerpc-*-lynxos* | powerpc-*-windiss* | \
144 sh*-*-symbianelf* | sh5*-*-* | sh64*-*-* | \
145 sparc*-*-*aout* | \
146 sparc*-*-chorus* | \
147 sparc*-*-coff* | \
148 sparc-*-lynxos* | \
149 sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1] | \
150 tahoe-*-* | \
151 vax-*-bsd* | vax-*-ultrix* | vax-*-vms* | \
152 w65-*-* | \
153 we32k-*-* | \
154 null)
155    echo "*** Configuration $targ is obsolete." >&2
156    echo "*** Support has been REMOVED." >&2
157    exit 1
158    ;;
159esac
160
161targ_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
162case "${targ_cpu}" in
163aarch64*)	 targ_archs="bfd_aarch64_arch bfd_arm_arch";;
164alpha*)		 targ_archs=bfd_alpha_arch ;;
165am33_2.0*)	 targ_archs=bfd_mn10300_arch ;;
166arc*)		 targ_archs=bfd_arc_arch ;;
167arm*)		 targ_archs=bfd_arm_arch ;;
168bfin*)		 targ_archs=bfd_bfin_arch ;;
169c30*)		 targ_archs=bfd_tic30_arch ;;
170c4x*)		 targ_archs=bfd_tic4x_arch ;;
171c54x*)		 targ_archs=bfd_tic54x_arch ;;
172cr16*)		 targ_archs=bfd_cr16_arch ;;
173crisv32)	 targ_archs=bfd_cris_arch ;;
174crx*)		 targ_archs=bfd_crx_arch ;;
175csky*)		 targ_archs=bfd_csky_arch ;;
176dlx*)		 targ_archs=bfd_dlx_arch ;;
177fido*)		 targ_archs=bfd_m68k_arch ;;
178hppa*)		 targ_archs=bfd_hppa_arch ;;
179i[3-7]86)	 targ_archs=bfd_i386_arch ;;
180ia16)		 targ_archs=bfd_i386_arch ;;
181lm32)	         targ_archs=bfd_lm32_arch ;;
182m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch bfd_m9s12x_arch bfd_m9s12xg_arch" ;;
183m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch bfd_m9s12x_arch bfd_m9s12xg_arch" ;;
184m68*)		 targ_archs=bfd_m68k_arch ;;
185s12z*)         targ_archs=bfd_s12z_arch ;;
186microblaze*)	 targ_archs=bfd_microblaze_arch ;;
187mips*)		 targ_archs=bfd_mips_arch ;;
188nds32*)		 targ_archs=bfd_nds32_arch ;;
189nfp)		 targ_archs=bfd_nfp_arch ;;
190nios2*)          targ_archs=bfd_nios2_arch ;;
191or1k*|or1knd*)	 targ_archs=bfd_or1k_arch ;;
192pdp11*)		 targ_archs=bfd_pdp11_arch ;;
193pj*)		 targ_archs="bfd_pj_arch bfd_i386_arch";;
194powerpc*)	 targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
195pru*)		 targ_archs=bfd_pru_arch ;;
196riscv*)		 targ_archs=bfd_riscv_arch ;;
197rs6000)		 targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
198s390*)		 targ_archs=bfd_s390_arch ;;
199sh*)		 targ_archs=bfd_sh_arch ;;
200sparc*)		 targ_archs=bfd_sparc_arch ;;
201spu*)            targ_archs=bfd_spu_arch ;;
202tilegx*)	 targ_archs=bfd_tilegx_arch ;;
203tilepro*)	 targ_archs=bfd_tilepro_arch ;;
204v850*)		 targ_archs="bfd_v850_arch bfd_v850_rh850_arch" ;;
205visium*)	 targ_archs=bfd_visium_arch ;;
206wasm32)		 targ_archs=bfd_wasm32_arch ;;
207x86_64*)	 targ_archs=bfd_i386_arch ;;
208xtensa*)	 targ_archs=bfd_xtensa_arch ;;
209xgate)		 targ_archs=bfd_xgate_arch ;;
210z80*|r800|z180|gbz80|ez80*)	 targ_archs=bfd_z80_arch ;;
211z8k*)		 targ_archs=bfd_z8k_arch ;;
212*)		 targ_archs=bfd_${targ_cpu}_arch ;;
213esac
214
215
216# WHEN ADDING ENTRIES TO THIS MATRIX:
217#  Make sure that the left side always has two dashes.  Otherwise you
218#  can get spurious matches.  Even for unambiguous cases, do this as a
219#  convention, else the table becomes a real mess to understand and maintain.
220
221case "${targ}" in
222# START OF targmatch.h
223#ifdef BFD64
224  aarch64-*-darwin*)
225    targ_defvec=aarch64_mach_o_vec
226    targ_selvecs="arm_mach_o_vec mach_o_le_vec mach_o_be_vec mach_o_fat_vec"
227    targ_archs="$targ_archs bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch"
228    want64=true
229    ;;
230  aarch64-*-elf | aarch64-*-rtems*)
231    targ_defvec=aarch64_elf64_le_vec
232    targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec"
233    want64=true
234    ;;
235  aarch64_be-*-elf)
236    targ_defvec=aarch64_elf64_be_vec
237    targ_selvecs="aarch64_elf64_le_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_be_vec arm_elf32_le_vec"
238    want64=true
239    ;;
240  aarch64-*-freebsd*)
241    targ_defvec=aarch64_elf64_le_vec
242    targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"
243    want64=true
244    ;;
245  aarch64-*-fuchsia*)
246    targ_defvec=aarch64_elf64_le_vec
247    targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"
248    want64=true
249    ;;
250  aarch64-*-cloudabi*)
251    targ_defvec=aarch64_elf64_le_cloudabi_vec
252    targ_selvecs=aarch64_elf64_be_cloudabi_vec
253    want64=true
254    ;;
255  aarch64-*-linux*)
256    targ_defvec=aarch64_elf64_le_vec
257    targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec"
258    want64=true
259    ;;
260  aarch64_be-*-linux*)
261    targ_defvec=aarch64_elf64_be_vec
262    targ_selvecs="aarch64_elf64_le_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_be_vec arm_elf32_le_vec"
263    want64=true
264    ;;
265  alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
266    targ_defvec=alpha_elf64_fbsd_vec
267    targ_selvecs="alpha_elf64_vec alpha_ecoff_le_vec"
268    want64=true
269    # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
270    case "${targ}" in
271      alpha*-*-freebsd3* | alpha*-*-freebsd4 | alpha*-*-freebsd4.0*)
272	targ_cflags=-DOLD_FREEBSD_ABI_LABEL ;;
273    esac
274    ;;
275  alpha*-*-netbsd* | alpha*-*-openbsd*)
276    targ_defvec=alpha_elf64_vec
277    targ_selvecs=alpha_ecoff_le_vec
278    want64=true
279    ;;
280  alpha*-*-linux*ecoff*)
281    targ_defvec=alpha_ecoff_le_vec
282    targ_selvecs=alpha_elf64_vec
283    want64=true
284    ;;
285  alpha*-*-linux-* | alpha*-*-elf*)
286    targ_defvec=alpha_elf64_vec
287    targ_selvecs=alpha_ecoff_le_vec
288    want64=true
289    ;;
290  alpha*-*-*vms*)
291    targ_defvec=alpha_vms_vec
292    targ_selvecs=alpha_vms_lib_txt_vec
293    want64=true
294    ;;
295  alpha*-*-*)
296    targ_defvec=alpha_ecoff_le_vec
297    want64=true
298    ;;
299  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
300    targ_defvec=ia64_elf64_le_vec
301    targ_selvecs="ia64_elf64_be_vec ia64_pei_vec"
302    want64=true
303    ;;
304  ia64*-*-hpux*)
305    targ_defvec=ia64_elf32_hpux_be_vec
306    targ_selvecs="ia64_elf64_hpux_be_vec"
307    want64=true
308    ;;
309  ia64*-*-*vms*)
310    targ_defvec=ia64_elf64_vms_vec
311    targ_selvecs=alpha_vms_lib_txt_vec
312    want64=true
313    ;;
314#endif /* BFD64 */
315
316  am33_2.0-*-linux*)
317    targ_defvec=am33_elf32_linux_vec
318    ;;
319
320  arc*eb-*-elf* | arc*eb-*-linux*)
321    targ_defvec=arc_elf32_be_vec
322    targ_selvecs=arc_elf32_le_vec
323    ;;
324
325  arc*-*-elf* | arc*-*-linux*)
326    targ_defvec=arc_elf32_le_vec
327    targ_selvecs=arc_elf32_be_vec
328    ;;
329
330  arm-*-darwin*)
331    targ_defvec=arm_mach_o_vec
332    targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec"
333    targ_archs="$targ_archs bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch"
334    ;;
335  arm-*-fuchsia*)
336    targ_defvec=arm_elf32_le_vec
337    targ_selvecs="arm_elf32_be_vec"
338    ;;
339  arm-*-nacl*)
340    targ_defvec=arm_elf32_nacl_le_vec
341    targ_selvecs="arm_elf32_nacl_be_vec i386_elf32_nacl_vec"
342    targ64_selvecs="x86_64_elf32_nacl_vec x86_64_elf64_nacl_vec"
343    targ_archs="$targ_archs bfd_i386_arch"
344    ;;
345  armeb-*-nacl*)
346    targ_defvec=arm_elf32_nacl_be_vec
347    targ_selvecs="arm_elf32_nacl_le_vec i386_elf32_nacl_vec"
348    targ64_selvecs="x86_64_elf32_nacl_vec x86_64_elf64_nacl_vec"
349    targ_archs="$targ_archs bfd_i386_arch"
350    ;;
351  armeb-*-netbsdelf*)
352    targ_defvec=arm_elf32_be_vec
353    targ_selvecs="arm_elf32_le_vec"
354    ;;
355  arm-*-netbsdelf*)
356    targ_defvec=arm_elf32_le_vec
357    targ_selvecs="arm_elf32_be_vec"
358    ;;
359  arm-*-nto* | nto*arm*)
360    targ_defvec=arm_elf32_le_vec
361    targ_selvecs=arm_elf32_be_vec
362    targ_cflags=-D__QNXTARGET__
363    ;;
364  arm-wince-pe | arm-*-wince | arm*-*-mingw32ce* | arm*-*-cegcc*)
365    targ_defvec=arm_pe_wince_le_vec
366    targ_selvecs="arm_pe_wince_le_vec arm_pe_wince_be_vec arm_pei_wince_le_vec arm_pei_wince_be_vec"
367    targ_underscore=no
368    targ_cflags="-DARM_WINCE -DARM_COFF_BUGFIX"
369    ;;
370  arm-*-pe*)
371    targ_defvec=arm_pe_le_vec
372    targ_selvecs="arm_pe_le_vec arm_pe_be_vec arm_pei_le_vec arm_pei_be_vec"
373    targ_underscore=yes
374    ;;
375  arm-*-phoenix*)
376    targ_defvec=arm_elf32_le_vec
377    targ_selvecs=arm_elf32_be_vec
378    ;;
379  armeb-*-elf | arm*b-*-freebsd* | arm*b-*-linux-* | armeb-*-eabi*)
380    targ_defvec=arm_elf32_be_vec
381    targ_selvecs=arm_elf32_le_vec
382    ;;
383  arm-*-kaos*)
384    targ_defvec=arm_elf32_le_vec
385    targ_selvecs=arm_elf32_be_vec
386    ;;
387  arm-*-elf | arm*-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \
388  arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \
389  arm*-*-eabi* | arm-*-rtems* | arm*-*-uclinuxfdpiceabi)
390    targ_defvec=arm_elf32_le_vec
391    targ_selvecs="arm_elf32_fdpic_le_vec arm_elf32_be_vec arm_elf32_fdpic_be_vec"
392    ;;
393  arm*-*-vxworks | arm*-*-windiss)
394    targ_defvec=arm_elf32_vxworks_le_vec
395    targ_selvecs=arm_elf32_vxworks_be_vec
396    ;;
397  arm*-*-symbianelf*)
398    targ_defvec=arm_elf32_symbian_le_vec
399    targ_selvecs=arm_elf32_symbian_be_vec
400    ;;
401  arm9e-*-elf)
402    targ_defvec=arm_elf32_le_vec
403    targ_selvecs=arm_elf32_be_vec
404    ;;
405
406  avr-*-*)
407    targ_defvec=avr_elf32_vec
408    ;;
409
410  bfin-*-*)
411    targ_defvec=bfin_elf32_vec
412    targ_selvecs=bfin_elf32_fdpic_vec
413    targ_underscore=yes
414    ;;
415
416  c30-*-*aout* | tic30-*-*aout*)
417    targ_defvec=tic30_aout_vec
418    ;;
419  c30-*-*coff* | tic30-*-*coff*)
420    targ_defvec=tic30_coff_vec
421    ;;
422
423  c4x-*-*coff* | tic4x-*-*coff*)
424    targ_defvec=tic4x_coff1_vec
425    targ_selvecs="tic4x_coff1_beh_vec tic4x_coff2_vec tic4x_coff2_beh_vec tic4x_coff0_vec tic4x_coff0_beh_vec"
426    targ_underscore=yes
427    ;;
428
429  c54x*-*-*coff* | tic54x-*-*coff*)
430    targ_defvec=tic54x_coff1_vec
431    targ_selvecs="tic54x_coff1_beh_vec tic54x_coff2_vec tic54x_coff2_beh_vec tic54x_coff0_vec tic54x_coff0_beh_vec"
432    targ_underscore=yes
433    ;;
434
435  cr16-*-elf* | cr16*-*-uclinux*)
436    targ_defvec=cr16_elf32_vec
437    targ_underscore=yes
438    ;;
439
440#ifdef BFD64
441  cris-*-* | crisv32-*-*)
442    targ_defvec=cris_aout_vec
443    targ_selvecs="cris_elf32_us_vec cris_elf32_vec"
444    case "${targ}" in
445	*-*-linux*) ;;
446	*) targ_underscore=yes ;;
447    esac
448    want64=true
449    ;;
450#endif
451
452  crx-*-elf*)
453    targ_defvec=crx_elf32_vec
454    targ_underscore=yes
455    ;;
456
457  csky-*-elf* | csky-*-linux* )
458    targ_defvec=csky_elf32_le_vec
459    targ_selvecs="csky_elf32_be_vec csky_elf32_le_vec"
460    ;;
461
462  d10v-*-*)
463    targ_defvec=d10v_elf32_vec
464    ;;
465
466  dlx-*-elf*)
467    targ_defvec=dlx_elf32_be_vec
468    targ_selvecs="dlx_elf32_be_vec"
469    ;;
470
471  d30v-*-*)
472    targ_defvec=d30v_elf32_vec
473    ;;
474
475#ifdef BFD64
476  bpf-*-none)
477    targ_defvec=bpf_elf64_le_vec
478    targ_selvecs=bpf_elf64_be_vec
479    targ_underscore=yes
480    ;;
481#endif
482
483  epiphany-*-*)
484    targ_defvec=epiphany_elf32_vec
485    targ_underscore=yes
486    ;;
487
488  fido-*-elf* )
489    targ_defvec=m68k_elf32_vec
490    ;;
491
492  fr30-*-elf)
493    targ_defvec=fr30_elf32_vec
494    ;;
495
496  frv-*-elf)
497    targ_defvec=frv_elf32_vec
498    targ_selvecs=frv_elf32_fdpic_vec
499    ;;
500
501  frv-*-*linux*)
502    targ_defvec=frv_elf32_fdpic_vec
503    targ_selvecs=frv_elf32_vec
504    ;;
505
506  moxie-*-elf | moxie-*-rtems* | moxie-*-uclinux)
507    targ_defvec=moxie_elf32_be_vec
508    targ_selvecs=moxie_elf32_le_vec
509    ;;
510
511  moxie-*-moxiebox*)
512    targ_defvec=moxie_elf32_le_vec
513    ;;
514
515  h8300*-*-elf | h8300*-*-rtems*)
516    targ_defvec=h8300_elf32_vec
517    targ_underscore=yes
518    ;;
519
520  h8300*-*-linux*)
521    targ_defvec=h8300_elf32_linux_vec
522    ;;
523
524#ifdef BFD64
525  hppa*64*-*-linux-*)
526    targ_defvec=hppa_elf64_linux_vec
527    targ_selvecs=hppa_elf64_vec
528    want64=true
529    ;;
530  hppa*64*-*-hpux11*)
531    targ_defvec=hppa_elf64_vec
532    targ_selvecs=hppa_elf64_linux_vec
533    targ_cflags=-DHPUX_LARGE_AR_IDS
534    want64=true
535    ;;
536#endif
537
538  hppa*-*-linux-*)
539    targ_defvec=hppa_elf32_linux_vec
540    targ_selvecs=hppa_elf32_vec
541    ;;
542  hppa*-*-netbsd*)
543    targ_defvec=hppa_elf32_nbsd_vec
544    targ_selvecs="hppa_elf32_vec hppa_elf32_linux_vec"
545    ;;
546  hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-openbsd*)
547    targ_defvec=hppa_elf32_vec
548    targ_selvecs=hppa_elf32_linux_vec
549    ;;
550
551  hppa*-*-bsd*)
552    targ_defvec=hppa_som_vec
553    targ_selvecs=hppa_elf32_vec
554    ;;
555  hppa*-*-hpux* | hppa*-*-hiux* | hppa*-*-mpeix*)
556    targ_defvec=hppa_som_vec
557    ;;
558  hppa*-*-osf*)
559    targ_defvec=hppa_som_vec
560    targ_selvecs=hppa_elf32_vec
561    ;;
562
563  i[3-7]86-*-elf* | i[3-7]86-*-rtems*)
564    targ_defvec=i386_elf32_vec
565    targ_selvecs="iamcu_elf32_vec i386_coff_vec"
566    ;;
567  i[3-7]86-*-solaris2*)
568    targ_defvec=i386_elf32_sol2_vec
569    targ_selvecs="iamcu_elf32_vec i386_coff_vec i386_pei_vec"
570    targ64_selvecs="x86_64_elf64_sol2_vec l1om_elf64_vec k1om_elf64_vec x86_64_pei_vec"
571    want64=true
572    ;;
573#ifdef BFD64
574  x86_64-*-solaris2*)
575    targ_defvec=i386_elf32_sol2_vec
576    targ_selvecs="x86_64_elf64_sol2_vec l1om_elf64_vec k1om_elf64_vec iamcu_elf32_vec i386_coff_vec i386_pei_vec x86_64_pei_vec"
577    want64=true
578    ;;
579#endif
580  i[3-7]86-*-nto*)
581    targ_defvec=i386_elf32_vec
582    targ_selvecs="iamcu_elf32_vec i386_coff_vec"
583    ;;
584  i[3-7]86-*-aros*)
585    targ_defvec=i386_elf32_vec
586    targ_selvecs=iamcu_elf32_vec
587    ;;
588  i[3-7]86-*-dicos*)
589    targ_defvec=i386_elf32_vec
590    targ_selvecs=iamcu_elf32_vec
591    targ64_selvecs="x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec"
592    ;;
593  *-*-msdosdjgpp* | *-*-go32* )
594    targ_defvec=i386_coff_go32_vec
595    targ_selvecs="i386_coff_go32stubbed_vec i386_aout_vec"
596    ;;
597  i[3-7]86-*-darwin* | i[3-7]86-*-macos10* | i[3-7]86-*-rhapsody*)
598    targ_defvec=i386_mach_o_vec
599    targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
600    targ64_selvecs=x86_64_mach_o_vec
601    targ_archs="$targ_archs bfd_powerpc_arch bfd_rs6000_arch"
602    ;;
603  i[3-7]86-*-bsd*)
604    targ_defvec=i386_aout_bsd_vec
605    targ_underscore=yes
606    ;;
607  i[3-7]86-*-dragonfly*)
608    targ_defvec=i386_elf32_vec
609    targ_selvecs=iamcu_elf32_vec
610    targ64_selvecs="x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec"
611    ;;
612  i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
613    targ_defvec=i386_elf32_fbsd_vec
614    targ_selvecs="i386_elf32_vec iamcu_elf32_vec i386_pei_vec i386_coff_vec"
615    targ64_selvecs="x86_64_elf64_fbsd_vec x86_64_elf64_vec x86_64_pei_vec l1om_elf64_vec l1om_elf64_fbsd_vec k1om_elf64_vec k1om_elf64_fbsd_vec"
616    # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
617    case "${targ}" in
618      i[3-7]86-*-freebsd3* | i[3-7]86-*-freebsd4 | i[3-7]86-*-freebsd4.0*)
619	targ_cflags=-DOLD_FREEBSD_ABI_LABEL ;;
620    esac
621    ;;
622  i[3-7]86-*-netbsdelf* | i[3-7]86-*-netbsd*-gnu* | i[3-7]86-*-knetbsd*-gnu)
623    targ_defvec=i386_elf32_vec
624    targ_selvecs="iamcu_elf32_vec"
625    targ64_selvecs="x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec"
626    ;;
627  i[3-7]86-*-netbsdpe*)
628    targ_defvec=i386_pe_vec
629    targ_selvecs="i386_pe_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec"
630    ;;
631  i[3-7]86-*-openbsd*)
632    targ_defvec=i386_elf32_vec
633    targ_selvecs="iamcu_elf32_vec"
634    ;;
635  i[3-7]86-*-linux-*)
636    targ_defvec=i386_elf32_vec
637    targ_selvecs="iamcu_elf32_vec i386_pei_vec"
638    targ64_selvecs="x86_64_elf64_vec x86_64_elf32_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
639    ;;
640  i[3-7]86-*-nacl*)
641    targ_defvec=i386_elf32_nacl_vec
642    targ_selvecs="arm_elf32_nacl_be_vec arm_elf32_nacl_le_vec"
643    targ64_selvecs="x86_64_elf64_nacl_vec x86_64_elf32_nacl_vec"
644    targ_archs="$targ_archs bfd_arm_arch"
645    ;;
646  i[3-7]86-*-redox*)
647    targ_defvec=i386_elf32_vec
648    targ_selvecs=
649    targ64_selvecs=x86_64_elf64_vec
650    ;;
651#ifdef BFD64
652  x86_64-*-cloudabi*)
653    targ_defvec=x86_64_elf64_cloudabi_vec
654    want64=true
655    ;;
656  x86_64-*-darwin*)
657    targ_defvec=x86_64_mach_o_vec
658    targ_selvecs="i386_mach_o_vec mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
659    targ_archs="$targ_archs bfd_powerpc_arch bfd_rs6000_arch"
660    want64=true
661    ;;
662  x86_64-*-dicos*)
663    targ_defvec=x86_64_elf64_vec
664    targ_selvecs="i386_elf32_vec iamcu_elf32_vec l1om_elf64_vec k1om_elf64_vec"
665    want64=true
666    ;;
667  x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia)
668    targ_defvec=x86_64_elf64_vec
669    targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec l1om_elf64_vec k1om_elf64_vec"
670    case "${targ}" in
671      x86_64-*-rtems*)
672    targ_selvecs="${targ_selvecs} x86_64_pei_vec"
673    esac
674    want64=true
675    ;;
676  x86_64-*-dragonfly*)
677    targ_defvec=x86_64_elf64_vec
678    targ_selvecs="i386_elf32_vec iamcu_elf32_vec l1om_elf64_vec k1om_elf64_vec x86_64_pei_vec"
679    want64=true
680    ;;
681  x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
682    targ_defvec=x86_64_elf64_fbsd_vec
683    targ_selvecs="i386_elf32_fbsd_vec iamcu_elf32_vec i386_coff_vec i386_pei_vec x86_64_pei_vec i386_elf32_vec x86_64_elf64_vec l1om_elf64_vec l1om_elf64_fbsd_vec k1om_elf64_vec k1om_elf64_fbsd_vec"
684    want64=true
685    ;;
686  x86_64-*-netbsd* | x86_64-*-openbsd*)
687    targ_defvec=x86_64_elf64_vec
688    targ_selvecs="i386_elf32_vec iamcu_elf32_vec i386_coff_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
689    want64=true
690    ;;
691  x86_64-*-linux-*)
692    targ_defvec=x86_64_elf64_vec
693    targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
694    want64=true
695    ;;
696  x86_64-*-nacl*)
697    targ_defvec=x86_64_elf32_nacl_vec
698    targ_selvecs="i386_elf32_nacl_vec x86_64_elf64_nacl_vec arm_elf32_nacl_be_vec arm_elf32_nacl_le_vec"
699    targ_archs="$targ_archs bfd_arm_arch"
700    want64=true
701    ;;
702  x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin)
703    targ_defvec=x86_64_pe_vec
704    targ_selvecs="x86_64_pe_vec x86_64_pei_vec x86_64_pe_be_vec x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec i386_pe_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec"
705    want64=true
706    targ_underscore=no
707    ;;
708  x86_64-*-rdos*)
709    targ_defvec=x86_64_elf64_vec
710    want64=true
711    ;;
712  x86_64-*-redox*)
713    targ_defvec=x86_64_elf64_vec
714    targ_selvecs=i386_elf32_vec
715    want64=true
716    ;;
717#endif
718  i[3-7]86-*-lynxos*)
719    targ_defvec=i386_elf32_vec
720    targ_selvecs="iamcu_elf32_vec i386_coff_lynx_vec i386_aout_lynx_vec"
721    ;;
722  i[3-7]86-*-gnu*)
723    targ_defvec=i386_elf32_vec
724    targ_selvecs=iamcu_elf32_vec
725    ;;
726  i[3-7]86-*-msdos*)
727    targ_defvec=i386_aout_vec
728    targ_selvecs=i386_msdos_vec
729    ;;
730  i[3-7]86-*-moss*)
731    targ_defvec=i386_elf32_vec
732    targ_selvecs="iamcu_elf32_vec i386_msdos_vec i386_aout_vec"
733    ;;
734  i[3-7]86-*-beospe*)
735    targ_defvec=i386_pe_vec
736    targ_selvecs="i386_pe_vec i386_pei_vec"
737    ;;
738  i[3-7]86-*-beoself* | i[3-7]86-*-beos*)
739    targ_defvec=i386_elf32_vec
740    targ_selvecs="iamcu_elf32_vec i386_pe_vec i386_pei_vec"
741    ;;
742  i[3-7]86-*-interix*)
743    targ_defvec=i386_pei_vec
744    targ_selvecs="i386_pe_vec"
745    # FIXME: This should eventually be checked at runtime.
746    targ_cflags=-DSTRICT_PE_FORMAT
747    ;;
748  i[3-7]86-*-rdos*)
749    targ_defvec=i386_elf32_vec
750    targ_selvecs="iamcu_elf32_vec i386_coff_vec"
751    ;;
752  i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe)
753    targ_defvec=i386_pe_vec
754    targ_selvecs="i386_pe_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec"
755    targ_underscore=yes
756    ;;
757  i[3-7]86-*-vxworks*)
758    targ_defvec=i386_elf32_vxworks_vec
759    targ_underscore=yes
760    ;;
761
762  ia16-*-elf)
763    targ_defvec=i386_elf32_vec
764    targ_selvecs="i386_msdos_vec i386_aout_vec"
765    ;;
766
767  ip2k-*-elf)
768    targ_defvec=ip2k_elf32_vec
769    targ_underscore=yes
770    ;;
771
772  iq2000-*-elf)
773    targ_defvec=iq2000_elf32_vec
774    ;;
775
776  lm32-*-elf | lm32-*-rtems*)
777    targ_defvec=lm32_elf32_vec
778    targ_selvecs=lm32_elf32_fdpic_vec
779    ;;
780
781  lm32-*-*linux*)
782    targ_defvec=lm32_elf32_fdpic_vec
783    targ_selvecs=lm32_elf32_vec
784    ;;
785
786  m32c-*-elf | m32c-*-rtems*)
787    targ_defvec=m32c_elf32_vec
788    targ_underscore=yes
789    ;;
790
791  m32r*le-*-linux*)
792    targ_defvec=m32r_elf32_linux_le_vec
793    targ_selvecs="m32r_elf32_linux_vec  m32r_elf32_linux_le_vec"
794    ;;
795  m32r*-*-linux*)
796    targ_defvec=m32r_elf32_linux_vec
797    targ_selvecs="m32r_elf32_linux_vec  m32r_elf32_linux_le_vec"
798    ;;
799  m32r*le-*-*)
800    targ_defvec=m32r_elf32_le_vec
801    targ_selvecs="m32r_elf32_vec m32r_elf32_le_vec"
802    ;;
803  m32r-*-*)
804    targ_defvec=m32r_elf32_vec
805    ;;
806
807  m68hc11-*-* | m6811-*-*)
808    targ_defvec=m68hc11_elf32_vec
809    targ_selvecs="m68hc11_elf32_vec m68hc12_elf32_vec"
810    ;;
811  m68hc12-*-* | m6812-*-*)
812    targ_defvec=m68hc12_elf32_vec
813    targ_selvecs="m68hc11_elf32_vec m68hc12_elf32_vec"
814    ;;
815
816  m68*-*-*)
817    targ_defvec=m68k_elf32_vec
818    ;;
819
820  s12z-*-*)
821    targ_defvec=s12z_elf32_vec
822    ;;
823  mcore-*-elf)
824    targ_defvec=mcore_elf32_be_vec
825    targ_selvecs="mcore_elf32_be_vec mcore_elf32_le_vec"
826    ;;
827  mcore-*-pe)
828    targ_defvec=mcore_pe_be_vec
829    targ_selvecs="mcore_pe_be_vec mcore_pe_le_vec mcore_pei_be_vec mcore_pei_le_vec"
830    ;;
831
832  mep-*-elf)
833    targ_defvec=mep_elf32_vec
834    targ_selvecs=mep_elf32_le_vec
835    ;;
836
837  metag-*-*)
838    targ_defvec=metag_elf32_vec
839    targ_underscore=yes
840    ;;
841
842  microblazeel*-*)
843    targ_defvec=microblaze_elf32_le_vec
844    targ_selvecs=microblaze_elf32_vec
845    ;;
846
847  microblaze*-*)
848    targ_defvec=microblaze_elf32_vec
849    targ_selvecs=microblaze_elf32_le_vec
850    ;;
851
852#ifdef BFD64
853  mips*el-*-netbsd*)
854    targ_defvec=mips_elf32_trad_le_vec
855    targ_selvecs="mips_elf32_trad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
856    ;;
857  mips*-*-netbsd*)
858    targ_defvec=mips_elf32_trad_be_vec
859    targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
860    ;;
861  mips*-*-irix6*)
862    targ_defvec=mips_elf32_n_be_vec
863    targ_selvecs="mips_elf32_n_le_vec mips_elf32_be_vec mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
864    ;;
865  mips64*-ps2-elf*)
866    targ_defvec=mips_elf32_n_le_vec
867    targ_selvecs="mips_elf32_n_le_vec mips_elf32_n_be_vec mips_elf32_be_vec mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
868    ;;
869  mips*-ps2-elf*)
870    targ_defvec=mips_elf32_le_vec
871    targ_selvecs="mips_elf32_be_vec mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
872    ;;
873  mips*-*-irix5*)
874    targ_defvec=mips_elf32_be_vec
875    targ_selvecs="mips_elf32_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
876    ;;
877  mips*el-*-vxworks*)
878    targ_defvec=mips_elf32_vxworks_le_vec
879    targ_selvecs="mips_elf32_le_vec mips_elf32_vxworks_be_vec mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec"
880    ;;
881  mips*-*-vxworks*)
882    targ_defvec=mips_elf32_vxworks_be_vec
883    targ_selvecs="mips_elf32_be_vec mips_elf32_vxworks_le_vec mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec"
884    ;;
885  mips*el-sde-elf*)
886    targ_defvec=mips_elf32_trad_le_vec
887    targ_selvecs="mips_elf32_trad_be_vec mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
888    ;;
889  mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
890    targ_defvec=mips_elf32_trad_be_vec
891    targ_selvecs="mips_elf32_trad_le_vec mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
892    ;;
893  mips*el-*-elf* | mips*-*-chorus*)
894    targ_defvec=mips_elf32_le_vec
895    targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec"
896    ;;
897  mips*-*-elf* | mips*-*-rtems* | mips*-*-windiss | mips*-*-none)
898    targ_defvec=mips_elf32_be_vec
899    targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
900    ;;
901  mips64*-*-openbsd*)
902    targ_defvec=mips_elf64_trad_be_vec
903    targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec"
904    ;;
905  mips*el-*-openbsd*)
906    targ_defvec=mips_elf32_le_vec
907    targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
908    ;;
909  mips*-*-openbsd*)
910    targ_defvec=mips_elf32_be_vec
911    targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
912    ;;
913  mips64*el-*-linux*)
914    targ_defvec=mips_elf32_ntrad_le_vec
915    targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
916    ;;
917  mips64*-*-linux*)
918    targ_defvec=mips_elf32_ntrad_be_vec
919    targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
920    ;;
921  mips*el-*-linux*)
922    targ_defvec=mips_elf32_trad_le_vec
923    targ_selvecs="mips_elf32_trad_be_vec mips_ecoff_le_vec mips_ecoff_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_le_vec mips_elf32_ntrad_be_vec mips_elf64_trad_be_vec"
924    ;;
925  mips*-*-linux*)
926    targ_defvec=mips_elf32_trad_be_vec
927    targ_selvecs="mips_elf32_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec mips_elf32_ntrad_be_vec mips_elf64_trad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_le_vec"
928    ;;
929  mips64*el-*-freebsd* | mips64*el-*-kfreebsd*-gnu)
930    # FreeBSD vectors
931    targ_defvec=mips_elf32_ntradfbsd_le_vec
932    targ_selvecs="mips_elf32_ntradfbsd_be_vec mips_elf32_tradfbsd_le_vec mips_elf32_tradfbsd_be_vec mips_elf64_tradfbsd_le_vec mips_elf64_tradfbsd_be_vec"
933    # Generic vectors
934    targ_selvecs="${targ_selvecs} mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
935    ;;
936  mips64*-*-freebsd* | mips64*-*-kfreebsd*-gnu)
937    # FreeBSD vectors
938    targ_defvec=mips_elf32_ntradfbsd_be_vec
939    targ_selvecs="mips_elf32_ntradfbsd_le_vec mips_elf32_tradfbsd_be_vec mips_elf32_tradfbsd_le_vec mips_elf64_tradfbsd_be_vec mips_elf64_tradfbsd_le_vec"
940    # Generic vectors
941    targ_selvecs="${targ_selvecs} mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
942    ;;
943  mips*el-*-freebsd* | mips*el-*-kfreebsd*-gnu)
944    # FreeBSD vectors
945    targ_defvec=mips_elf32_tradfbsd_le_vec
946    targ_selvecs="mips_elf32_tradfbsd_be_vec mips_elf32_ntradfbsd_le_vec mips_elf64_tradfbsd_le_vec mips_elf32_ntradfbsd_be_vec mips_elf64_tradfbsd_be_vec"
947    # Generic vectors
948    targ_selvecs="${targ_selvecs} mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_le_vec mips_elf32_ntrad_be_vec mips_elf64_trad_be_vec"
949    ;;
950  mips*-*-freebsd* | mips*-*-kfreebsd*-gnu)
951    # FreeBSD vectors
952    targ_defvec=mips_elf32_tradfbsd_be_vec
953    targ_selvecs="mips_elf32_tradfbsd_le_vec mips_elf32_ntradfbsd_be_vec mips_elf64_tradfbsd_be_vec mips_elf32_ntradfbsd_le_vec mips_elf64_tradfbsd_le_vec"
954    # Generic vectors
955    targ_selvecs="${targ_selvecs} mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf32_ntrad_be_vec mips_elf64_trad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_le_vec"
956    ;;
957  mmix-*-*)
958    targ_defvec=mmix_elf64_vec
959    targ_selvecs=mmix_mmo_vec
960    want64=true
961    ;;
962#endif
963  mn10200-*-*)
964    targ_defvec=mn10200_elf32_vec
965    targ_underscore=yes
966    ;;
967
968  mn10300-*-*)
969    targ_defvec=mn10300_elf32_vec
970    targ_underscore=yes
971    ;;
972
973  mt-*-elf)
974    targ_defvec=mt_elf32_vec
975    ;;
976
977  msp430-*-*)
978    targ_defvec=msp430_elf32_vec
979    targ_selvecs=msp430_elf32_ti_vec
980    ;;
981
982  nds32*le-*-linux*)
983    targ_defvec=nds32_elf32_linux_le_vec
984    targ_selvecs=nds32_elf32_linux_be_vec
985    ;;
986
987  nds32*be-*-linux*)
988    targ_defvec=nds32_elf32_linux_be_vec
989    targ_selvecs=nds32_elf32_linux_le_vec
990    ;;
991
992  nds32*le-*-*)
993    targ_defvec=nds32_elf32_le_vec
994    targ_selvecs=nds32_elf32_be_vec
995    ;;
996
997  nds32*be-*-*)
998    targ_defvec=nds32_elf32_be_vec
999    targ_selvecs=nds32_elf32_le_vec
1000    ;;
1001
1002#ifdef BFD64
1003  nfp-*-*)
1004    targ_defvec=nfp_elf64_vec
1005    ;;
1006#endif
1007
1008  ns32k-pc532-mach* | ns32k-pc532-ux*)
1009    targ_defvec=ns32k_aout_pc532mach_vec
1010    targ_underscore=yes
1011    ;;
1012  ns32k-*-netbsd* | ns32k-*-lites* | ns32k-*-openbsd*)
1013    targ_defvec=ns32k_aout_pc532nbsd_vec
1014    targ_underscore=yes
1015    ;;
1016
1017  nios2eb-*-*)
1018    targ_defvec=nios2_elf32_be_vec
1019    targ_selvecs=nios2_elf32_le_vec
1020    ;;
1021
1022  nios2el-*-*)
1023    targ_defvec=nios2_elf32_le_vec
1024    targ_selvecs=nios2_elf32_be_vec
1025    ;;
1026
1027  nios2-*-*)
1028    targ_defvec=nios2_elf32_le_vec
1029    targ_selvecs=nios2_elf32_be_vec
1030    ;;
1031
1032  or1k-*-elf | or1k-*-linux* | or1k-*-rtems*)
1033    targ_defvec=or1k_elf32_vec
1034    ;;
1035
1036  or1knd-*-elf | or1knd-*-linux* | or1knd-*-rtems*)
1037    targ_defvec=or1k_elf32_vec
1038    ;;
1039
1040  pdp11-*-*)
1041    targ_defvec=pdp11_aout_vec
1042    targ_underscore=yes
1043    ;;
1044
1045  pj-*-*)
1046    targ_defvec=pj_elf32_vec
1047    targ_selvecs="pj_elf32_vec pj_elf32_le_vec"
1048    ;;
1049
1050  pjl-*-*)
1051    targ_defvec=pj_elf32_le_vec
1052    targ_selvecs="pj_elf32_le_vec pj_elf32_vec i386_elf32_vec iamcu_elf32_vec"
1053    ;;
1054
1055  powerpc-*-aix5.[01] | rs6000-*-aix5.[01])
1056    targ_defvec=rs6000_xcoff_vec
1057    targ_selvecs="rs6000_xcoff64_aix_vec"
1058    want64=true
1059    ;;
1060#ifdef BFD64
1061  powerpc64-*-aix5.[01])
1062    targ_defvec=rs6000_xcoff64_aix_vec
1063    targ_selvecs="rs6000_xcoff_vec"
1064    want64=true
1065    ;;
1066#endif
1067  powerpc-*-aix[5-9]* | rs6000-*-aix[5-9]*)
1068    targ_cflags=-DAIX_WEAK_SUPPORT
1069    targ_defvec=rs6000_xcoff_vec
1070    targ_selvecs="rs6000_xcoff64_aix_vec"
1071    want64=true
1072    ;;
1073#ifdef BFD64
1074  powerpc64-*-aix[5-9]*)
1075    targ_cflags=-DAIX_WEAK_SUPPORT
1076    targ_defvec=rs6000_xcoff64_aix_vec
1077    targ_selvecs="rs6000_xcoff_vec"
1078    want64=true
1079    ;;
1080#endif
1081
1082  powerpc-*-aix* | powerpc-*-beos* | rs6000-*-*)
1083    targ_defvec=rs6000_xcoff_vec
1084    targ64_selvecs=rs6000_xcoff64_vec
1085    case "${targ}" in
1086	*-*-aix4.[3456789]* | *-*-aix[56789]*)
1087	want64=true;;
1088	*)
1089	targ_cflags=-DSMALL_ARCHIVE;;
1090    esac
1091    ;;
1092#ifdef BFD64
1093  powerpc64-*-aix*)
1094    targ_defvec=rs6000_xcoff64_vec
1095    targ_selvecs=rs6000_xcoff_vec
1096    want64=true
1097    ;;
1098  powerpc64-*-freebsd*)
1099    targ_defvec=powerpc_elf64_fbsd_vec
1100    targ_selvecs="powerpc_elf64_vec powerpc_elf32_vec powerpc_elf32_fbsd_vec powerpc_elf32_le_vec rs6000_xcoff_vec rs6000_xcoff64_vec rs6000_xcoff64_aix_vec"
1101    want64=true
1102    ;;
1103  powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \
1104  powerpc64-*-*bsd*)
1105    targ_defvec=powerpc_elf64_vec
1106    targ_selvecs="powerpc_elf64_le_vec powerpc_elf32_vec powerpc_elf32_le_vec rs6000_xcoff_vec rs6000_xcoff64_vec rs6000_xcoff64_aix_vec"
1107    want64=true
1108    ;;
1109  powerpc64le-*-elf* | powerpcle-*-elf64* | powerpc64le-*-linux* | \
1110  powerpc64le-*-*bsd*)
1111    targ_defvec=powerpc_elf64_le_vec
1112    targ_selvecs="powerpc_elf64_vec powerpc_elf32_le_vec powerpc_elf32_vec rs6000_xcoff_vec rs6000_xcoff64_vec rs6000_xcoff64_aix_vec"
1113    want64=true
1114    ;;
1115#endif
1116  powerpc-*-*freebsd*)
1117    targ_defvec=powerpc_elf32_fbsd_vec
1118    targ_selvecs="rs6000_xcoff_vec powerpc_elf32_vec powerpc_elf32_le_vec powerpc_boot_vec"
1119    targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec powerpc_elf64_fbsd_vec"
1120    ;;
1121  powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
1122  powerpc-*-solaris2* | powerpc-*-linux-* | powerpc-*-rtems* | \
1123  powerpc-*-chorus*)
1124    targ_defvec=powerpc_elf32_vec
1125    targ_selvecs="rs6000_xcoff_vec powerpc_elf32_le_vec powerpc_boot_vec"
1126    targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec"
1127    ;;
1128  powerpc-*-kaos*)
1129    targ_defvec=powerpc_elf32_vec
1130    targ_selvecs="powerpc_elf32_le_vec powerpc_boot_vec"
1131    targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec"
1132    ;;
1133  powerpc-*-darwin* | powerpc-*-macos10* | powerpc-*-rhapsody*)
1134    targ_defvec=mach_o_be_vec
1135    targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
1136    targ_archs="$targ_archs bfd_i386_arch"
1137    ;;
1138  powerpc-*-macos*)
1139    targ_defvec=powerpc_xcoff_vec
1140    ;;
1141  powerpc-*-lynxos*)
1142    targ_defvec=powerpc_elf32_vec
1143    targ_selvecs="rs6000_xcoff_vec"
1144    targ_cflags=-DSMALL_ARCHIVE
1145    ;;
1146  powerpc-*-nto*)
1147    targ_defvec=powerpc_elf32_vec
1148    targ_selvecs="rs6000_xcoff_vec powerpc_elf32_le_vec powerpc_boot_vec"
1149    ;;
1150  powerpc-*-vxworks* | powerpc-*-windiss*)
1151    targ_defvec=powerpc_elf32_vxworks_vec
1152    targ_selvecs="rs6000_xcoff_vec powerpc_elf32_vec powerpc_elf32_le_vec powerpc_boot_vec"
1153    targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec"
1154    ;;
1155  powerpcle-*-nto*)
1156    targ_defvec=powerpc_elf32_le_vec
1157    targ_selvecs="rs6000_xcoff_vec powerpc_elf32_vec powerpc_boot_vec"
1158    ;;
1159  powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
1160  powerpcle-*-solaris2* | powerpcle-*-linux-* | powerpcle-*-vxworks*)
1161    targ_defvec=powerpc_elf32_le_vec
1162    targ_selvecs="rs6000_xcoff_vec powerpc_elf32_vec powerpc_boot_vec"
1163    targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec"
1164    ;;
1165  powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*)
1166    targ_defvec=powerpc_pe_le_vec
1167    targ_selvecs="powerpc_pei_le_vec powerpc_pei_vec powerpc_pe_le_vec powerpc_pe_vec"
1168    ;;
1169
1170  pru-*-*)
1171    targ_defvec=pru_elf32_vec
1172    ;;
1173
1174#ifdef BFD64
1175  riscv-*-* | riscv32*-*-*)
1176    targ_defvec=riscv_elf32_vec
1177    targ_selvecs="riscv_elf32_vec riscv_elf64_vec"
1178    want64=true
1179    ;;
1180  riscv64*-*-*)
1181    targ_defvec=riscv_elf64_vec
1182    targ_selvecs="riscv_elf32_vec riscv_elf64_vec"
1183    want64=true
1184    ;;
1185#endif
1186
1187  rl78-*-elf)
1188    targ_defvec=rl78_elf32_vec
1189    targ_underscore=yes
1190    ;;
1191
1192  rx-*-elf)
1193    targ_defvec=rx_elf32_le_vec
1194    targ_selvecs="rx_elf32_be_vec rx_elf32_le_vec rx_elf32_be_ns_vec"
1195    targ_underscore=yes
1196    ;;
1197  rx-*-linux*)
1198    targ_defvec=rx_elf32_linux_le_vec
1199    targ_selvecs="rx_elf32_linux_le_vec"
1200    ;;
1201
1202  s390-*-linux*)
1203    targ_defvec=s390_elf32_vec
1204    targ64_selvecs=s390_elf64_vec
1205    want64=true
1206    ;;
1207#ifdef BFD64
1208  s390x-*-linux*)
1209    targ_defvec=s390_elf64_vec
1210    targ_selvecs=s390_elf32_vec
1211    want64=true
1212    ;;
1213  s390x-*-tpf*)
1214    targ_defvec=s390_elf64_vec
1215    want64=true
1216    ;;
1217
1218  score*-*-elf*)
1219    targ_defvec=score_elf32_be_vec
1220    targ_selvecs=score_elf32_le_vec
1221    ;;
1222#endif /* BFD64 */
1223
1224  sh*eb-*-linux*)
1225    targ_defvec=sh_elf32_linux_be_vec
1226    targ_selvecs=sh_elf32_linux_vec
1227    targ_selvecs="${targ_selvecs} sh_elf32_fdpic_le_vec sh_elf32_fdpic_be_vec"
1228    ;;
1229  sh*-*-linux*)
1230    targ_defvec=sh_elf32_linux_vec
1231    targ_selvecs=sh_elf32_linux_be_vec
1232    targ_selvecs="${targ_selvecs} sh_elf32_fdpic_le_vec sh_elf32_fdpic_be_vec"
1233    ;;
1234
1235  sh-*-uclinux* | sh[12]-*-uclinux*)
1236    targ_defvec=sh_elf32_vec
1237    targ_selvecs="sh_elf32_le_vec sh_elf32_linux_be_vec sh_elf32_linux_vec sh_elf32_fdpic_le_vec sh_elf32_fdpic_be_vec"
1238    ;;
1239
1240  sh*l*-*-netbsdelf*)
1241    targ_defvec=sh_elf32_nbsd_le_vec
1242    targ_selvecs="sh_elf32_nbsd_vec sh_coff_vec sh_coff_le_vec"
1243    ;;
1244  sh*-*-netbsdelf*)
1245    targ_defvec=sh_elf32_nbsd_vec
1246    targ_selvecs="sh_elf32_nbsd_le_vec sh_coff_vec sh_coff_le_vec"
1247    ;;
1248
1249  shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf* | shl*-*-kaos*)
1250    targ_defvec=sh_elf32_le_vec
1251    targ_selvecs="sh_elf32_vec sh_coff_le_vec sh_coff_vec sh_coff_small_le_vec sh_coff_small_vec"
1252    targ_underscore=yes
1253    ;;
1254
1255  sh-*-elf* | sh[1234]*-elf* | sh-*-rtems* | sh-*-kaos*)
1256    targ_defvec=sh_elf32_vec
1257    targ_selvecs="sh_elf32_le_vec sh_coff_vec sh_coff_le_vec sh_coff_small_vec sh_coff_small_le_vec"
1258    targ_underscore=yes
1259    ;;
1260
1261  sh-*-nto*)
1262    targ_defvec=sh_elf32_vec
1263    targ_selvecs="sh_elf32_le_vec sh_coff_vec sh_coff_le_vec sh_coff_small_vec sh_coff_small_le_vec"
1264    targ_underscore=yes
1265    ;;
1266  sh*-*-openbsd*)
1267    targ_defvec=sh_elf32_nbsd_le_vec
1268    targ_selvecs="sh_elf32_nbsd_vec sh_coff_vec sh_coff_le_vec"
1269    ;;
1270  sh-*-pe)
1271    targ_defvec=sh_pe_le_vec
1272    targ_selvecs="sh_pe_le_vec sh_pei_le_vec"
1273    targ_underscore=yes
1274    ;;
1275  sh-*-vxworks)
1276    targ_defvec=sh_elf32_vxworks_vec
1277    targ_selvecs="sh_elf32_vxworks_le_vec"
1278    # FIXME None of the following are actually used on this target, but
1279    # they're necessary for coff-sh.c (which is unconditionally used) to be
1280    # compiled correctly.
1281    targ_selvecs="$targ_selvecs sh_coff_vec sh_coff_le_vec sh_coff_small_vec sh_coff_small_le_vec"
1282    targ_underscore=yes
1283    ;;
1284  sh-*-*)
1285    targ_defvec=sh_coff_vec
1286    targ_selvecs="sh_coff_vec sh_coff_le_vec sh_coff_small_vec sh_coff_small_le_vec"
1287    targ_underscore=yes
1288    ;;
1289
1290  sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
1291    targ_defvec=sparc_elf32_sol2_vec
1292    ;;
1293#ifdef BFD64
1294  sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
1295    targ_defvec=sparc_elf32_sol2_vec
1296    targ_selvecs="sparc_elf64_sol2_vec"
1297    want64=true
1298    ;;
1299  sparc64-*-freebsd* | sparc64-*-kfreebsd*-gnu)
1300    targ_defvec=sparc_elf64_fbsd_vec
1301    targ_selvecs="sparc_elf64_vec sparc_elf32_vec"
1302    ;;
1303  sparc64*-*-*)
1304    targ_defvec=sparc_elf64_vec
1305    targ_selvecs="sparc_elf32_vec"
1306    want64=true
1307    ;;
1308#endif
1309  sparc-*-linux-* | sparcv*-*-linux-*)
1310    targ_defvec=sparc_elf32_vec
1311    targ_selvecs="sparc_elf64_vec"
1312    ;;
1313  sparc-*-vxworks*)
1314    targ_defvec=sparc_elf32_vxworks_vec
1315    targ_selvecs="sparc_elf32_vec"
1316    ;;
1317  sparc*-*-*)
1318    targ_defvec=sparc_elf32_vec
1319    ;;
1320
1321  spu-*-elf)
1322    targ_defvec=spu_elf32_vec
1323    want64=true
1324    ;;
1325
1326  tic6x-*-elf)
1327    targ_defvec=tic6x_elf32_c6000_le_vec
1328    targ_selvecs="tic6x_elf32_c6000_be_vec tic6x_elf32_le_vec tic6x_elf32_be_vec"
1329    ;;
1330
1331  tic6x-*-uclinux)
1332    targ_defvec=tic6x_elf32_linux_le_vec
1333    targ_selvecs="tic6x_elf32_linux_be_vec tic6x_elf32_le_vec tic6x_elf32_be_vec"
1334    ;;
1335
1336#ifdef BFD64
1337  tilegx-*-*)
1338    targ_defvec=tilegx_elf64_le_vec
1339    targ_selvecs="tilegx_elf64_be_vec tilegx_elf32_be_vec tilegx_elf32_le_vec"
1340    ;;
1341  tilegxbe-*-*)
1342    targ_defvec=tilegx_elf64_be_vec
1343    targ_selvecs="tilegx_elf64_le_vec tilegx_elf32_be_vec tilegx_elf32_le_vec"
1344    ;;
1345#endif
1346
1347  tilepro-*-*)
1348    targ_defvec=tilepro_elf32_vec
1349    ;;
1350
1351  ft32*-*-*)
1352    targ_defvec=ft32_elf32_vec
1353    ;;
1354
1355  v850*-*-*)
1356    targ_defvec=v850_elf32_vec
1357    targ_selvecs="v800_elf32_vec"
1358    targ_underscore=yes
1359    ;;
1360
1361  vax-*-netbsdelf*)
1362    targ_defvec=vax_elf32_vec
1363    targ_selvecs="vax_aout_nbsd_vec vax_aout_1knbsd_vec"
1364    ;;
1365
1366  vax-*-netbsdaout* | vax-*-netbsd*)
1367    targ_defvec=vax_aout_nbsd_vec
1368    targ_selvecs="vax_elf32_vec vax_aout_1knbsd_vec"
1369    targ_underscore=yes
1370    ;;
1371
1372  vax-*-openbsd*)
1373    targ_defvec=vax_aout_nbsd_vec
1374    targ_underscore=yes
1375    ;;
1376
1377  vax-*-linux-*)
1378    targ_defvec=vax_elf32_vec
1379    ;;
1380
1381  visium-*-elf)
1382    targ_defvec=visium_elf32_vec
1383    ;;
1384
1385  wasm32-*-*)
1386    targ_defvec=wasm32_elf32_vec
1387    targ_selvecs="wasm_vec"
1388    ;;
1389
1390  xgate-*-*)
1391    targ_defvec=xgate_elf32_vec
1392    targ_selvecs="xgate_elf32_vec"
1393    ;;
1394
1395  xstormy16-*-elf)
1396    targ_defvec=xstormy16_elf32_vec
1397    ;;
1398
1399  xtensa*-*-*)
1400    targ_defvec=xtensa_elf32_le_vec
1401    targ_selvecs=xtensa_elf32_be_vec
1402    ;;
1403 xc16x-*-elf)
1404    targ_defvec=xc16x_elf32_vec
1405    ;;
1406
1407  z80-*-coff)
1408    targ_defvec=z80_coff_vec
1409    targ_underscore=no
1410    ;;
1411
1412  z80-*-elf)
1413    targ_defvec=z80_elf32_vec
1414    targ_underscore=no
1415    ;;
1416
1417  z8k*-*-*)
1418    targ_defvec=z8k_coff_vec
1419    targ_underscore=yes
1420    ;;
1421
1422# END OF targmatch.h
1423  bpf-*-*)
1424    echo "*** Configuration $targ is not fully supported." >&2
1425    echo "*** Use bpf or bpf-*-none as the target instead." >&2
1426    exit 1
1427    ;;
1428
1429  *)
1430    echo 1>&2 "*** BFD does not support target ${targ}."
1431    echo 1>&2 "*** Look in bfd/config.bfd for supported targets."
1432    exit 1
1433    ;;
1434esac
1435
1436# All MIPS ELF targets need a 64-bit bfd_vma.
1437case "${targ_defvec} ${targ_selvecs}" in
1438  *mips_elf*)
1439    want64=true
1440    ;;
1441esac
1442
1443case "${host64}${want64}" in
1444  *true*)
1445    targ_selvecs="${targ_selvecs} ${targ64_selvecs}"
1446    ;;
1447esac
1448
1449# If we support any ELF target, then automatically add support for the
1450# generic ELF targets.  This permits an objdump with some ELF support
1451# to be used on an arbitrary ELF file for anything other than
1452# relocation information.
1453case "${targ_defvec} ${targ_selvecs}" in
1454  *elf64* | *mips_elf32_n*)
1455    targ_selvecs="${targ_selvecs} elf64_le_vec elf64_be_vec elf32_le_vec elf32_be_vec"
1456    ;;
1457  *elf32*)
1458    targ_selvecs="${targ_selvecs} elf32_le_vec elf32_be_vec"
1459    ;;
1460esac
1461
1462# If we support Intel MCU target, then add support for bfd_iamcu_arch.
1463case "${targ_defvec} ${targ_selvecs}" in
1464  *iamcu_elf32*)
1465    targ_archs="$targ_archs bfd_iamcu_arch"
1466    ;;
1467esac
1468
1469# If we support Intel L1OM target, then add support for bfd_l1om_arch.
1470case "${targ_defvec} ${targ_selvecs}" in
1471  *l1om_elf64*)
1472    targ_archs="$targ_archs bfd_l1om_arch"
1473    ;;
1474esac
1475
1476# If we support Intel K1OM target, then add support for bfd_k1om_arch.
1477case "${targ_defvec} ${targ_selvecs}" in
1478  *k1om_elf64*)
1479    targ_archs="$targ_archs bfd_k1om_arch"
1480    ;;
1481esac
1482