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