This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: Linker options for dividing flash
- From: "Kishore, Jonnalagadda \(IE10\)" <Kishore dot Jonnalagadda at honeywell dot com>
- To: <binutils at sourceware dot org>
- Date: Wed, 4 Apr 2007 23:26:58 +0530
- Subject: RE: Linker options for dividing flash
> -----Original Message-----
> From: DJ Delorie [mailto:dj@redhat.com]
> Sent: Tuesday, April 03, 2007 11:17 PM
> To: Kishore, Jonnalagadda (IE10)
> Cc: binutils@sourceware.org
> Subject: Re: Linker options for dividing flash
>
>
> > Is this what you refer to? Ie. I set RAMSTART, RAMSIZE
> > etc. individually for each of the three sections? I've never tried
> > this, so can I invoke the linker command with something like:
> >
> > <target>-ld -DRAMSTART=0x400 ...
>
> If you look in the Makefile, you'll see I use a sed script
> to change those text markers to real numbers in separate files.
> I.e.:
>
> sed s/ROMSTART/0xf000/g < template.ld > block1.ld
> sed s/ROMSTART/0xe000/g < template.ld > block2.ld
> sed s/ROMSTART/0xc000/g < template.ld > block3.ld
>
> > And RAMSTART gets substituted in the linker script?
>
> The script I use replaces many variables, that's one of them. It's
> done at libgloss build time, not by the linker.
Thanks. One of the problems I have is that the source tree I work with
builds for several boards and architectures (and compilers) and I want
to avoid maintaining several linker scripts. I am now considering making
two linker scripts; one each for RAM load and FLASH load. These remain
common to all boards and platforms. Then for each platform I will only
provide the respective memory map files for RAM and FLASH which should
be used by the main linker script.
Is this possible? I can manage platform specific include paths with the
makefiles.
Warm regards,
Kishore