This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: How to create object from binary?
- To: Michael Schwingen <rincewind at discworld dot dascon dot de>
- Subject: Re: How to create object from binary?
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- Date: 29 May 2001 09:45:58 +0100
- Cc: binutils at sources dot redhat dot com
- References: <20010528225810.A9638@a-tuin.dascon.de>
Hi Michael,
> However, this places the image data in the .data section, which I
> can not change - this leads to problems because I can't put it in
> the memory section where it needs to be (in flash, not in RAM like
> the .data sections from my code).
>
> Is there an easy solution which I overlooked?
Yes - you can use a linker script to change the section. For example
with a script like this:
SECTIONS
{
.flash :
{
*(.data)
}
}
You can do "ld -T conv.t image image.flash" to move all of the
contents of the .data section in the "image" file into a section
called ".flash" in "image.flash".
Cheers
Nick