This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] objdump of binary images


This patch fixes a bug when loading binary images for targets with
non-octet bytes.

* binutils/objdump.c (disassemble_data): Set octets per byte *after*
resolving arch/mach for binary files.


Index: objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.22
diff -d -c -p -r1.22 objdump.c
*** objdump.c	2000/04/07 04:34:50	1.22
--- objdump.c	2000/04/17 21:15:48
*************** disassemble_data (abfd)
*** 1578,1584 ****
    struct disassemble_info disasm_info;
    struct objdump_disasm_info aux;
    asection *section;
!   unsigned int opb = bfd_octets_per_byte (abfd);
  
    print_files = NULL;
    prev_functionname = NULL;
--- 1578,1584 ----
    struct disassemble_info disasm_info;
    struct objdump_disasm_info aux;
    asection *section;
!   unsigned int opb;
  
    print_files = NULL;
    prev_functionname = NULL;
*************** disassemble_data (abfd)
*** 1600,1606 ****
    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)
      {
--- 1600,1605 ----
*************** disassemble_data (abfd)
*** 1631,1640 ****
--- 1630,1642 ----
        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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]