This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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-elf-objcopy


On Tue, Jul 20, 2004 at 01:45:54PM -0300, Marco Aurélio da Cruz wrote:

> After I generate my .elf file I was using objcopy to generate a .hex 
> file. It happens that the .hex did not work in my EETOLS TOP MAX 
> Programmer. So I generated the .bin file, but it was huge (32MB).

If your bin file contains stuff that you don't need to burn
into flash, then something in your build process is broken.

Either your linker command file is generating initialization
records for sections it shouldn't, or your arguments to objcopy
are wrong.

> The objcopy generated a flat file that comprised the whole
> target memory map. So, I edited the .bin file and cut out all
> bytes until the beginning of the efective code (I supposed it
> should be at 0x0200:0000 but it was at 0x1FF:FC00). Afterwards
> I saved the new .bin file and recorded my EPROM and it worked 
> fine!!

You're doing things the hard way.  objcopy will do that for
you:

$ man objcopy

[...]

       -R sectionname
       --remove-section=sectionname
       
           Remove any section named sectionname from the output
           file.  This option may be given more than once.
           Note that using this option inappropriately may make
           the output file unusable.

Figure out what sections are generating data you don't want in
the bin file and tell objcopy not to copy them into the bin
file.  

-- 
Grant Edwards
grante@visi.com

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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