[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Determine a segment length I the makefile
From: |
Erik Christiansen |
Subject: |
Re: [avr-gcc-list] Determine a segment length I the makefile |
Date: |
Thu, 29 Mar 2007 13:23:02 +1000 |
User-agent: |
Mutt/1.5.9i |
On Tue, Mar 27, 2007 at 04:01:37PM +0200, Schwichtenberg, Knut wrote:
> I know I could set the length of a segment in the linker script. Is
> there a chance to set it in the makefile? While the linker scripts for
> the avr5 are able to handle the M128-memory my M32 run out of memory
> without any comment - especially if I add an additional bootloader.
Variables were not welcome in MEMORY{}, last time I tried.
The simplest solution that immediately comes to mind has the advantage
of keeping linking data in linker scripts rather than makefiles,
headers, etc.
In the linker script, just replace:
MEMORY
{ ...
}
with:
INCLUDE memory.tmp
For that file to end up containing the excised memory segment text,
your makefile only needs to overwrite it with either your customised
memory_128.ld or memory_32.ld, prior to linking, depending on the make
target.
(Obviously we're doing this in a copy of one of the default linker
scripts, or our own custom script. ;)
I'm guessing you've already rejected just using "-T script_xxx", with
only the memory segments customised for each target. That could lead to
maintenance confusion, so is uglier.
Erik