Question about the differences between objdump and objcopy

XU SHENG Sheng.Xu@alcatel-lucent.com
Thu May 22 01:54:00 GMT 2008


Hello, all
	I'm puzzled by the following cases while using objcopy to
extract the raw binary file from an ELF formatted file.

	Below is the outputs of program headers while using readelf
tool:
	Program Headers:
 	 Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz
Flg Align
 	 LOAD           0x0000a0 0x00200000 0x00200000 0x205fcc 0x205fcc
RWE 0x20
 	 LOAD           0x20606c 0x0040e000 0x00405fd0 0x01610 0x01610
RW  0x4
 	 LOAD           0x207690 0x0040f610 0x0040f610 0x00000 0x9ffa8
RW  0x20 

           So segment No.1 is start at the offset 0x0000a0 while occupy
0x205fcc bytes in ELF file, and the segment No. 2 is start start at
0x20606c (0x0000a0  + 0x205fcc ) in ELF file; in otherwords, those two
segments resident continueously in ELF file.
           How ever, when I use objcopy to extract raw binary info. from
that ELF file, the actual start offset of segment No.2 is at 0x205df0
(not 0x205fcc, but 0x205fcc + 0x4). It's strange to me because 0x205fcc
has already 4bytes align. It's seems that objcopy tool insert 4 zeroed
bytes for unknow purpose. Does any body here know why?
	Thanks.
 
Best Regards
Edison Xu 



More information about the Binutils mailing list