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]
Other format: [Raw text]

[patch] objdump dump fix


Hello,

objdump -s does not properly print objectfiles that have opb!=1. These includes the coff targets tic4x and tic54x (and probably a lot more targets). (These targets does not know about bytes, only increments in addresses - which span a storage- & bus-width of 16 or 32 bits.) Objdump loses information because it prints 16 bytes of data on one line (which is correct), and then increments the address pointer by 16 for the next line (which is incorrect).

The attached diff, is a suggestion to fix this problem.


Svein


binutils/ChangeLog:
2002-10-20 Svein E. Seldal <Svein.Seldal@solidas.com>

* objdump.c (dump_data): dump_data now adheres to
the opb value and dumps the data contents
properly for non-byte based object files.
Index: binutils/objdump.c
===================================================================
RCS file: /prosjekt/gnu/src/src/binutils/objdump.c,v
retrieving revision 1.59
diff -c -3 -p -r1.59 objdump.c
*** binutils/objdump.c	14 Oct 2002 12:07:58 -0000	1.59
--- binutils/objdump.c	20 Oct 2002 17:26:06 -0000
*************** dump_data (abfd)
*** 2237,2243 ****
  		    stop_offset = bfd_section_size (abfd, section) / opb;
  		}
  	      for (addr_offset = start_offset;
! 		   addr_offset < stop_offset; addr_offset += onaline)
  		{
  		  bfd_size_type j;
  
--- 2237,2243 ----
  		    stop_offset = bfd_section_size (abfd, section) / opb;
  		}
  	      for (addr_offset = start_offset;
! 		   addr_offset < stop_offset; addr_offset += (onaline / opb))
  		{
  		  bfd_size_type j;
  
*************** dump_data (abfd)
*** 2255,2261 ****
  		    }
  
  		  printf (" ");
! 		  for (j = addr_offset; j < addr_offset * opb + onaline; j++)
  		    {
  		      if (j >= stop_offset * opb)
  			printf (" ");
--- 2255,2261 ----
  		    }
  
  		  printf (" ");
! 		  for (j = addr_offset * opb; j < addr_offset * opb + onaline; j++)
  		    {
  		      if (j >= stop_offset * opb)
  			printf (" ");

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