Commit | Line | Data |
---|---|---|
49df10b1 DM |
1 | #!/bin/sh |
2 | ||
3 | # config.bfd | |
4 | # Convert a canonical host type into a BFD host type. | |
5 | # Call with canonical name as the argument. | |
6 | # Echos the result. | |
1fb83be6 | 7 | # If second argument is _, echoes whether underscores are stripped. |
49df10b1 DM |
8 | |
9 | canon="$1" | |
10 | cpu=`echo $canon | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` | |
11 | ||
1fb83be6 KR |
12 | # The binutils c++filt program wants to know whether underscores are |
13 | # stripped or not. It uses this information to choose a default. | |
14 | # This information is duplicated in the symbol_leading_char field of | |
15 | # the BFD target vector, but c++filt does not deal with object files | |
16 | # and is not linked against libbfd.a. It is not terribly important | |
17 | # that c++filt get this right; it is just convenient. | |
18 | strip_underscore=no | |
19 | ||
49df10b1 DM |
20 | # WHEN ADDING ENTRIES TO THIS MATRIX: |
21 | # Make sure that the left side always has two dashes. Otherwise you | |
22 | # can get spurious matches. Even for unambiguous cases, do this as a | |
23 | # convention, else the table becomes a real mess to understand and maintain. | |
24 | ||
25 | case "${canon}" in | |
1e02dc45 | 26 | alpha-*-netware*) bfd_name=alpha-nlm ;; |
49df10b1 | 27 | alpha-*-*) bfd_name=alphaosf ;; |
e18ecf7a ILT |
28 | # start-sanitize-arc |
29 | arc-*-elf*) bfd_name=arc-elf ;; | |
30 | # end-sanitize-arc | |
d94aca1a | 31 | arm-*-riscix*) bfd_name=riscix ;; |
bd676d26 SC |
32 | arm-*-pe*) bfd_name=arm-pe strip_underscore=yes ;; |
33 | arm-*-aout | armel-*-aout) | |
34 | bfd_name=arml-aout ;; | |
35 | armeb-*-aout) bfd_name=armb-aout ;; | |
1fb83be6 KR |
36 | a29k-*-ebmon*) bfd_name=a29k-coff strip_underscore=yes ;; |
37 | a29k-*-udi*) bfd_name=a29k-coff strip_underscore=yes ;; | |
38 | a29k-*-aout*) bfd_name=a29k-aout strip_underscore=yes ;; | |
39 | a29k-*-coff*) bfd_name=a29k-coff strip_underscore=yes ;; | |
40 | a29k-*-sym1*) bfd_name=a29k-coff strip_underscore=yes ;; | |
490d89a7 | 41 | a29k-*-vxworks*) bfd_name=a29k-coff strip_underscore=yes ;; |
1fb83be6 KR |
42 | h8300*-*-*) bfd_name=h8300-coff strip_underscore=yes ;; |
43 | h8500-*-*) bfd_name=h8500-coff strip_underscore=yes ;; | |
44 | sh-*-*) bfd_name=sh-coff strip_underscore=yes ;; | |
03c4ce2f MT |
45 | # start-sanitize-rce |
46 | rce-*-aout) bfd_name=rce-aout ;; | |
47 | # end-sanitize-rce | |
1e02dc45 | 48 | hppa*-*-*elf*) bfd_name=hppa-elf ;; |
c7b44b04 | 49 | hppa*-*-lites*) bfd_name=hppa-elf ;; |
49df10b1 DM |
50 | hppa*-*-bsd*) bfd_name=hppabsd ;; |
51 | hppa*-*-hpux*) bfd_name=hppahpux ;; | |
bdacad9c | 52 | hppa*-*-hiux*) bfd_name=hppahpux ;; |
1e02dc45 | 53 | hppa*-*-osf*) bfd_name=hppaosf ;; |
073e795f ILT |
54 | i[345]86-*-sysv4*) bfd_name=i386-elf ;; |
55 | i[345]86-*-unixware) bfd_name=i386-elf ;; | |
56 | i[345]86-*-solaris2*) bfd_name=i386-elf ;; | |
57 | i[345]86-*-sysv*) bfd_name=i386-coff ;; | |
58 | i[345]86-*-isc*) bfd_name=i386-coff ;; | |
59 | i[345]86-*-sco*) bfd_name=i386-coff ;; | |
60 | i[345]86-sequent-bsd*) bfd_name=i386-dynix strip_underscore=yes ;; | |
61 | i[345]86-*-bsd*) bfd_name=i386-bsd strip_underscore=yes ;; | |
62 | i[345]86-*-coff) bfd_name=i386-coff ;; | |
63 | i[345]86-*-aix*) bfd_name=i386-coff ;; | |
64 | i[345]86-*-elf) bfd_name=i386-elf ;; | |
5b0f1ab5 | 65 | i[345]86-*-freebsd*) bfd_name=i386-bsd strip_underscore=yes ;; |
d94aca1a | 66 | i[345]86-*-netbsd*) bfd_name=i386-nbsd strip_underscore=yes ;; |
073e795f | 67 | i[345]86-*-netware*) bfd_name=i386-nlm ;; |
c7b44b04 | 68 | i[345]86-*-linuxaout*) bfd_name=i386-laout strip_underscore=yes ;; |
073e795f ILT |
69 | i[345]86-*-linux*) bfd_name=i386-linux strip_underscore=yes ;; |
70 | i[345]86-*-lynxos*) bfd_name=i386-lynx ;; | |
bd676d26 | 71 | i[345]86-*-gnu*) bfd_name=i386-gelf strip_underscore=yes ;; |
073e795f ILT |
72 | i[345]86-*-mach*) bfd_name=i386-mach3 strip_underscore=yes ;; |
73 | i[345]86-*-osf1mk*) bfd_name=i386-mach3 strip_underscore=yes ;; | |
74 | i[345]86-*-os9k) bfd_name=i386-os9k ;; | |
bd676d26 SC |
75 | i[345]86-*-msdos*) bfd_name=i386-msdos ;; |
76 | i[345]86-*-moss*) bfd_name=i386-moss ;; | |
77 | i[345]86-*-win32) bfd_name=i386-pe ;; | |
78 | i[345]86-*-winnt) bfd_name=i386-pe ;; | |
79 | i[345]86-*-pe) bfd_name=i386-pe ;; | |
073e795f | 80 | i[345]86-none-*) bfd_name=i386-coff ;; |
1fb83be6 KR |
81 | i960-*-vxworks4*) bfd_name=i960-bout strip_underscore=yes ;; |
82 | i960-*-vxworks5.0) bfd_name=i960-bout strip_underscore=yes ;; | |
83 | i960-*-vxworks5.*) bfd_name=i960-coff strip_underscore=yes ;; | |
84 | i960-*-vxworks*) bfd_name=i960-bout strip_underscore=yes ;; | |
85 | i960-*-aout*) bfd_name=i960-bout strip_underscore=yes ;; | |
86 | i960-*-bout*) bfd_name=i960-bout strip_underscore=yes ;; | |
87 | i960-*-coff*) bfd_name=i960-coff strip_underscore=yes ;; | |
88 | i960-*-nindy*) bfd_name=i960-bout strip_underscore=yes ;; | |
127f8e91 | 89 | m68*-apollo-*) bfd_name=apollo ;; |
bd676d26 | 90 | m68*-bull-sysv*) bfd_name=u68k-coff strip_underscore=yes ;; |
1fb83be6 KR |
91 | m68*-hp-bsd*) bfd_name=hp300bsd strip_underscore=yes ;; |
92 | m68*-*-aout*) bfd_name=m68k-0aout strip_underscore=yes ;; | |
ffa2b1df | 93 | m68*-*-coff*) bfd_name=m68k-coff ;; |
c7b44b04 | 94 | m68*-*-elf*) bfd_name=m68k-elf ;; |
1fb83be6 | 95 | m68*-*-hpux*) bfd_name=hp300hpux strip_underscore=yes ;; |
bdacad9c | 96 | m68*-*-lynxos*) bfd_name=m68k-lynx ;; |
d94aca1a | 97 | m68*-*-netbsd*) bfd_name=m68k-nbsd strip_underscore=yes ;; |
1fb83be6 KR |
98 | m68*-*-os68k*) bfd_name=m68k-aout strip_underscore=yes ;; |
99 | m68*-*-sunos*) bfd_name=m68k-aout strip_underscore=yes ;; | |
6198b7a1 | 100 | m68*-*-sysv4*) bfd_name=m68k-elf ;; |
1e02dc45 | 101 | m68*-*-sysv*) bfd_name=m68k-coff ;; |
1fb83be6 KR |
102 | m68*-*-vxworks*) bfd_name=m68k-aout strip_underscore=yes ;; |
103 | m68*-ericsson-*) bfd_name=m68k-ose strip_underscore=yes ;; | |
104 | m68*-netx-*) bfd_name=m68k-aout strip_underscore=yes ;; | |
1e02dc45 | 105 | |
073e795f | 106 | m88*-harris-cxux*) bfd_name=m88k-elf ;; |
1e02dc45 KR |
107 | # DGUX used to use COFF, but now (Jan 94) I believe it uses ELF by default. |
108 | m88*-*-dgux*) bfd_name=m88k-elf ;; | |
1fb83be6 KR |
109 | m88*-*-mach3*) bfd_name=m88k-mach3 ;; |
110 | m88*-*-sysv4*) bfd_name=m88k-elf ;; | |
111 | m88*-*-*) bfd_name=m88k-coff strip_underscore=yes ;; | |
1e02dc45 | 112 | |
6198b7a1 | 113 | mips*-big-*) bfd_name=bigmips ;; |
1fb83be6 KR |
114 | mips*-dec-bsd*) bfd_name=mipsdecbsd strip_underscore=yes ;; |
115 | mips*-dec-mach3*) bfd_name=mips-mach3 ;; | |
6198b7a1 JK |
116 | mips*-dec-*) bfd_name=decstation ;; |
117 | mips*el-*-ecoff*) bfd_name=decstation ;; | |
118 | mips*-*-ecoff*) bfd_name=bigmips ;; | |
5dac2dd5 | 119 | mips*-*-irix5*) bfd_name=mipsbelf ;; |
6198b7a1 | 120 | mips*-sgi-*) bfd_name=bigmips ;; |
1fb83be6 | 121 | mips*-*-mach3*) bfd_name=mips-mach3 ;; |
dbf13547 | 122 | mips*-*-sysv4*) bfd_name=mipsbelf ;; |
6198b7a1 JK |
123 | mips*-*-sysv*) bfd_name=riscos ;; |
124 | mips*-*-riscos*) bfd_name=riscos ;; | |
242f60e2 | 125 | mips*-*-bsd*) bfd_name=bigmips ;; # Sony News |
6198b7a1 JK |
126 | mips*el-*-elf*) bfd_name=mipslelf ;; |
127 | mips*-*-elf*) bfd_name=mipsbelf ;; | |
1fb83be6 | 128 | ns32k-pc532-mach*) bfd_name=pc532-mach strip_underscore=yes;; |
073e795f | 129 | ns32k-*-netbsd*) bfd_name=ns32k-nbsd strip_underscore=yes;; |
ce8f1f60 | 130 | powerpc-*-aix*) bfd_name=rs6000 ;; |
1fb83be6 | 131 | powerpc-*-elf*) bfd_name=ppc-elf ;; |
ce8f1f60 | 132 | powerpc-*-sysv4*) bfd_name=ppc-elf ;; |
c6d729b3 | 133 | powerpc-*-eabi*) bfd_name=ppc-elf ;; |
ce8f1f60 | 134 | powerpc-*-netware*) bfd_name=ppc-nlm ;; |
c7b44b04 MM |
135 | powerpcle-*-elf*) bfd_name=ppcle-elf ;; |
136 | powerpcle-*-sysv4*) bfd_name=ppcle-elf ;; | |
137 | powerpcle-*-eabi*) bfd_name=ppcle-elf ;; | |
49df10b1 | 138 | rs6000-*-*) bfd_name=rs6000 ;; |
6198b7a1 | 139 | sparc-*-lynxos*) bfd_name=sparc-lynx ;; |
d94aca1a | 140 | sparc-*-netbsd*) bfd_name=sparc-nbsd strip_underscore=yes;; |
49df10b1 DM |
141 | sparc-*-solaris2*) bfd_name=sparc-elf ;; |
142 | sparc-*-sysv4*) bfd_name=sparc-elf ;; | |
1fb83be6 | 143 | sparc64-*-aout*) bfd_name=sparc-aout strip_underscore=yes ;; |
5dac2dd5 | 144 | sparc64-*-elf*) bfd_name=sparc64-elf ;; |
4a703e06 | 145 | sparc-*-netware*) bfd_name=sparc-nlm ;; |
fff9ad37 | 146 | sparc*-*-coff*) bfd_name=sparc-coff ;; |
1fb83be6 KR |
147 | sparc*-*-*) bfd_name=sparc-aout strip_underscore=yes ;; |
148 | tahoe-*-*) bfd_name=tahoe strip_underscore=yes ;; | |
ffa2b1df | 149 | vax-*-vms*) bfd_name=vax-vms ;; |
1fb83be6 | 150 | vax-*-*) bfd_name=vax strip_underscore=yes ;; |
49df10b1 | 151 | we32k-*-*) bfd_name=we32k ;; |
e18ecf7a | 152 | w65-*-*) bfd_name=w65 ;; |
1fb83be6 | 153 | z8k*-*-*) bfd_name=z8k-coff strip_underscore=yes ;; |
49df10b1 | 154 | |
1fb83be6 KR |
155 | *-*-aout*) bfd_name=${cpu}-aout strip_underscore=yes ;; |
156 | *-*-bsd*) bfd_name=${cpu}-aout strip_underscore=yes ;; | |
49df10b1 DM |
157 | *-*-netware*) bfd_name=${cpu}-nlm ;; |
158 | *-*-sysv4*) bfd_name=${cpu}-elf ;; | |
159 | *-*-solaris2*) bfd_name=${cpu}-elf ;; | |
1fb83be6 | 160 | *-*-vsta*) bfd_name=${cpu}-aout strip_underscore=yes ;; |
dbf13547 | 161 | *-*-go32*) bfd_name=${cpu}-coff ;; |
49df10b1 DM |
162 | *-*-sysv*) bfd_name=${cpu}-coff ;; |
163 | ||
1fb83be6 | 164 | *-*-aout64*) bfd_name=${cpu}-aout64 strip_underscore=yes ;; |
5dac2dd5 | 165 | *-*-elf64*) bfd_name=${cpu}-elf64 ;; |
49df10b1 | 166 | |
1fb83be6 KR |
167 | *-adobe-*) bfd_name=adobe strip_underscore=yes ;; |
168 | *-sony-*) bfd_name=news strip_underscore=yes ;; | |
49df10b1 DM |
169 | *-intel-*) bfd_name=${cpu}-coff ;; |
170 | *-stratus-*) bfd_name=${cpu}-elf ;; | |
171 | *-cbm-*) bfd_name=${cpu}-elf ;; | |
172 | *-ncr-*) bfd_name=${cpu}-elf ;; | |
173 | *-tandem-*) bfd_name=st2000 ;; | |
174 | ||
175 | # Allow targets that config.sub doesn't recognize, like "all". | |
176 | *) bfd_name=$canon ;; | |
177 | esac | |
178 | ||
1fb83be6 KR |
179 | if [ "x$2" = "x_" ]; then |
180 | echo $strip_underscore | |
181 | else | |
182 | echo $bfd_name | |
183 | fi |