Is it possible to reserve some memory in the linker script file
ex:
MEMORY
{
sram (WXAI) : org = 0x00000100, len = 256K - 0x100
flash (RX) : org = 0x01000000, len = 2M
}
In the flash I need some reserved spaces were no code my be placed by the
linker...(space is used to add some headers after compilation and linking)
Any help
Jeroen
SECTIONS
{
.reserved :
{
. += <enter amount here>;
} > flash;
/* more sections */
}
--
42Bastian
Do not email to bast...@yahoo.com, it's a spam-only account :-)
Use <same-name>@epost.de instead !
OK, your solution is a way of doing that, but what I want is that the
compiler automatically places code "around" the reserved space. I need this
for by boot code.
The boot code needs to start at address 0, then at 8K, there is a reserved
place, then further again boot code.
In advance I don't know the size of the first and second boot code...So what
I want is that the linker places code beginning at 0 until needed, but not
the second sector of 8K
Is there a way to do this?
Jeroen
>OK, your solution is a way of doing that, but what I want is that the
>compiler automatically places code "around" the reserved space. I need this
>for by boot code.
>The boot code needs to start at address 0, then at 8K, there is a reserved
>place, then further again boot code.
>In advance I don't know the size of the first and second boot code...So what
>I want is that the linker places code beginning at 0 until needed, but not
>the second sector of 8K
>
>Is there a way to do this?
Now I understand, I had the same problem with the MCF5282, the Flash
needs some 24bytes for protection and these were not the start or end
:(
But I found no solution other than splitting my code:
MEMORY {
rom1 (rx) : org=0, len = 0x400;
cfg (r) : org=0x400, len = 24;
rom (rx) : org=0x400+24, len 0x80000-0x400-24
}
And then filling rom1 as much as possible.
>>OK, your solution is a way of doing that, but what I want is that the
>>compiler automatically places code "around" the reserved space. I need this
>>for by boot code.
>>The boot code needs to start at address 0, then at 8K, there is a reserved
>>place, then further again boot code.
>>In advance I don't know the size of the first and second boot code...So what
>>I want is that the linker places code beginning at 0 until needed, but not
>>the second sector of 8K
>>
>>Is there a way to do this?
>
> Now I understand, I had the same problem with the MCF5282, the Flash
> needs some 24bytes for protection and these were not the start or end
> :(
>
> But I found no solution other than splitting my code:
>
> MEMORY {
> rom1 (rx) : org=0, len = 0x400;
> cfg (r) : org=0x400, len = 24;
> rom (rx) : org=0x400+24, len 0x80000-0x400-24
> }
>
> And then filling rom1 as much as possible.
What's about using a dummy data section (reserving the space needed
only) placed at a fixed location that won't be initialized on startup?
Ralf
I don't see how. The problem is, the GNU linker does not fill up the
section automatically (the HCS12-GNU people discussed this a lot).
Something like:
.rom1 : { *(.text) } >rom1
.rom2 : { *(.text) } >rom2
would be nice, where ld puts as much as possible into rom1 and then
steps over to rom2.
SECTION {
.test
:> ram
.bootsection PAD(0x800)
:> boot
.data
:>extram
}
NOTE: sections can not over lap.
Rick
><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
><html>
><more html kicked ...>
What the heck ...