This is the mail archive of the binutils@sources.redhat.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]

Re: objdump : Odd formating if disassembly with --enable-64-bit-bfd


Alan Modra wrote:
> 
> On Thu, 11 Jan 2001, Erik de Castro Lopo wrote:
> 
> > No, I've got no complaints about that. The thing I think is odd is that
> > the movl does not line up with the call and push instructions. This makes
> > the aseembly listing much more difficult to read.
> >
> > 0x0000000008049325 68 b1 f0 04 08               push   $0x804f0b1
> > 0x000000000804932a e8 75 fc ff ff               call   0x0000000008048fa4
> > 0x000000000804932f c7 05 34 2c 05 08 00 00 00 00        movl  $0x0,0x8052c34
> 
> Hmm, that seems to be a side-effect of turning on prefix-intructions.
> 
> objdump.c:disassemble_bytes around line 1410 has:
> 
>               /* If ! prefix_addresses and ! wide_output, we print
>                  octets_per_line octets per line.  */
>               pb = octets;
>               if (pb > octets_per_line && ! prefix_addresses && ! wide_output)
>                 pb = octets_per_line;
> 
> You could remove `&& ! prefix_addresses' here, but that results in output
> like the following
> 
> 0x0000000008049347 c7 05 7c 47 05 08 00         movl   $0x0,0x805477c
>          804934e:       00 00 00
> 
> which is probably why the condition was added.  Feel free to provide
> patches to fix the problem ;-)

OK, here it is. This is a patch agains the 010111 daily build.

I've tried it with and without the --enable-64-bit-bfd configure option 
and it seems to fix the problem I was concerned with and not break 
anything else.

------------------------------------------------------------------------------
diff -cr binutils-010111/opcodes/i386-dis.c
binutils-010111-mods/opcodes/i386-dis.c
*** binutils-010111/opcodes/i386-dis.c	Fri Jan 12 06:51:14 2001
--- binutils-010111-mods/opcodes/i386-dis.c	Sat Jan 13 11:41:17 2001
***************
*** 2991,2999 ****
      abort ();
    orig_sizeflag = sizeflag;
  
!   /* The output looks better if we put 7 bytes on a line, since that
!      puts most long word instructions on a single line.  */
!   info->bytes_per_line = 7;
  
    info->private_data = (PTR) &priv;
    priv.max_fetched = priv.the_buffer;
--- 2991,2999 ----
      abort ();
    orig_sizeflag = sizeflag;
  
!   /* The output looks better if we put 10 bytes on a line, since that
!      puts all long word instructions on a single line.  */
!   info->bytes_per_line = 10;
  
    info->private_data = (PTR) &priv;
    priv.max_fetched = priv.the_buffer;
------------------------------------------------------------------------------

Erik
-- 
+----------------------------------------------------------+
  Erik de Castro Lopo  nospam@mega-nerd.com (Yes its valid)
+----------------------------------------------------------+
"In my opinion, shareware tends to combine the worst of 
commercial software (no sources) with the worst of free 
software (no finishing touches). I simply do not believe 
in the shareware market at all."  -- Linus Torvalds

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