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