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:59, Doyle, Patrick wrote:
> > -----Original Message-----
> > From: Gary Thomas [mailto:gary@mlbassoc.com] 
> > Sent: Friday, July 30, 2004 8:50 AM
> > To: Doyle, Patrick
> > Cc: ecos discuss list
> > Subject: Re: [ECOS] binutils wizardry
> > 
> > 
> > 
> > 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.
> > 
> It's the "Arrange to have your special data in it's own ELF section" bit
> that I'm looking to get started on.  Starting with the raw binary file, can
> I convince objcopy or ld to wrap the appropriate gizmos around it to turn it
> into an ELF section starting at address 0x80000?
> 
> Once I have that, how can I glue that ELF section to the existing ELF
> application?
> 
> While I'm looking for the "teach me how to fish" answer here, I'd be glad
> for the "give me a fish" solution as well -- I'll just reverse engineer the
> "teach me how to fish" from that :-)

I've had little luck convincing objcopy to turn raw binary data into
any usable format, although it is purported to work.  Others may have 
been more successful.

What I normally do in situations like this is to turn the binary data 
into something that I can assemble/compile.  Look at how I did it for
the uE250 (PXA250) platform:
  ../packages/hal/arm/xscale/uE250/current/src/uE250_pci_bitstream.h

Getting that data into it's own ELF section can then be done using
"attribute" - see how it's done for the FLASH drivers.  You will need
to add special handling in your linker script as well, but using the
FLASH drivers (.2ram sections) you should be able to figure it out.

I hope this helps.  Beyond this, I'd end up tinkering for a while until
I got it right - I'm sure you can do the same.

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