1 /* Select disassembly routine for specified architecture.
2 Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
27 /* start-sanitize-d30v */
29 /* end-sanitize-d30v */
46 /* start-sanitize-tic80 */
48 /* end-sanitize-tic80 */
58 enum bfd_architecture a = bfd_get_arch (abfd);
59 disassembler_ftype disassemble;
63 /* If you add a case to this table, also add it to the
64 ARCH_all definition right above this function. */
67 /* As far as I know we only handle big-endian 29k objects. */
68 disassemble = print_insn_big_a29k;
73 disassemble = print_insn_alpha;
79 disassemble = arc_get_disassembler (bfd_get_mach (abfd),
80 bfd_big_endian (abfd));
86 if (bfd_big_endian (abfd))
87 disassemble = print_insn_big_arm;
89 disassemble = print_insn_little_arm;
94 disassemble = print_insn_d10v;
97 /* start-sanitize-d30v */
100 disassemble = print_insn_d30v;
103 /* end-sanitize-d30v */
106 if (bfd_get_mach(abfd) == bfd_mach_h8300h)
107 disassemble = print_insn_h8300h;
108 else if (bfd_get_mach(abfd) == bfd_mach_h8300s)
109 disassemble = print_insn_h8300s;
111 disassemble = print_insn_h8300;
116 disassemble = print_insn_h8500;
121 disassemble = print_insn_hppa;
126 disassemble = print_insn_i386;
131 disassemble = print_insn_i960;
136 disassemble = print_insn_m32r;
141 disassemble = print_insn_m68k;
146 disassemble = print_insn_m88k;
151 disassemble = print_insn_ns32k;
156 if (bfd_big_endian (abfd))
157 disassemble = print_insn_big_mips;
159 disassemble = print_insn_little_mips;
163 case bfd_arch_mn10200:
164 disassemble = print_insn_mn10200;
168 case bfd_arch_mn10300:
169 disassemble = print_insn_mn10300;
173 case bfd_arch_powerpc:
174 if (bfd_big_endian (abfd))
175 disassemble = print_insn_big_powerpc;
177 disassemble = print_insn_little_powerpc;
181 case bfd_arch_rs6000:
182 disassemble = print_insn_rs6000;
187 if (bfd_big_endian (abfd))
188 disassemble = print_insn_sh;
190 disassemble = print_insn_shl;
195 disassemble = print_insn_sparc;
198 /* start-sanitize-tic80 */
201 disassemble = print_insn_tic80;
204 /* end-sanitize-tic80 */
207 disassemble = print_insn_v850;
212 disassemble = print_insn_w65;
217 if (bfd_get_mach(abfd) == bfd_mach_z8001)
218 disassemble = print_insn_z8001;
220 disassemble = print_insn_z8002;
229 /* Notify the disassembler of the address associated with the
230 instruction being decoded: */
233 disasm_symaddr (sym, info)
235 disassemble_info *info;
238 /* decide if symbol is thumb or not */
239 if (info->flavour == bfd_target_coff_flavour)
241 /* This is not ideal including these here, since we may not be
242 building a COFF targetted world at all... so coffsymbol() may not
243 be available. (TO BE SORTED OUT) */
244 #include "coff/internal.h"
246 coff_symbol_type *cs = coffsymbol (sym);
247 if ( cs->native->u.syment.n_sclass == C_THUMBEXT
248 || cs->native->u.syment.n_sclass == C_THUMBSTAT
249 || cs->native->u.syment.n_sclass == C_THUMBLABEL
250 || cs->native->u.syment.n_sclass == C_THUMBEXTFUNC
251 || cs->native->u.syment.n_sclass == C_THUMBSTATFUNC)
257 /* Do nothing for other architectures at the moment */