fixed a typo in linker script

avoid copy of BaS if linked to RAM
This commit is contained in:
Markus Fröschle
2013-08-06 10:39:46 +00:00
parent 34d5c358cd
commit feeabc3eb7
4 changed files with 74 additions and 26 deletions

View File

@@ -1,7 +1,10 @@
MEMORY
{
bas_rom (RX) : ORIGIN = TARGET_ADDRESS, LENGTH = 0x00100000
bas_ram (WX) : ORIGIN = 0x1FE00000, LENGTH = 0x00100000 /* target to copy BaS to */
/*
* target to copy BaS data segment to. 16k should be enough for now
*/
bas_ram (WX) : ORIGIN = 0x1FFC000, LENGTH = 0x004000
}
SECTIONS
@@ -37,23 +40,13 @@ SECTIONS
mcdapi/MCD_tasks.o(.text)
mcdapi/MCD_tasksInit.o(.text)
objs/xhdi_sd.o(.text)
objs/xhdi_interface.o(text)
objs/xhdi_vec.o(text)
#if (FORMAT == elf32-m68k)
*(.rodata)
*(.rodata.*)
#endif
} > bas_rom
/* BaS in RAM */
.bas :
/* The BaS is stored in the flash, just after the init part.
* Then it will be copied to its final location in the RAM.
* This data must be aligned for optimal copy loop speed.
objs/xhdi_interface.o(.text)
objs/xhdi_vec.o(.text)
/*
* if we compile to RAM anyway, there is no need to copy anything
*/
AT (ALIGN(ADDR(.text) + SIZEOF(.text), 4))
{
. = ALIGN(16);
#if (TARGET_ADDRESS < 0x1FFFFFFF && TARGET_ADDRESS > 0)
. = ALIGN(16);
__BAS_DATA_START = .;
*(.data)
@@ -64,7 +57,36 @@ SECTIONS
* is a multiple of the following value.
*/
. = ALIGN(16);
} > bas_ram
#endif /* TARGET_ADDRESS */
#if (FORMAT == elf32-m68k)
*(.rodata)
*(.rodata.*)
#endif
} > bas_rom
#if (TARGET_ADDRESS == 0xe0000000)
/* BaS in RAM */
.bas :
/*
* The BaS is stored in the flash, just after the init part.
* Then it will be copied to its final location in the RAM.
* This data must be aligned for optimal copy loop speed.
*/
AT (ALIGN(ADDR(.text) + SIZEOF(.text), 4))
{
. = ALIGN(16);
. = ALIGN(16);
__BAS_DATA_START = .;
*(.data)
__BAS_DATA_END = .;
*(.bss)
/* The BaS copy routine assumes that tha BaS size
* is a multiple of the following value.
*/
. = ALIGN(16);
} > bas_ram
#endif
/*
* Global memory map
@@ -84,16 +106,29 @@ SECTIONS
/* FastRAM */
__FASTRAM = 0x10000000;
__TARGET_ADDRESS = TARGET_ADDRESS;
#if TARGET_ADDRESS == 0xe0000000
__FASTRAM_END = __BAS_IN_RAM;
#else
__FASTRAM_END = TARGET_ADDRESS;
#endif
/* Init CS0 (BootFLASH @ E000_0000 - E07F_FFFF 8Mbytes) */
___BOOT_FLASH = 0xe0000000;
___BOOT_FLASH_SIZE = 0x00800000;
#if TARGET_ADDRESS == 0xe0000000
/* BaS */
__BAS_LMA = LOADADDR(.bas);
__BAS_IN_RAM = ADDR(.bas);
__BAS_SIZE = SIZEOF(.bas);
#else
/* BaS is already in RAM - no need to copy anything */
__BAS_IN_RAM = __FASTRAM_END;
__BAS_SIZE = 0;
__BAS_LMA = 0;
#endif
/* Other flash components */
__FIRETOS = 0xe0400000;