From 003ca0fd22863aaf1a9811c8a35a0133a2d27fb1 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Wed, 24 May 2017 17:23:52 +0100 Subject: Refactor disassembler selection Nowadays, opcodes/disassemble.c:disassembler selects the proper disassembler according to ABFD only. However, it actually selects disassemblers according to arch, mach, endianess, and abfd. This patch adds them to the parameters of disassembler, so that its caller can still select disassemblers in case that abfd is NULL (a typical case in GDB). There isn't any functionality change. binutils: 2017-05-24 Yao Qi * objdump.c (disassemble_data): Caller update. include: 2017-05-24 Yao Qi * dis-asm.h (disassembler): Update declaration. opcodes: 2017-05-24 Yao Qi * disassemble.c (disassembler): Add arguments a, big and mach. Use them. sim/common: 2017-05-24 Yao Qi * sim-trace.c (trace_disasm): Caller update. --- binutils/objdump.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'binutils/objdump.c') diff --git a/binutils/objdump.c b/binutils/objdump.c index 5972da1..81d47a0 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -2386,7 +2386,9 @@ disassemble_data (bfd *abfd) } /* Use libopcodes to locate a suitable disassembler. */ - aux.disassemble_fn = disassembler (abfd); + aux.disassemble_fn = disassembler (bfd_get_arch (abfd), + bfd_big_endian (abfd), + bfd_get_mach (abfd), abfd); if (!aux.disassemble_fn) { non_fatal (_("can't disassemble for architecture %s\n"), -- cgit v1.1