Fix bug disassmbling binary files for non-octet byte targets.
authorTimothy Wall <twall@alum.mit.edu>
Tue, 18 Apr 2000 17:16:59 +0000 (17:16 +0000)
committerTimothy Wall <twall@alum.mit.edu>
Tue, 18 Apr 2000 17:16:59 +0000 (17:16 +0000)
binutils/ChangeLog
binutils/objdump.c

index b7e2e50dc8a6a2b043e6e2de6e2359b239f057df..8621445a0efc4d5ccdc195b995fe43edfce26921 100644 (file)
@@ -1,3 +1,8 @@
+2000-04-17  Timothy Wall  <twall@cygnus.com>
+
+       * objdump.c (disassemble_data): Set octets per byte *after*
+       resolving arch/mach for binary files.
+
 2000-04-14  Michael Sokolov  <msokolov@ivan.Harhan.ORG>
 
        * arlex.l: Add directives to increase lex buffer size.
index b86be6652b70df563fd9b36e3e269ec236656851..f29106fedac7f44c89d41e0354509f7a8e25d198 100644 (file)
@@ -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;