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