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