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