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]

Re: arm-wince-pe-size reports empty .text


Hi Guys,

> Ian Lance Taylor <ian@airs.com> writes:

>> -D disassembles .rdata (even though it's meaningless), but it does not
>> disassemble .text. (see below)
>
> Hmmm, you're right, -D doesn't disassemble sections which do not have
> LOAD set.  Maybe that's a bug.  It doesn't seem to match the
> documentation.

Indeed.  I am applying the patch below to fix this, so that -D will
disassemble sections without the LOAD flag.

Cheers
        Nick

2003-07-24  Nick Clifton  <nickc@redhat.com>

	* objdump.c (disassemble_data): Do not ignore sections without the
	LOAD flag when disassemble_all is true.  Only print a message
	about disassembling a section if it contains some data.

Index: binutils/objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.70
diff -c -3 -p -r1.70 objdump.c
*** binutils/objdump.c	22 Jul 2003 13:33:32 -0000	1.70
--- binutils/objdump.c	24 Jul 2003 14:02:49 -0000
*************** disassemble_data (abfd)
*** 1628,1637 ****
        asymbol *sym = NULL;
        long place = 0;
  
!       if ((section->flags & SEC_LOAD) == 0
! 	  || (! disassemble_all
! 	      && only == NULL
! 	      && (section->flags & SEC_CODE) == 0))
  	continue;
  
        if (only != NULL)
--- 1628,1637 ----
        asymbol *sym = NULL;
        long place = 0;
  
!       /* Sections that do not contain machine code are not normally disassembled.  */
!       if (! disassemble_all
! 	  && only == NULL
! 	  && (section->flags & SEC_CODE) == 0)
  	continue;
  
        if (only != NULL)
*************** disassemble_data (abfd)
*** 1682,1692 ****
  	    }
  	}
  
-       printf (_("Disassembly of section %s:\n"), section->name);
- 
        datasize = bfd_get_section_size_before_reloc (section);
        if (datasize == 0)
  	continue;
  
        data = (bfd_byte *) xmalloc ((size_t) datasize);
  
--- 1682,1692 ----
  	    }
  	}
  
        datasize = bfd_get_section_size_before_reloc (section);
        if (datasize == 0)
  	continue;
+ 
+       printf (_("Disassembly of section %s:\n"), section->name);
  
        data = (bfd_byte *) xmalloc ((size_t) datasize);
  
        


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