public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: "Doyle, Patrick" <WPD@dtccom.com>
Cc: ecos discuss list <ecos-discuss@sources.redhat.com>
Subject: RE: [ECOS] binutils wizardry
Date: Fri, 30 Jul 2004 14:18:00 -0000	[thread overview]
Message-ID: <1091192888.10813.185.camel@hermes> (raw)
In-Reply-To: <F18ED44D2778844592DFB732956B66510225C609@DTCNT40S4>

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

  reply	other threads:[~2004-07-30 13:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-30 13:48 Doyle, Patrick
2004-07-30 14:18 ` Gary Thomas [this message]
2004-07-30 15:05 ` Sergei Organov
  -- strict thread matches above, loose matches on Subject: below --
2004-08-02 21:13 Doyle, Patrick
2004-08-01 22:52 Andrew Dyer
2004-07-30 16:17 Doyle, Patrick
2004-07-30 12:59 Doyle, Patrick
2004-07-30 13:08 ` Gary Thomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1091192888.10813.185.camel@hermes \
    --to=gary@mlbassoc.com \
    --cc=WPD@dtccom.com \
    --cc=ecos-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).