help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

objcopy - converting .elf to .bin then back to .elf


From: Chantal van Schie
Subject: objcopy - converting .elf to .bin then back to .elf
Date: Thu, 15 Aug 2002 06:40:40 -0700 (PDT)

Hello,

I have the following question concerning objcopy: 

I have an ".elf" file which has been made using the following compiling and linking options:
Compiling: sh-elf-gcc -m2 -mb -O0 -gdwarf+ -g2 -fno-defer-pop -c -x c -fno-rtti -ffreestanding -fno-exceptions -fshort-enums -ansi -Wall

Linking:     sh-elf-ld -static --oformat=elf32-sh

The "filename.elf" obtained from this is 223kb in size

When I make an obsolute binary file out of this using the following instruction:
objcopy:     sh-elf-objcopy  -I elf32-sh -O binary filename.elf filename.bin
I obtain a "filename.bin" file of 4353kb in size

When I then try to copy the file back using objcopy as follows:
objcopy:     sh-elf-objcopy -I binary -O elf32-sh -B SH2 filename.bin newfilename.elf
I received a "newfilename.elf" file of 4353kb in size.

Summary:
filename.elf           223kb
filename.bin          4353kb
newfilename.elf     4353kb

I would have expected the newfilename.elf to be the same size as the filename.elf file originally used.  Why is this not so.  I do I reproduce the first file from the filename.bin file using objcopy?  I need to do this as I have to edit the checksum in manually.  Can anyone help?

Thanks, Chantal







 



 



Do You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs
reply via email to

[Prev in Thread] Current Thread [Next in Thread]