4 # Convert a canonical host type into a BFD host type.
5 # Call with canonical name as the argument.
7 # If second argument is _, echoes whether underscores are stripped.
10 cpu
=`echo $canon | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
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.
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.
26 alpha-
*-netware*) bfd_name
=alpha-nlm
;;
27 alpha-
*-*) bfd_name
=alphaosf
;;
28 a29k-
*-ebmon*) bfd_name
=a29k-coff strip_underscore
=yes ;;
29 a29k-
*-udi*) bfd_name
=a29k-coff strip_underscore
=yes ;;
30 a29k-
*-aout*) bfd_name
=a29k-aout strip_underscore
=yes ;;
31 a29k-
*-coff*) bfd_name
=a29k-coff strip_underscore
=yes ;;
32 a29k-
*-sym1*) bfd_name
=a29k-coff strip_underscore
=yes ;;
33 h8300
*-*-*) bfd_name
=h8300-coff strip_underscore
=yes ;;
34 h8500-
*-*) bfd_name
=h8500-coff strip_underscore
=yes ;;
35 sh-
*-*) bfd_name
=sh-coff strip_underscore
=yes ;;
36 hppa
*-*-*elf
*) bfd_name
=hppa-elf
;;
37 hppa
*-*-bsd*) bfd_name
=hppabsd
;;
38 hppa
*-*-hpux*) bfd_name
=hppahpux
;;
39 hppa
*-*-hiux*) bfd_name
=hppahpux
;;
40 hppa
*-*-osf*) bfd_name
=hppaosf
;;
41 i
[34]86-*-sysv4*) bfd_name
=i386-elf
;;
42 i
[34]86-*-unixware) bfd_name
=i386-elf
;;
43 i
[34]86-*-solaris2*) bfd_name
=i386-elf
;;
44 i
[34]86-*-sysv*) bfd_name
=i386-coff
;;
45 i
[34]86-*-isc*) bfd_name
=i386-coff
;;
46 i
[34]86-*-sco*) bfd_name
=i386-coff
;;
47 i
[34]86-sequent-bsd*) bfd_name
=i386-dynix strip_underscore
=yes ;;
48 i
[34]86-*-bsd*) bfd_name
=i386-bsd strip_underscore
=yes ;;
49 i
[34]86-*-coff) bfd_name
=i386-coff
;;
50 i
[34]86-*-aix*) bfd_name
=i386-coff
;;
51 i
[34]86-*-elf) bfd_name
=i386-elf
;;
52 i
[34]86-*-netbsd*) bfd_name
=i386-netbsd strip_underscore
=yes ;;
53 i
[34]86-*-netware*) bfd_name
=i386-nlm
;;
54 i
[34]86-*-linux*) bfd_name
=i386-linux strip_underscore
=yes ;;
55 i
[34]86-*-lynxos*) bfd_name
=i386-lynx
;;
56 i
[34]86-*-gnu*) bfd_name
=i386-mach3 strip_underscore
=yes ;;
57 i
[34]86-*-mach*) bfd_name
=i386-mach3 strip_underscore
=yes ;;
58 i
[34]86-*-osf1mk*) bfd_name
=i386-mach3 strip_underscore
=yes ;;
59 i
[34]86-*-os9k) bfd_name
=i386-os9k
;;
60 i
[34]86-none-*) bfd_name
=i386-coff
;;
61 i960-
*-vxworks4*) bfd_name
=i960-bout strip_underscore
=yes ;;
62 i960-
*-vxworks5.0
) bfd_name
=i960-bout strip_underscore
=yes ;;
63 i960-
*-vxworks5.
*) bfd_name
=i960-coff strip_underscore
=yes ;;
64 i960-
*-vxworks*) bfd_name
=i960-bout strip_underscore
=yes ;;
65 i960-
*-aout*) bfd_name
=i960-bout strip_underscore
=yes ;;
66 i960-
*-bout*) bfd_name
=i960-bout strip_underscore
=yes ;;
67 i960-
*-coff*) bfd_name
=i960-coff strip_underscore
=yes ;;
68 i960-
*-nindy*) bfd_name
=i960-bout strip_underscore
=yes ;;
69 m68
*-apollo-*) bfd_name
=apollo
;;
70 m68
*-bull-sysv*) bfd_name
=u68k-coff
;;
71 m68
*-hp-bsd*) bfd_name
=hp300bsd strip_underscore
=yes ;;
72 m68
*-*-aout*) bfd_name
=m68k-0aout strip_underscore
=yes ;;
73 m68
*-*-coff*) bfd_name
=m68k-coff
;;
74 m68
*-*-hpux*) bfd_name
=hp300hpux strip_underscore
=yes ;;
75 m68
*-*-lynxos*) bfd_name
=m68k-lynx
;;
76 m68
*-*-os68k*) bfd_name
=m68k-aout strip_underscore
=yes ;;
77 m68
*-*-sunos*) bfd_name
=m68k-aout strip_underscore
=yes ;;
78 m68
*-*-sysv4*) bfd_name
=m68k-elf
;;
79 m68
*-*-sysv*) bfd_name
=m68k-coff
;;
80 m68
*-*-vxworks*) bfd_name
=m68k-aout strip_underscore
=yes ;;
81 m68
*-ericsson-*) bfd_name
=m68k-ose strip_underscore
=yes ;;
82 m68
*-netx-*) bfd_name
=m68k-aout strip_underscore
=yes ;;
84 # DGUX used to use COFF, but now (Jan 94) I believe it uses ELF by default.
85 m88
*-*-dgux*) bfd_name
=m88k-elf
;;
86 m88
*-*-mach3*) bfd_name
=m88k-mach3
;;
87 m88
*-*-sysv4*) bfd_name
=m88k-elf
;;
88 m88
*-*-*) bfd_name
=m88k-coff strip_underscore
=yes ;;
90 mips
*-big-*) bfd_name
=bigmips
;;
91 mips
*-dec-bsd*) bfd_name
=mipsdecbsd strip_underscore
=yes ;;
92 mips
*-dec-mach3*) bfd_name
=mips-mach3
;;
93 mips
*-dec-*) bfd_name
=decstation
;;
94 mips
*el-
*-ecoff*) bfd_name
=decstation
;;
95 mips
*-*-ecoff*) bfd_name
=bigmips
;;
96 mips
*-*-irix5*) bfd_name
=mipsbelf
;;
97 mips
*-sgi-*) bfd_name
=bigmips
;;
98 mips
*-*-mach3*) bfd_name
=mips-mach3
;;
99 mips
*-*-sysv4*) bfd_name
=mipsbelf
;;
100 mips
*-*-sysv*) bfd_name
=riscos
;;
101 mips
*-*-riscos*) bfd_name
=riscos
;;
102 mips
*-*-bsd*) bfd_name
=bigmips
;; # Sony News
103 mips
*el-
*-elf*) bfd_name
=mipslelf
;;
104 mips
*-*-elf*) bfd_name
=mipsbelf
;;
105 ns32k-pc532-mach
*) bfd_name
=pc532-mach strip_underscore
=yes;;
106 ns32k-
*-netbsd*) bfd_name
=ns32k-netbsd strip_underscore
=yes;;
107 powerpc-
*-aix*) bfd_name
=rs6000
;;
108 powerpc-
*-elf*) bfd_name
=ppc-elf
;;
109 powerpc-
*-sysv4*) bfd_name
=ppc-elf
;;
110 powerpc-
*-netware*) bfd_name
=ppc-nlm
;;
111 rs6000-
*-*) bfd_name
=rs6000
;;
112 sparc-
*-lynxos*) bfd_name
=sparc-lynx
;;
113 sparc-
*-solaris2*) bfd_name
=sparc-elf
;;
114 sparc-
*-sysv4*) bfd_name
=sparc-elf
;;
115 sparc64-
*-aout*) bfd_name
=sparc-aout strip_underscore
=yes ;;
116 sparc64-
*-elf*) bfd_name
=sparc64-elf
;;
117 sparc-
*-netware*) bfd_name
=sparc-nlm
;;
118 sparc
*-*-coff*) bfd_name
=sparc-coff
;;
119 sparc
*-*-*) bfd_name
=sparc-aout strip_underscore
=yes ;;
120 tahoe-
*-*) bfd_name
=tahoe strip_underscore
=yes ;;
121 vax-
*-vms*) bfd_name
=vax-vms
;;
122 vax-
*-*) bfd_name
=vax strip_underscore
=yes ;;
123 we32k-
*-*) bfd_name
=we32k
;;
124 z8k
*-*-*) bfd_name
=z8k-coff strip_underscore
=yes ;;
126 *-*-aout*) bfd_name
=${cpu}-aout strip_underscore
=yes ;;
127 *-*-bsd*) bfd_name
=${cpu}-aout strip_underscore
=yes ;;
128 *-*-netware*) bfd_name
=${cpu}-nlm ;;
129 *-*-sysv4*) bfd_name
=${cpu}-elf ;;
130 *-*-solaris2*) bfd_name
=${cpu}-elf ;;
131 *-*-vsta*) bfd_name
=${cpu}-aout strip_underscore
=yes ;;
132 *-*-go32*) bfd_name
=${cpu}-coff ;;
133 *-*-sysv*) bfd_name
=${cpu}-coff ;;
135 *-*-aout64*) bfd_name
=${cpu}-aout64 strip_underscore
=yes ;;
136 *-*-elf64*) bfd_name
=${cpu}-elf64 ;;
138 *-adobe-*) bfd_name
=adobe strip_underscore
=yes ;;
139 *-sony-*) bfd_name
=news strip_underscore
=yes ;;
140 *-intel-*) bfd_name
=${cpu}-coff ;;
141 *-stratus-*) bfd_name
=${cpu}-elf ;;
142 *-cbm-*) bfd_name
=${cpu}-elf ;;
143 *-ncr-*) bfd_name
=${cpu}-elf ;;
144 *-tandem-*) bfd_name
=st2000
;;
146 # Allow targets that config.sub doesn't recognize, like "all".
147 *) bfd_name
=$canon ;;
150 if [ "x$2" = "x_" ]; then
151 echo $strip_underscore