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: binutils wizardry


On Fri, 2004-07-30 at 06:42, Doyle, Patrick wrote:
> I have an existing application that I load onto my device with RedBoot.  I
> have a raw binary data file that I also load onto my device that my
> application expects to find in memory at address 0x80000.  I would like to
> figure out some method, preferably _after_ I've linked my main application,
> to glue these two pieces together into a single ELF file so that I could
> download both pieces in one swell foop.
> 
> I'm reasonably sure I can do this with some subset of the programs in
> binutils, but I'm not too sure where to start.  I vaguely remember looking
> at how Linux gets gzip'ed for booting (10 or more years ago), so I'll
> probably start there, but, in the mean time, I thought I would ask for some
> pointers.

This probably wouldn't help much with your situation.

> 
> Any pointers?

Arrange to have your special data in it's own ELF section.  Then you can
use objcopy to adjust the address of that section (and leave the rest 
alone).  You should be able to work out the details to get your program
to load one place and the data in a totally different one.

With some magic spells, you could probably even make this happen 
directly at link time (by editing the linker scripts).

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


-- 
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]