From ea58412531563145414cc6f028046d74f9037a58 Mon Sep 17 00:00:00 2001 From: Timothy Wall Date: Tue, 18 Apr 2000 17:16:59 +0000 Subject: [PATCH] Fix bug disassmbling binary files for non-octet byte targets. --- binutils/ChangeLog | 5 +++++ binutils/objdump.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index b7e2e50dc8a..8621445a0ef 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2000-04-17 Timothy Wall + + * objdump.c (disassemble_data): Set octets per byte *after* + resolving arch/mach for binary files. + 2000-04-14 Michael Sokolov * arlex.l: Add directives to increase lex buffer size. diff --git a/binutils/objdump.c b/binutils/objdump.c index b86be6652b7..f29106fedac 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -1572,7 +1572,7 @@ disassemble_data (abfd) struct disassemble_info disasm_info; struct objdump_disasm_info aux; asection *section; - unsigned int opb = bfd_octets_per_byte (abfd); + unsigned int opb; print_files = NULL; prev_functionname = NULL; @@ -1594,7 +1594,6 @@ disassemble_data (abfd) aux.require_sec = false; disasm_info.print_address_func = objdump_print_address; disasm_info.symbol_at_address_func = objdump_symbol_at_address; - disasm_info.octets_per_byte = opb; if (machine != (char *) NULL) { @@ -1625,10 +1624,13 @@ disassemble_data (abfd) return; } + opb = bfd_octets_per_byte (abfd); + disasm_info.flavour = bfd_get_flavour (abfd); disasm_info.arch = bfd_get_arch (abfd); disasm_info.mach = bfd_get_mach (abfd); disasm_info.disassembler_options = disassembler_options; + disasm_info.octets_per_byte = opb; if (bfd_big_endian (abfd)) disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_BIG; -- 2.30.2