This is the mail archive of the binutils@sourceware.org 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: Question about the differences between objdump and objcopy


 Hi Alan,
	Thanks for your reply.
	
	But I wonder it just caused by the difference of PHY/VIR addr?
	I tried another ELF file, with program header list below:

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x08000000 0x08000000 0x00000 0x0815c RW  0x10000
  LOAD           0x010000 0xfe000000 0xfe000000 0x24000 0x24050 RWE 0x10000
  LOAD           0x040000 0xfe040000 0xfe040000 0x3ac000 0x3ac000 R   0x10000
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4

	The Vir/Phy addr of all loadable segment are the same, but there is still many many pad bytes in binary output. 


Best Regards,
Edison

-----Original Message-----
From: Alan Modra [mailto:amodra@bigpond.net.au] 
Sent: 2008年5月22日 14:27
To: XU SHENG
Cc: binutils@sources.redhat.com
Subject: Re: Question about the differences between objdump and objcopy

On Thu, May 22, 2008 at 09:53:56AM +0800, XU SHENG wrote:
>            How ever, when I use objcopy to extract raw binary info. 
> from

The program headers you showed had PhysAddr entries differing from VirtAddr.  This will result in bfd sections with lma different to vma, and it is lma that is used when deciding where the data goes when writing a binary output.

--
Alan Modra
Australia Development Lab, IBM


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