[gdb/testsuite] Add gdb.tui/wrap-line.exp
[binutils-gdb.git] / ld / configure.tgt
blob4a71f679e29c29fc0429565ae95dd05fabbf995f
1 # configure.tgt
3 #   Copyright (C) 2013-2023 Free Software Foundation, Inc.
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.
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.
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/>.
19 # This is the linker target specific file.  This is invoked by the
20 # autoconf generated configure script.  Putting it in a separate shell
21 # file lets us skip running autoconf when modifying target specific
22 # information.
24 # This file switches on the shell variable ${targ}, and sets the
25 # following shell variables:
26 #  targ_emul            name of linker emulation to use
27 #  targ_extra_emuls     additional linker emulations to provide
28 #  targ_extra_libpath   additional linker emulations using LIB_PATH
29 #  targ_extra_ofiles    additional host-compiled objects needed by the emulation
30 #  targ64_extra_emuls   additional linker emulations to provide if
31 #                       --enable-64-bit-bfd is given or if host is 64 bit.
32 #  targ64_extra_libpath additional linker emulations using LIB_PATH if
33 #                       --enable-64-bit-bfd is given or if host is 64 bit.
34 #  NATIVE_LIB_DIRS      library directories to search on this host
35 #                       (if we are a native or sysrooted linker)
37 targ_extra_emuls=
38 targ_extra_libpath=
39 targ_extra_ofiles="ldelf.o ldelfgen.o"
40 targ64_extra_emuls=
41 targ64_extra_libpath=
43 # By default the linker will generate warnings if it is creating an
44 # executable stack or a segment with all three of read, write and
45 # execute permissions.  These settings are not appropriate for all
46 # targets however, so we can change them here:
48 if test "${ac_default_ld_warn_rwx_segments}" = unset; then
49   case "${targ}" in
50       # The CRIS and V850 default linker scripts yields just one segment
51       # as intended, so a rwx segment warning is not helpful.
52       # The HPPA's and SPARC's PLT sections use a constructed trampoline
53       # hence it needs to have a RWX segment.
54       # Many MIPS targets use executable segments.
55     cris-*-* | crisv32-*-* | \
56     hppa*-*-* | \
57     mips*-*-* | \
58     sparc*-*-* | \
59     v850*-*-*)
60       ac_default_ld_warn_rwx_segments=0
61       ;;
62     *)
63       ;;
64   esac
67 if test "${ac_default_ld_warn_execstack}" = 2; then
68   case "${targ}" in
69       # The HPPA port needs to support older kernels that
70       # use executable stacks for signals and syscalls.
71       # Many MIPS targets use executable stacks.
72     hppa*-*-* | \
73     mips*-*-*)
74       ac_default_ld_warn_execstack=0
75       ;;
76     *)
77       ;;
78   esac
81 # Please try to keep this table more or less in alphabetic order - it
82 # makes it much easier to lookup a specific archictecture.
83 case "${targ}" in
84 aarch64_be-*-elf)       targ_emul=aarch64elfb
85                         targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b armelfb armelf"
86                         ;;
87 aarch64-*-elf | aarch64-*-rtems* | aarch64-*-genode*)
88                         targ_emul=aarch64elf
89                         targ_extra_emuls="aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb"
90                         ;;
91 aarch64-*-cloudabi*)    targ_emul=aarch64cloudabi
92                         targ_extra_emuls=aarch64cloudabib
93                         ;;
94 aarch64-*-freebsd*)     targ_emul=aarch64fbsd
95                         targ_extra_emuls="aarch64fbsdb aarch64elf"
96                         ;;
97 aarch64-*-fuchsia*)     targ_emul=aarch64elf
98                         targ_extra_emuls="aarch64elfb armelf armelfb"
99                         ;;
100 aarch64_be-*-linux-gnu_ilp32)
101                         targ_emul=aarch64linux32b
102                         targ_extra_libpath="aarch64linuxb aarch64linux aarch64linux32 armelfb_linux_eabi armelf_linux_eabi"
103                         targ_extra_emuls="aarch64elfb aarch64elf aarch64elf32 aarch64elf32b armelfb armelf $targ_extra_libpath"
104                         ;;
105 aarch64-*-linux-gnu_ilp32)
106                         targ_emul=aarch64linux32
107                         targ_extra_libpath="aarch64linux aarch64linuxb aarch64linux32b armelfb_linux_eabi armelf_linux_eabi"
108                         targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath"
109                         ;;
110 aarch64_be-*-linux*)    targ_emul=aarch64linuxb
111                         targ_extra_libpath="aarch64linux aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi"
112                         targ_extra_emuls="aarch64elfb aarch64elf aarch64elf32 aarch64elf32b armelfb armelf $targ_extra_libpath"
113                         ;;
114 aarch64-*-linux*)       targ_emul=aarch64linux
115                         targ_extra_libpath="aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi"
116                         targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath"
117                         ;;
118 aarch64-*-haiku*)       targ_emul=aarch64haiku
119                         targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb armelf_haiku $targ_extra_libpath"
120                         ;;
121 aarch64-*-nto*)         targ_emul=aarch64nto
122                         targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb"
123                         ;;
124 aarch64-*-pe* | aarch64-*-mingw*)
125                         targ_emul=aarch64pe
126                         targ_extra_emuls="arm64pe"
127                         targ_extra_ofiles="deffilep.o pep-dll-aarch64.o pe-dll.o pdb.o"
128                         ;;
129 alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
130                         targ_emul=elf64alpha_fbsd
131                         targ_extra_emuls="elf64alpha alpha"
132                         tdir_alpha=`echo ${targ_alias} | sed -e 's/freebsd/freebsdecoff/'`
133                         ;;
134 alpha*-*-linux*ecoff*)  targ_emul=alpha
135                         targ_extra_emuls=elf64alpha
136                         tdir_elf64alpha=`echo ${targ_alias} | sed -e 's/ecoff//'`
137                         ;;
138 alpha*-*-linux-*)       targ_emul=elf64alpha
139                         targ_extra_emuls=alpha
140                         tdir_alpha=`echo ${targ_alias} | sed -e 's/linux\(-gnu\)*/linux\1ecoff/'`
141                         ;;
142 alpha*-*-osf*)          targ_emul=alpha
143                         targ_extra_ofiles=
144                         ;;
145 alpha*-*-gnu*)          targ_emul=elf64alpha
146                         ;;
147 alpha*-*-netbsd*)       targ_emul=elf64alpha_nbsd
148                         ;;
149 alpha*-*-openbsd*)      targ_emul=elf64alpha
150                         ;;
151 alpha*-*-*vms*)         targ_emul=alphavms
152                         targ_extra_ofiles=
153                         ;;
154 am33_2.0-*-linux*)      targ_emul=elf32am33lin # mn10300 variant
155                         ;;
156 arc*-*-elf*)            targ_emul=arcelf
157                         targ_extra_emuls="arclinux arclinux_nps arcv2elf arcv2elfx"
158                         ;;
159 arc*-*-linux*)          case "${with_cpu}" in
160                         nps400) targ_emul=arclinux_nps
161                                 targ_extra_emuls=arclinux
162                                 ;;
163                         *)      targ_emul=arclinux
164                                 targ_extra_emuls=arclinux_nps
165                                 ;;
166                         esac
167                         targ_extra_emuls="${targ_extra_emuls} arcelf arcv2elf arcv2elfx"
168                         ;;
169 arm*-*-cegcc*)          targ_emul=arm_wince_pe
170                         targ_extra_ofiles="deffilep.o pe-dll.o"
171                         LIB_PATH='${tooldir}/lib/w32api'
172                         ;;
173 arm-wince-pe | arm-*-wince | arm*-*-mingw32ce*)
174                         targ_emul=arm_wince_pe
175                         targ_extra_ofiles="deffilep.o pe-dll.o"
176                         ;;
177 arm-*-pe)               targ_emul=armpe
178                         targ_extra_ofiles="deffilep.o pe-dll.o"
179                         ;;
180 arm*b-*-freebsd*)       targ_emul=armelfb_fbsd
181                         targ_extra_emuls="armelf_fbsd armelf"
182                         ;;
183 arm*-*-freebsd* | arm-*-kfreebsd*-gnu)
184                         targ_emul=armelf_fbsd
185                         targ_extra_emuls="armelfb_fbsd armelf"
186                         ;;
187 armeb-*-netbsd*)        targ_emul=armelfb_nbsd;
188                         targ_extra_emuls="armelf_nbsd armelf"
189                         ;;
190 arm-*-netbsd*)  targ_emul=armelf_nbsd;
191                         targ_extra_emuls="armelfb_nbsd armelf"
192                         ;;
193 arm-*-nto*)             targ_emul=armnto
194                         ;;
195 arm-*-phoenix*)         targ_emul=armelf
196                         ;;
197 armeb-*-elf | armeb-*-eabi*)
198                         targ_emul=armelfb
199                         ;;
200 arm-*-elf | arm*-*-eabi* | arm-*-rtems* | arm-*-genode*)
201                         targ_emul=armelf
202                         ;;
203 arm-*-kaos*)            targ_emul=armelf
204                         ;;
205 arm9e-*-elf)            targ_emul=armelf
206                         ;;
207 arm*b-*-linux-*eabi*)   targ_emul=armelfb_linux_eabi
208                         targ_extra_emuls=armelf_linux_eabi
209                         targ_extra_libpath=$targ_extra_emuls
210                         ;;
211 arm*b-*-linux-*)        targ_emul=armelfb_linux
212                         targ_extra_emuls="armelfb armelf armelf_linux"
213                         targ_extra_libpath="armelf_linux"
214                         ;;
215 arm*-*-linux-*eabi*)    targ_emul=armelf_linux_eabi
216                         targ_extra_emuls="armelfb_linux_eabi"
217                         targ_extra_libpath=$targ_extra_emuls
218                         ;;
219 arm*-*-uclinuxfdpiceabi)
220                         targ_emul=armelf_linux_eabi
221                         targ_extra_emuls="armelfb_linux_eabi armelf_linux_fdpiceabi armelfb_linux_fdpiceabi"
222                         targ_extra_libpath=$targ_extra_emuls
223                         ;;
224 arm*-*-linux-*)         targ_emul=armelf_linux
225                         targ_extra_emuls="armelf armelfb armelfb_linux"
226                         targ_extra_libpath="armelfb_linux"
227                         ;;
228 arm*b-*-nacl*)          targ_emul=armelfb_nacl
229                         targ_extra_emuls="armelf_nacl"
230                         targ_extra_libpath=$targ_extra_emuls
231                         ;;
232 arm*-*-nacl*)           targ_emul=armelf_nacl
233                         targ_extra_emuls="armelfb_nacl"
234                         targ_extra_libpath=$targ_extra_emuls
235                         ;;
236 arm*-*-uclinux*eabi*)   targ_emul=armelf_linux_eabi
237                         targ_extra_emuls=armelfb_linux_eabi
238                         targ_extra_libpath=$targ_extra_emuls
239                         ;;
240 arm*-*-uclinux*)        targ_emul=armelf_linux
241                         targ_extra_emuls="armelf armelfb armelfb_linux"
242                         targ_extra_libpath="armelfb_linux"
243                         ;;
244 arm-*-vxworks)          targ_emul=armelf_vxworks
245                         ;;
246 arm*-*-conix*)          targ_emul=armelf
247                         ;;
248 arm*-*-fuchsia*)        targ_emul=armelf_fuchsia
249                         targ_extra_emuls="armelfb_fuchsia armelf armelfb"
250                         ;;
251 arm*-*-haiku*)          targ_emul=armelf_haiku
252                         targ_extra_emuls=armelf
253                         ;;
254 avr-*-*)                targ_emul=avr2
255                         targ_extra_emuls="avr1 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny"
256                         ;;
257 bfin-*-elf | bfin-*-rtems*)
258                         targ_emul=elf32bfin
259                         targ_extra_emuls="elf32bfinfd"
260                         targ_extra_libpath=$targ_extra_emuls
261                         ;;
262 bfin-*-uclinux*)        targ_emul=elf32bfin;
263                         targ_extra_emuls="elf32bfinfd"
264                         targ_extra_libpath=$targ_extra_emuls
265                         ;;
266 bfin-*-linux-uclibc*)   targ_emul=elf32bfinfd;
267                         targ_extra_emuls="elf32bfin"
268                         targ_extra_libpath=$targ_extra_emuls
269                         ;;
270 bpf-*-*)                targ_emul=elf64bpf
271                         ;;
272 cr16-*-elf*)            targ_emul=elf32cr16
273                         ;;
274 cris-*-*aout*)          targ_emul=crisaout
275                         targ_extra_emuls="criself crislinux"
276                         targ_extra_libpath=$targ_extra_emuls
277                         ;;
278 cris-*-linux-* | crisv32-*-linux-*)
279                         targ_emul=crislinux
280                         ;;
281 cris-*-* | crisv32-*-*) targ_emul=criself
282                         targ_extra_emuls="crisaout crislinux"
283                         targ_extra_libpath=$targ_extra_emuls
284                         ;;
285 crx-*-elf*)             targ_emul=elf32crx
286                         ;;
288 csky-*-elf*)            targ_emul=cskyelf
289                         ;;
290 csky-*-linux*)          targ_emul=cskyelf_linux
291                         ;;
293 d10v-*-*)               targ_emul=d10velf
294                         ;;
295 d30v-*-*ext*)           targ_emul=d30v_e
296                         targ_extra_emuls="d30velf d30v_o"
297                         targ_extra_ofiles=ldelfgen.o
298                         ;;
299 d30v-*-*onchip*)        targ_emul=d30v_o
300                         targ_extra_emuls="d30velf d30v_e"
301                         targ_extra_ofiles=ldelfgen.o
302                         ;;
303 d30v-*-*)               targ_emul=d30velf
304                         targ_extra_emuls="d30v_e d30v_o"
305                         targ_extra_ofiles=ldelfgen.o
306                         ;;
307 dlx-*-elf*)             targ_emul=elf32_dlx
308                         targ_extra_ofiles=ldelfgen.o
309                         ;;
310 epiphany-*-*)           targ_emul=elf32epiphany
311                         targ_extra_emuls="elf32epiphany_4x4"
312                         ;;
313 fido*-*-elf*)           targ_emul=m68kelf
314                         ;;
315 fr30-*-*)               targ_emul=elf32fr30
316                         targ_extra_ofiles=ldelfgen.o
317                         ;;
318 frv-*-*linux*)          targ_emul=elf32frvfd
319                         ;;
320 frv-*-*)                targ_emul=elf32frv
321                         targ_extra_emuls="elf32frvfd"
322                         ;;
323 ft32-*-*)               targ_emul=elf32ft32
324                         targ_extra_ofiles=ldelfgen.o
325                         ;;
326 h8300-*-elf* | h8300-*-rtems*)
327                         targ_emul=h8300elf;
328                         targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf"
329                         ;;
330 h8300-*-linux*)
331                         targ_emul=h8300elf_linux;
332                         targ_extra_emuls="h8300helf_linux h8300self_linux h8300sxelf_linux"
333                         ;;
334 hppa*64*-*-linux-*)     targ_emul=hppa64linux
335                         ;;
336 hppa*64*-hpux*)         targ_emul=elf64hppa
337                         ;;
338 hppa*-*-linux-*)        targ_emul=hppalinux
339                         ;;
340 hppa*-*-*elf*)          targ_emul=hppaelf
341                         ;;
342 hppa*-*-lites*)         targ_emul=hppaelf
343                         ;;
344 hppa*-*-netbsd*)        targ_emul=hppanbsd
345                         ;;
346 hppa*-*-openbsd*)       targ_emul=hppaobsd
347                         ;;
348 i[3-7]86-*-nto-qnx*)    targ_emul=i386nto
349                         ;;
350 i[3-7]86-*-go32)        targ_emul=i386go32
351                         targ_extra_ofiles=
352                         ;;
353 i[3-7]86-*-msdosdjgpp*) targ_emul=i386go32
354                         targ_extra_ofiles=
355                         ;;
356 i[3-7]86-*-lynxos*)     targ_emul=i386lynx
357                         ;;
358 i[3-7]86-*-aros*)       targ_emul=elf_i386
359                         targ_extra_emuls=elf_iamcu
360                         ;;
361 i[3-7]86-*-rdos*)       targ_emul=elf_i386
362                         targ_extra_emuls=elf_iamcu
363                         ;;
364 i[3-7]86-*-bsd)         targ_emul=i386bsd
365                         targ_extra_ofiles=
366                         ;;
367 i[3-7]86-*-bsd386)      targ_emul=i386bsd
368                         targ_extra_ofiles=
369                         ;;
370 i[3-7]86-*-bsdi*)       targ_emul=i386bsd
371                         targ_extra_ofiles=
372                         ;;
373 i[3-7]86-*-linux-*)     targ_emul=elf_i386
374                         targ_extra_emuls="elf_iamcu"
375                         targ64_extra_emuls="elf_x86_64 elf32_x86_64"
376                         targ64_extra_libpath="elf_x86_64 elf32_x86_64"
377                         ;;
378 i[3-7]86-*-redox*)      targ_emul=elf_i386
379                         targ_extra_emuls=elf_x86_64
380                         ;;
381 i[3-7]86-*-solaris2*)   targ_emul=elf_i386_sol2
382                         targ_extra_emuls="elf_i386_ldso elf_i386 elf_iamcu elf_x86_64_sol2 elf_x86_64"
383                         targ_extra_libpath=$targ_extra_emuls
384                         ;;
385 i[3-7]86-*-solaris*)    targ_emul=elf_i386_ldso
386                         targ_extra_emuls="elf_i386"
387                         targ_extra_libpath=$targ_extra_emuls
388                         ;;
389 i[3-7]86-*-netbsd* | \
390 i[3-7]86-*-netbsd*-gnu* | \
391 i[3-7]86-*-knetbsd*-gnu | \
392 i[3-7]86-*-openbsd*)
393                         targ_emul=elf_i386
394                         targ_extra_emuls="elf_iamcu"
395                         ;;
396 i[3-7]86-*-elfiamcu)    targ_emul=elf_iamcu
397                         targ_extra_emuls=elf_i386
398                         ;;
399 i[3-7]86-*-elf* | i[3-7]86-*-rtems* | i[3-7]86-*-genode*)
400                         targ_emul=elf_i386
401                         targ_extra_emuls=elf_iamcu
402                         ;;
403 i[3-7]86-*-dragonfly*)  targ_emul=elf_i386
404                         targ_extra_emuls="elf_iamcu i386bsd"
405                         ;;
406 i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
407                         targ_emul=elf_i386_fbsd
408                         targ_extra_emuls="elf_i386 elf_iamcu i386bsd"
409                         ;;
410 i[3-7]86-*-gnu*)        targ_emul=elf_i386
411                         targ_extra_emuls=elf_iamcu
412                         ;;
413 i[3-7]86-*-msdos*)      targ_emul=i386msdos
414                         targ_extra_emuls=i386aout
415                         targ_extra_ofiles=
416                         ;;
417 i[3-7]86-*-moss*)       targ_emul=i386moss
418                         targ_extra_emuls=i386msdos
419                         ;;
420 i[3-7]86-*-winnt*)      targ_emul=i386pe ;
421                         targ_extra_ofiles="deffilep.o pdb.o pe-dll.o"
422                         ;;
423 i[3-7]86-*-pe)          targ_emul=i386pe ;
424                         targ_extra_ofiles="deffilep.o pdb.o pe-dll.o"
425                         ;;
426 i[3-7]86-*-cygwin*)     targ_emul=i386pe ;
427                         targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" ;
428                         test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api'
429                         ;;
430 i[3-7]86-*-mingw32*)    targ_emul=i386pe ;
431                         targ_extra_ofiles="deffilep.o pdb.o pe-dll.o"
432                         ;;
433 i[3-7]86-*-interix*)    targ_emul=i386pe_posix;
434                         targ_extra_ofiles="deffilep.o pe-dll.o"
435                         ;;
436 i[3-7]86-*-beospe*)     targ_emul=i386beos
437                         targ_extra_ofiles=
438                         ;;
439 i[3-7]86-*-beos*)       targ_emul=elf_i386_be
440                         ;;
441 i[3-7]86-*-haiku*)      targ_emul=elf_i386_haiku
442                         ;;
443 i[3-7]86-*-vxworks*)    targ_emul=elf_i386_vxworks
444                         ;;
445 i[3-7]86-*-chaos)       targ_emul=elf_i386_chaos
446                         ;;
447 ia16-*-elf*)            targ_emul=elf_i386
448                         targ_extra_emuls=i386msdos
449                         ;;
450 ia64-*-elf*)            targ_emul=elf64_ia64
451                         ;;
452 ia64-*-freebsd* | ia64-*-kfreebsd*-gnu)
453                         targ_emul=elf64_ia64_fbsd
454                         targ_extra_emuls="elf64_ia64"
455                         ;;
456 ia64-*-netbsd*)         targ_emul=elf64_ia64
457                         ;;
458 ia64-*-linux*)          targ_emul=elf64_ia64
459                         ;;
460 ia64-*-*vms*)           targ_emul=elf64_ia64_vms
461                         targ_extra_ofiles=ldelfgen.o
462                         ;;
463 ia64-*-aix*)            targ_emul=elf64_aix
464                         ;;
465 ip2k-*-elf)             targ_emul=elf32ip2k
466                         ;;
467 iq2000-*-elf)           targ_emul=elf32iq2000
468                         targ_extra_emuls="elf32iq10"
469                         targ_extra_ofiles=ldelfgen.o
470                         ;;
471 lm32-*-*linux*)         targ_emul=elf32lm32fd
472                         ;;
473 lm32-*-*)               targ_emul=elf32lm32
474                         targ_extra_emuls="elf32lm32fd"
475                         ;;
476 m32c-*-elf)
477                         targ_emul=elf32m32c
478                         ;;
479 m32r*le-*-elf*)         targ_emul=m32rlelf
480                         ;;
481 m32r*-*-elf*)
482                         targ_emul=m32relf
483                         ;;
484 m32r*le-*-linux-*)      targ_emul=m32rlelf_linux
485                         ;;
486 m32r*-*-linux-*)        targ_emul=m32relf_linux
487                         ;;
488 m68hc11-*-*|m6811-*-*)  targ_emul=m68hc11elf
489                         targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb"
490                         ;;
491 m68hc12-*-*|m6812-*-*)  targ_emul=m68hc12elf
492                         targ_extra_emuls="m68hc12elfb m68hc11elf m68hc11elfb"
493                         ;;
494 m68*-*-netbsd*) targ_emul=m68kelfnbsd
495                         ;;
496 m68*-*-haiku*)          targ_emul=m68kelf
497                         ;;
498 m68*-*-*)               targ_emul=m68kelf
499                         ;;
500 mcore-*-pe)             targ_emul=mcorepe ;
501                         targ_extra_ofiles="deffilep.o pe-dll.o"
502                         ;;
503 mcore-*-elf)            targ_emul=elf32mcore
504                         ;;
505 mep-*-elf)              targ_emul=elf32mep
506                         ;;
507 metag-*-*)              targ_emul=elf32metag
508                         ;;
509 microblazeel*-linux*)   targ_emul="elf32mbel_linux"
510                         targ_extra_emuls="elf32mb_linux"
511                         ;;
512 microblaze*-linux*)     targ_emul="elf32mb_linux"
513                         targ_extra_emuls="elf32mbel_linux"
514                         ;;
515 microblazeel*)          targ_emul=elf32microblazeel
516                         targ_extra_emuls=elf32microblaze
517                         ;;
518 microblaze*)            targ_emul=elf32microblaze
519                         targ_extra_emuls=elf32microblazeel
520                         ;;
521 mips*-sgi-irix5*)       targ_emul=elf32bsmip
522                         ;;
523 mips*-sgi-irix6*)       targ_emul=elf32bmipn32
524                         targ_extra_emuls="elf32bsmip elf64bmip"
525                         targ_extra_libpath=$targ_extra_emuls
526                         ;;
527 mips*el-*-haiku*)       targ_emul=elf_mipsel_haiku
528                         targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
529                         ;;
530 mips*el-*-netbsd*)      targ_emul=elf32ltsmip
531                         targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip"
532                         ;;
533 mips*-*-netbsd*)        targ_emul=elf32btsmip
534                         targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip"
535                         ;;
536 mips64el-*-openbsd*)    targ_emul=elf64ltsmip
537                         targ_extra_emuls=elf64btsmip
538                         ;;
539 mips64-*-openbsd*)      targ_emul=elf64btsmip
540                         targ_extra_emuls=elf64ltsmip
541                         ;;
542 mips*vr4300el-*-elf*)   targ_emul=elf32l4300
543                         ;;
544 mips*vr4300-*-elf*)     targ_emul=elf32b4300
545                         ;;
546 mips*vr4100el-*-elf*)   targ_emul=elf32l4300
547                         ;;
548 mips*vr4100-*-elf*)     targ_emul=elf32b4300
549                         ;;
550 mips*vr5000el-*-elf*)   targ_emul=elf32l4300
551                         ;;
552 mips*vr5000-*-elf*)     targ_emul=elf32b4300
553                         ;;
554 mips*el-sde-elf* | mips*el-mti-elf* | mips*el-img-elf*)
555                         targ_emul=elf32ltsmip
556                         targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
557                         ;;
558 mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
559                         targ_emul=elf32btsmip
560                         targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
561                         ;;
562 mips64*el-ps2-elf*)     targ_emul=elf32lr5900n32
563                         targ_extra_emuls="elf32lr5900"
564                         targ_extra_libpath=$targ_extra_emuls
565                         ;;
566 mips*el-ps2-elf*)       targ_emul=elf32lr5900
567                         targ_extra_emuls="elf32lr5900n32"
568                         targ_extra_libpath=$targ_extra_emuls
569                         ;;
570 mips*el-*-elf*)         targ_emul=elf32elmip
571                         ;;
572 mips*-*-elf* | mips*-*-rtems*)
573                         targ_emul=elf32ebmip
574                         ;;
575 mips*el-*-vxworks*)     targ_emul=elf32elmipvxworks
576                         targ_extra_emuls="elf32ebmipvxworks"
577                         ;;
578 mips*-*-vxworks*)       targ_emul=elf32ebmipvxworks
579                         targ_extra_emuls="elf32elmipvxworks"
580                         ;;
581 mips*-*-windiss)        targ_emul=elf32mipswindiss
582                         ;;
583 mips*64*el-*-linux-gnuabi64)    targ_emul=elf64ltsmip
584                         targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
585                         targ_extra_libpath=$targ_extra_emuls
586                         ;;
587 mips*64*el-*-linux-*)   targ_emul=elf32ltsmipn32
588                         targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
589                         targ_extra_libpath=$targ_extra_emuls
590                         ;;
591 mips*64*-*-linux-gnuabi64)      targ_emul=elf64btsmip
592                         targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
593                         targ_extra_libpath=$targ_extra_emuls
594                         ;;
595 mips*64*-*-linux-*)     targ_emul=elf32btsmipn32
596                         targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
597                         targ_extra_libpath=$targ_extra_emuls
598                         ;;
599 mips*el-*-linux-*)      targ_emul=elf32ltsmip
600                         targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
601                         targ_extra_libpath=$targ_extra_emuls
602                         ;;
603 mips*-*-linux-*)        targ_emul=elf32btsmip
604                         targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
605                         targ_extra_libpath=$targ_extra_emuls
606                         ;;
607 mips64*el-*-freebsd* | mips64*el-*-kfreebsd*-gnu)
608                         targ_emul=elf32ltsmipn32_fbsd
609                         targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_fbsd elf32btsmip_fbsd elf32btsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
610                         targ_extra_libpath=$targ_extra_emuls
611                         ;;
612 mips64*-*-freebsd* | mips64*-*-kfreebsd*-gnu)
613                         targ_emul=elf32btsmipn32_fbsd
614                         targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_fbsd elf32btsmip_fbsd elf32ltsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
615                         targ_extra_libpath=$targ_extra_emuls
616                         ;;
617 mips*el-*-freebsd* | mips*el-*-kfreebsd*-gnu)
618                         targ_emul=elf32ltsmip_fbsd
619                         targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmipn32_fbsd elf32btsmip_fbsd elf32btsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
620                         targ_extra_libpath=$targ_extra_emuls
621                         ;;
622 mips*-*-freebsd* | mips*-*-kfreebsd*-gnu)
623                         targ_emul=elf32btsmip_fbsd
624                         targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_fbsd elf32btsmipn32_fbsd elf32ltsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
625                         targ_extra_libpath=$targ_extra_emuls
626                         ;;
627 mips*-*-sysv4*)         targ_emul=elf32btsmip
628                         ;;
629 mmix-*-*)               targ_emul=mmo
630                         targ_extra_emuls=elf64mmix
631                         ;;
632 mn10200-*-*)            targ_emul=mn10200
633                         targ_extra_ofiles=ldelfgen.o
634                         ;;
635 mn10300-*-*)            targ_emul=mn10300
636                         ;;
637 moxie-*-moxiebox*)      targ_emul=moxiebox
638                         targ_extra_ofiles=ldelfgen.o
639                         ;;
640 moxie-*-*)              targ_emul=elf32moxie
641                         ;;
642 msp430-*-*)             targ_emul=msp430elf
643                         targ_extra_emuls="msp430X"
644                         targ_extra_ofiles=ldelfgen.o
645                         ;;
646 mt-*elf)                targ_emul=elf32mt
647                         targ_extra_ofiles=ldelfgen.o
648                         ;;
649 nds32*le-*-elf*)        targ_emul=nds32elf
650                         targ_extra_emuls="nds32elf16m nds32belf nds32belf16m"
651                         ;;
652 nds32*be-*-elf*)        targ_emul=nds32belf
653                         targ_extra_emuls="nds32elf nds32elf16m nds32belf16m"
654                         ;;
655 nds32*le-*-linux-gnu*)  targ_emul=nds32elf_linux
656                         ;;
657 nds32*be-*-linux-gnu*)  targ_emul=nds32belf_linux
658                         ;;
659 nios2*-*-linux*)        targ_emul=nios2linux
660                         ;;
661 nios2*-*-*)             targ_emul=nios2elf
662                         ;;
663 ns32k-pc532-mach* | ns32k-pc532-ux*)  targ_emul=pc532macha
664                         targ_extra_ofiles=
665                         ;;
666 ns32k-*-*bsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd
667                         targ_extra_ofiles=
668                         ;;
669 or1k-*-elf | or1knd-*-elf | or1k-*-rtems* | or1knd-*-rtems*)
670                         targ_emul=elf32or1k
671                         ;;
672 or1k-*-linux* | or1knd-*-linux*)        targ_emul=elf32or1k_linux
673                         ;;
674 pdp11-*-*)              targ_emul=pdp11
675                         targ_extra_ofiles=
676                         ;;
677 pjl*-*-*)               targ_emul=pjlelf
678                         targ_extra_emuls="elf_i386 elf_iamcu"
679                         ;;
680 pj*-*-*)                targ_emul=pjelf
681                         targ_extra_ofiles=ldelfgen.o
682                         ;;
683 powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu)
684                         targ_emul=elf32ppc_fbsd
685                         targ_extra_emuls="elf32ppc elf32ppcsim"
686                         targ_extra_libpath=elf32ppc;
687                         tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'`
688                         ;;
689 powerpc64-*-freebsd*)
690                         targ_emul=elf64ppc_fbsd
691                         targ_extra_emuls="elf64ppc elf32ppc_fbsd elf32ppc"
692                         targ_extra_libpath="elf32ppc_fbsd elf32ppc"
693                         tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'`
694                         tdir_elf32ppc_fbsd=$tdir_elf32ppc
695                         ;;
696 powerpc64le-*-freebsd*)
697                         targ_emul=elf64lppc_fbsd
698                         targ_extra_emuls="elf64lppc"
699                         ;;
700 powerpc-*-vxworks*)
701                         targ_emul=elf32ppcvxworks
702                         targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
703                         ;;
704 powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
705   | powerpc*-*-linux* | powerpc*-*-netbsd* | powerpc*-*-openbsd* \
706   | powerpc*-*-rtems* \
707   | powerpc*-*-solaris* | powerpc*-*-kaos* | powerpc*-*-vxworks*)
708                         case "${targ}" in
709                         powerpc64*)
710                             targ_emul=elf64ppc
711                             targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
712                             targ_extra_libpath="elf32ppc elf32ppclinux" ;;
713                         *linux*)
714                             targ_emul=elf32ppclinux
715                             targ_extra_emuls="elf32ppc elf32ppcsim"
716                             targ_extra_libpath=elf32ppc
717                             targ64_extra_emuls=elf64ppc
718                             targ64_extra_libpath=elf64ppc ;;
719                         *)
720                             targ_emul=elf32ppc
721                             targ_extra_emuls="elf32ppclinux elf32ppcsim"
722                             targ_extra_libpath=elf32ppclinux
723                             targ64_extra_emuls=elf64ppc
724                             targ64_extra_libpath=elf64ppc ;;
725                         esac
726                         td=tdir_elf32ppc
727                         td64=tdir_elf64ppc
728                         s=s/ppc/lppc/g
729                         case "${targ}" in
730                         powerpcle-* | powerpc64le-*)
731                             for z in td td64 targ_emul targ_extra_emuls \
732                                          targ_extra_libpath targ64_extra_emuls \
733                                          targ64_extra_libpath
734                             do
735                                 eval ${z}=\"\`echo \$${z} \| sed -e $s\`\"
736                             done
737                             s=s/lppc/ppc/g ;;
738                         esac
739                         # Why oh why did we set tooldir based on target_alias
740                         # rather than on target?
741                         eval tdir_${targ_emul}="${targ_alias}"
742                         cpu=`echo "${targ_alias}" | sed -e 's/-.*//'`
743                         rest=`echo "${targ_alias}" | sed -e 's/^[^-]*//'`
744                         le=le
745                         case "${cpu}" in
746                         *little) le=little
747                         esac
748                         ta32=`echo "${cpu}" | sed -e s/64//`"${rest}"
749                         ta64=`echo "${cpu}" | sed -e 's/64//;s/$/64/;s/'${le}'64$/64'${le}'/;s/be64$/64be/'`"${rest}"
750                         eval test -n \"\$${td}\" || eval ${td}="${ta32}"
751                         eval test -n \"\$${td}linux\" || eval ${td}linux="${ta32}"
752                         eval test -n \"\$${td}sim\" || eval ${td}sim="${ta32}"
753                         eval test -n \"\$${td64}\" || eval ${td64}="${ta64}"
754                         # Now provide the other endian
755                         for z in targ_extra_emuls targ_extra_libpath
756                         do
757                             eval ${z}=\"\$${z} \`echo ${targ_emul} \$${z} \| sed -e $s\`\"
758                         done
759                         for z in targ64_extra_emuls targ64_extra_libpath
760                         do
761                             eval ${z}=\"\$${z} \`echo \$${z} \| sed -e $s\`\"
762                         done
763                         td=`echo "${td}" | sed -e $s`
764                         td64=`echo "${td64}" | sed -e $s`
765                         case "${targ}" in
766                         powerpcle-* | powerpc64le-*)
767                             cpu=`echo "${cpu}" | sed -e s/${le}\$//` ;;
768                         *)
769                             cpu=`echo "${cpu}" | sed -e s/be\$//`${le} ;;
770                         esac
771                         ta32=`echo "${cpu}" | sed -e s/64//`"${rest}"
772                         ta64=`echo "${cpu}" | sed -e 's/64//;s/$/64/;s/'${le}'64$/64'${le}/`"${rest}"
773                         eval test -n \"\$${td}\" || eval ${td}="${ta32}"
774                         eval test -n \"\$${td}linux\" || eval ${td}linux="${ta32}"
775                         eval test -n \"\$${td}sim\" || eval ${td}sim="${ta32}"
776                         eval test -n \"\$${td64}\" || eval ${td64}="${ta64}"
777                         ;;
778 powerpc-*-nto*)         targ_emul=elf32ppcnto
779                         ;;
780 powerpcle-*-nto*)       targ_emul=elf32lppcnto
781                         ;;
782 powerpc-*-macos*)       targ_emul=ppcmacos
783                         targ_extra_ofiles=
784                         ;;
785 powerpc-*-aix[5-9]*)    targ_emul=aix5ppc
786                         targ_extra_ofiles=
787                         ;;
788 powerpc-*-aix*)         targ_emul=aixppc
789                         targ_extra_ofiles=
790                         ;;
791 powerpc-*-beos*)        targ_emul=aixppc
792                         targ_extra_ofiles=
793                         ;;
794 powerpc-*-haiku*)       targ_emul=elf32ppchaiku
795                         ;;
796 powerpc-*-windiss*)     targ_emul=elf32ppcwindiss
797                         ;;
798 pru*-*-*)               targ_emul=pruelf
799                         ;;
800 riscv32be*-*-linux*)    targ_emul=elf32briscv
801                         targ_extra_emuls="elf32briscv_ilp32f elf32briscv_ilp32 elf64briscv elf64briscv_lp64f elf64briscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64"
802                         targ_extra_libpath=$targ_extra_emuls
803                         ;;
804 riscv32*-*-linux*)      targ_emul=elf32lriscv
805                         targ_extra_emuls="elf32lriscv_ilp32f elf32lriscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64 elf32briscv elf32briscv_ilp32f elf32briscv_ilp32 elf64briscv elf64briscv_lp64f elf64briscv_lp64"
806                         targ_extra_libpath=$targ_extra_emuls
807                         ;;
808 riscvbe-*-* | riscv32be*-*-*)
809                         targ_emul=elf32briscv
810                         targ_extra_emuls="elf64briscv elf32lriscv elf64lriscv"
811                         targ_extra_libpath=$targ_extra_emuls
812                         ;;
813 riscv-*-* | riscv32*-*-*)
814                         targ_emul=elf32lriscv
815                         targ_extra_emuls="elf64lriscv elf32briscv elf64briscv"
816                         targ_extra_libpath=$targ_extra_emuls
817                         ;;
818 riscv64be*-*-linux*)    targ_emul=elf64briscv
819                         targ_extra_emuls="elf64briscv_lp64f elf64briscv_lp64 elf32briscv elf32briscv_ilp32f elf32briscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32"
820                         targ_extra_libpath=$targ_extra_emuls
821                         ;;
822 riscv64*-*-linux*)      targ_emul=elf64lriscv
823                         targ_extra_emuls="elf64lriscv_lp64f elf64lriscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32 elf64briscv elf64briscv_lp64f elf64briscv_lp64 elf32briscv elf32briscv_ilp32f elf32briscv_ilp32"
824                         targ_extra_libpath=$targ_extra_emuls
825                         ;;
826 riscv64be*-*-*)         targ_emul=elf64briscv
827                         targ_extra_emuls="elf32briscv elf64lriscv elf32lriscv"
828                         targ_extra_libpath=$targ_extra_emuls
829                         ;;
830 riscv64*-*-*)           targ_emul=elf64lriscv
831                         targ_extra_emuls="elf32lriscv elf64briscv elf32briscv"
832                         targ_extra_libpath=$targ_extra_emuls
833                         ;;
834 rs6000-*-aix[5-9]*)     targ_emul=aix5rs6
835                         targ_extra_ofiles=
836                         ;;
837 rs6000-*-aix*)          targ_emul=aixrs6
838                         targ_extra_ofiles=
839                         ;;
840 rl78-*-*)               targ_emul=elf32rl78
841                         ;;
842 rx-*-linux*)            targ_emul=elf32rx_linux
843                         ;;
844 rx-*-*)                 targ_emul=elf32rx
845                         ;;
846 s12z-*-*)               targ_emul=m9s12zelf
847                         targ_extra_ofiles=ldelfgen.o
848                         ;;
849 s390x-*-linux*)         targ_emul=elf64_s390
850                         targ_extra_emuls=elf_s390
851                         targ_extra_libpath=$targ_extra_emuls
852                         tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'`
853                         ;;
854 s390x-*-tpf*)           targ_emul=elf64_s390
855                         tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'`
856                         ;;
857 s390-*-linux*)          targ_emul=elf_s390
858                         targ64_extra_emuls=elf64_s390
859                         targ64_extra_libpath=elf64_s390
860                         tdir_elf64_s390=`echo ${targ_alias} | sed -e 's/s390/s390x/'`
861                         ;;
862 score-*-elf)            targ_emul=score7_elf
863                         targ_extra_emuls=score3_elf
864                         ;;
865 sh-*-linux*)            targ_emul=shlelf_linux
866                         targ_extra_emuls="shelf_linux shlelf_fd shelf_fd"
867                         targ_extra_libpath=shelf_linux
868                         ;;
869 sh*eb-*-linux*)         targ_emul=shelf_linux
870                         targ_extra_emuls="shelf_fd"
871                         ;;
872 sh*-*-linux*)           targ_emul=shlelf_linux
873                         targ_extra_emuls="shlelf_fd"
874                         ;;
875 sh*l*-*-netbsd*)        targ_emul=shlelf_nbsd
876                         targ_extra_emuls=shelf_nbsd
877                         ;;
878 sh*-*-netbsd*)  targ_emul=shelf_nbsd
879                         targ_extra_emuls=shlelf_nbsd
880                         ;;
881 shle*-*-elf* | sh[1234]*le*-*-elf | shle*-*-kaos*)
882                         targ_emul=shlelf
883                         targ_extra_emuls="shelf shl sh"
884                         ;;
885 sh-*-elf* | sh[1234]*-*-elf | sh-*-rtems* | sh-*-kaos*)
886                         targ_emul=shelf
887                         targ_extra_emuls="shlelf sh shl"
888                         ;;
889 sh-*-uclinux* | sh[12]-*-uclinux*)
890                         targ_emul=shelf_uclinux
891                         targ_extra_emuls="shelf shlelf sh shl shelf_fd shlelf_fd"
892                         ;;
893 sh-*-vxworks)           targ_emul=shelf_vxworks
894                         targ_extra_emuls=shlelf_vxworks
895                         ;;
896 sh-*-nto*)              targ_emul=shelf_nto
897                         targ_extra_emuls=shlelf_nto
898                         ;;
899 sh-*-pe)                targ_emul=shpe ;
900                         targ_extra_ofiles="deffilep.o pe-dll.o"
901                         ;;
902 sh-*-*)                 targ_emul=sh;
903                         targ_extra_emuls=shl
904                         targ_extra_ofiles=
905                         ;;
906 sparc64-*-freebsd* | sparcv9-*-freebsd* | sparc64-*-kfreebsd*-gnu | sparcv9-*-kfreebsd*-gnu)
907                         targ_emul=elf64_sparc_fbsd
908                         targ_extra_emuls="elf64_sparc elf32_sparc"
909                         targ_extra_libpath=$targ_extra_emuls
910                         tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
911                         ;;
912 sparc64-*-linux-*)      targ_emul=elf64_sparc
913                         targ_extra_emuls="elf32_sparc"
914                         targ_extra_libpath=elf32_sparc
915                         tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
916                         ;;
917 sparc64-*-*bsd*)        targ_emul=elf64_sparc
918                         targ_extra_emuls="elf32_sparc"
919                         ;;
920 sparc64-*-solaris2* | sparcv9-*-solaris2*)
921                         targ_emul=elf64_sparc_sol2
922                         targ_extra_emuls="elf64_sparc elf32_sparc_sol2 elf32_sparc"
923                         targ_extra_libpath=$targ_extra_emuls
924                         tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
925                         ;;
926 sparc64-*-haiku*)       targ_emul=elf64_sparc
927                         ;;
928 sparc64-*-*)            targ_emul=elf64_sparc
929                         ;;
930 sparc*-*-linux-*)       targ_emul=elf32_sparc
931                         targ_extra_emuls="elf64_sparc"
932                         targ_extra_libpath=elf64_sparc
933                         tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`
934                         ;;
935 sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
936                         targ_emul=elf32_sparc_sol2
937                         targ_extra_emuls=elf32_sparc
938                         ;;
939 sparc-*-solaris2*)      targ_emul=elf32_sparc_sol2
940                         targ_extra_emuls="elf32_sparc elf64_sparc_sol2 elf64_sparc"
941                         targ_extra_libpath=$targ_extra_emuls
942                         tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`
943                         ;;
944 sparc*-*-vxworks*)      targ_emul=elf32_sparc_vxworks
945                         ;;
946 sparc*-*-*)             targ_emul=elf32_sparc
947                         ;;
948 spu-*-elf*)             targ_emul=elf32_spu
949                         ;;
950 tic30-*-*coff*)         targ_emul=tic30coff
951                         targ_extra_ofiles=
952                         ;;
953 tic4x-*-* | c4x-*-*)    targ_emul=tic4xcoff
954                         targ_extra_emuls="tic3xcoff tic3xcoff_onchip"
955                         targ_extra_ofiles=
956                         ;;
957 tic54x-*-* | c54x*-*-*) targ_emul=tic54xcoff
958                         targ_extra_ofiles=
959                         ;;
960 tic6x-*-elf)            targ_emul=elf32_tic6x_elf_le
961                         targ_extra_emuls="elf32_tic6x_elf_be elf32_tic6x_le elf32_tic6x_be"
962                         targ_extra_libpath=$targ_extra_emuls
963                         ;;
964 tic6x-*-uclinux)        targ_emul=elf32_tic6x_linux_le
965                         targ_extra_emuls="elf32_tic6x_linux_be elf32_tic6x_le elf32_tic6x_be"
966                         targ_extra_libpath=$targ_extra_emuls
967                         ;;
968 tilegx-*-*)             targ_emul=elf64tilegx
969                         targ_extra_emuls="elf64tilegx_be elf32tilegx elf32tilegx_be"
970                         targ_extra_libpath=$targ_extra_emuls
971                         ;;
972 tilegxbe-*-*)           targ_emul=elf64tilegx_be
973                         targ_extra_emuls="elf64tilegx elf32tilegx elf32tilegx_be"
974                         targ_extra_libpath=$targ_extra_emuls
975                         ;;
976 tilepro-*-*)            targ_emul=elf32tilepro
977                         ;;
978 v850*-*-*)              targ_emul=v850_rh850
979                         targ_extra_emuls=v850
980                         ;;
981 vax-*-netbsdaout*)      targ_emul=vaxnbsd
982                         targ_extra_emuls=elf32vax
983                         ;;
984 vax-*-netbsd*)          targ_emul=elf32vax
985                         targ_extra_emuls=vaxnbsd
986                         ;;
987 vax-*-linux-*)          targ_emul=elf32vax
988                         ;;
989 visium-*-elf)           targ_emul=elf32visium
990                         ;;
991 x86_64-*-rdos*)         targ_emul=elf64rdos
992                         ;;
993 x86_64-*-cloudabi*)     targ_emul=elf_x86_64_cloudabi
994                         ;;
995 x86_64-*-haiku*)        targ_emul=elf_x86_64_haiku
996                         targ_extra_emuls="elf_x86_64 elf_i386_haiku"
997                         ;;
998 x86_64-*-linux-gnux32)  targ_emul=elf32_x86_64
999                         targ_extra_emuls="elf_x86_64 elf_i386 elf_iamcu"
1000                         targ_extra_libpath="elf_i386 elf_iamcu elf_x86_64"
1001                         tdir_elf_iamcu=`echo ${targ_alias} | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'`
1002                         tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'`
1003                         ;;
1004 x86_64-*-linux-*)       targ_emul=elf_x86_64
1005                         targ_extra_emuls="elf32_x86_64 elf_i386 elf_iamcu"
1006                         targ_extra_libpath="elf_i386 elf32_x86_64"
1007                         tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
1008                         ;;
1009 x86_64-*-redox*)        targ_emul=elf_x86_64
1010                         targ_extra_emuls=elf_i386
1011                         ;;
1012 x86_64-*-solaris2*)     targ_emul=elf_x86_64_sol2
1013                         targ_extra_emuls="elf_x86_64 elf_i386_sol2 elf_i386_ldso elf_i386 elf_iamcu"
1014                         targ_extra_libpath=$targ_extra_emuls
1015                         tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
1016                         ;;
1017 x86_64-*-netbsd* | x86_64-*-openbsd*)
1018                         targ_emul=elf_x86_64
1019                         targ_extra_emuls="elf_i386 elf_iamcu"
1020                         tdir_elf_iamcu=`echo ${targ_alias} | \
1021                             sed -e 's/x86_64/i386/' -e 's/aout//'`
1022                         tdir_elf_i386=`echo ${targ_alias} | \
1023                             sed -e 's/x86_64/i386/' -e 's/aout//'`
1024                         ;;
1025 x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia* | x86_64-*-genode*)
1026                         targ_emul=elf_x86_64
1027                         targ_extra_emuls="elf_i386 elf_iamcu elf32_x86_64"
1028                         targ_extra_libpath="elf_i386 elf_iamcu elf32_x86_64"
1029                         tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
1030                         ;;
1031 x86_64-*-dragonfly*)    targ_emul=elf_x86_64
1032                         targ_extra_emuls="elf_i386 elf_iamcu"
1033                         ;;
1034 x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
1035                         targ_emul=elf_x86_64_fbsd
1036                         targ_extra_emuls="elf_i386_fbsd elf_x86_64 elf_i386 elf_iamcu"
1037                         targ_extra_libpath="elf_i386_fbsd"
1038                         tdir_elf_i386_fbsd=`echo ${targ_alias} \
1039                             | sed -e 's/x86_64/i386/'`
1040                         tdir_elf_iamcu=`echo ${targ_alias} \
1041                             | sed -e 's/x86_64/i386/'`
1042                         tdir_elf_i386=`echo ${targ_alias} \
1043                             | sed -e 's/x86_64/i386/'`
1044                         ;;
1045 x86_64-*-pe | x86_64-*-pep) targ_emul=i386pep ;
1046                         targ_extra_emuls=i386pe ;
1047                         targ_extra_ofiles="deffilep.o pdb.o pep-dll-x86_64.o pe-dll.o"
1048                         ;;
1049 x86_64-*-cygwin)        targ_emul=i386pep ;
1050                         targ_extra_emuls=i386pe
1051                         targ_extra_ofiles="deffilep.o pdb.o pep-dll.o pe-dll.o"
1052                         test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api'
1053                         ;;
1054 x86_64-*-mingw*)        targ_emul=i386pep ;
1055                         targ_extra_emuls=i386pe
1056                         targ_extra_ofiles="deffilep.o pdb.o pep-dll.o pe-dll.o"
1057                         ;;
1058 x86_64-*-gnu*)          targ_emul=elf_x86_64
1059                         targ_extra_emuls="elf32_x86_64 elf_iamcu elf_i386"
1060                         targ_extra_libpath="elf_i386 elf32_x86_64"
1061                         tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
1062                         ;;
1063 xgate-*-*)              targ_emul=xgateelf
1064                         targ_extra_ofiles=ldelfgen.o
1065                         ;;
1066 xstormy16-*-*)          targ_emul=elf32xstormy16
1067                         ;;
1068 xtensa*-*-*)            targ_emul=elf32xtensa
1069                         ;;
1070 z80-*-elf*)             targ_emul=elf32z80
1071                         targ_extra_ofiles="ldelf.o ldelfgen.o"
1072                         ;;
1073 z80-*-coff)             targ_emul=z80
1074                         targ_extra_ofiles=
1075                         ;;
1076 z8k-*-coff)             targ_emul=z8002
1077                         targ_extra_emuls=z8001
1078                         targ_extra_ofiles=
1079                         ;;
1080 loongarch32-*)          targ_emul=elf32loongarch
1081                         ;;
1082 loongarch64-*)          targ_emul=elf64loongarch
1083                         ;;
1084 *-*-ieee*)              targ_emul=vanilla
1085                         targ_extra_ofiles=
1086                         ;;
1088   echo 2>&1 "*** ld does not support target ${targ}"
1089   echo 2>&1 "*** see ld/configure.tgt for supported targets"
1090   exit 1
1092 esac
1094 NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'
1095 case "${target}" in
1097 *-*-dragonfly*)
1098   NATIVE_LIB_DIRS='/lib /usr/lib /usr/pkg/lib /usr/local/lib'
1099   ;;
1101 *-*-freebsd*)
1102   NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib'
1103   ;;
1105 hppa*64*-*-hpux11*)
1106   NATIVE_LIB_DIRS=/usr/lib/pa20_64
1107   ;;
1109 i[3-7]86-*-sysv4*)
1110   NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
1111   ;;
1113 i[3-7]86-*-solaris*)
1114   NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
1115   ;;
1117 i[3-7]86-pc-interix*)
1118   NATIVE_LIB_DIRS='/usr/local/lib $$INTERIX_ROOT/usr/lib /lib /usr/lib'
1119   ;;
1121 ia64-*-aix*)
1122   NATIVE_LIB_DIRS='/usr/local/lib /usr/lib/ia64l64 /lib /usr/lib'
1123   ;;
1125 sparc*-*-solaris2*)
1126   NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
1127   ;;
1129 spu-*-elf*)
1130   # This allows one to build a pair of PPU/SPU toolchains with common sysroot.
1131   NATIVE_LIB_DIRS='/lib'
1132   ;;
1134 i[03-9x]86-*-cygwin* | x86_64-*-cygwin*)
1135   NATIVE_LIB_DIRS='/usr/lib /usr/lib/w32api'
1136   ;;
1138 *-*-linux*)
1139   ;;
1141 *-*-netbsd*)
1142   ;;
1144 alpha*-*-*)
1145   NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
1146   ;;
1148 esac
1150 case "${target}" in
1151 frv-*-* | hppa*-*-* | ia64-*-* | mips*-*-*)
1152   # Don't enable -z relro by default since many relro tests fail on these
1153   # targets:
1154   # FAIL: strip -z relro (relro1)
1155   # FAIL: strip -z relro -shared (relro1)
1156   # FAIL: objcopy -z relro (relro1)
1157   # FAIL: objcopy -z relro -shared (relro1)
1158   # FAIL: objcopy -z relro (tdata1)
1159   # FAIL: objcopy -shared -z relro (tdata1)
1160   # FAIL: objcopy -z relro (tdata2)
1161   # FAIL: objcopy -shared -z relro (tdata2)
1162   # FAIL: objcopy -z relro (tdata3)
1163   # FAIL: objcopy -shared -z relro (tdata3)
1164   # FAIL: objcopy -shared -z relro (tbss1)
1165   # FAIL: objcopy -shared -z relro (tbss2)
1166   # FAIL: objcopy -shared -z relro (tbss3)
1167   ;;
1168 *-*-linux*)
1169   if test ${ac_default_ld_z_relro} = unset; then
1170     ac_default_ld_z_relro=1
1171   fi
1172   ;;
1173 esac
1175 # Enable -z separate-code and --warn-textrel by default for Linux/x86.
1176 case "${target}" in
1177 i[3-7]86-*-linux-* | x86_64-*-linux-*)
1178   if test ${ac_default_ld_z_separate_code} = unset; then
1179     ac_default_ld_z_separate_code=1
1180   fi
1181   if test ${ac_default_ld_textrel_check} = unset; then
1182     ac_default_ld_textrel_check=yes
1183   fi
1184   ;;
1185 esac