diff options
-rw-r--r-- | ld/scripttempl/elfarcv2.sc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ld/scripttempl/elfarcv2.sc b/ld/scripttempl/elfarcv2.sc index f1b8a69..3054e4c 100644 --- a/ld/scripttempl/elfarcv2.sc +++ b/ld/scripttempl/elfarcv2.sc @@ -58,7 +58,7 @@ IVT=" /* If the 'ivtbase_addr' symbol is defined, it indicates the base address of the interrupt vectors. See description of INT_VECTOR_BASE register. */ - .ivt DEFINED (ivtbase_addr) ? ivtbase_addr : 0x00 : + .ivt DEFINED (ivtbase_addr) ? ivtbase_addr : ORIGIN(${STARTUP_MEMORY}) : { ${RELOCATING+ PROVIDE (__ivtbase_addr = .); } KEEP (*(.ivt)); @@ -104,21 +104,25 @@ fi # case $GENERIC_BOARD in yes|1|YES) + test -z "$MEMORY_FILE" && MEMORY_FILE="memory.x" MEMORY_DEF=" /* Get memory banks definition from some user configuration file. This file must be located in some linker directory (search path with -L<dir>). See fixed memory banks emulation script. */ -INCLUDE memory.x; +INCLUDE ${MEMORY_FILE}; " ;; *) -MEMORY_DEF=" -/* Fixed definition of the available memory banks. - See generic emulation script for a user defined configuration. */ + MEMORY_DEF=" +__TEXT_REGION_ORIGIN__ = DEFINED(__TEXT_REGION_ORIGIN__) ? __TEXT_REGION_ORIGIN__ : 0x00; +__TEXT_REGION_LENGTH__ = DEFINED(__TEXT_REGION_LENGTH__) ? __TEXT_REGION_LENGTH__ : ${ICCM_SIZE}; +__DATA_REGION_ORIGIN__ = DEFINED(__DATA_REGION_ORIGIN__) ? __DATA_REGION_ORIGIN__ : ${RAM_START_ADDR}; +__DATA_REGION_LENGTH__ = DEFINED(__DATA_REGION_LENGTH__) ? __DATA_REGION_LENGTH__ : ${RAM_SIZE}; + MEMORY { - ICCM : ORIGIN = 0x00000000, LENGTH = ${ICCM_SIZE} - DCCM : ORIGIN = ${RAM_START_ADDR}, LENGTH = ${RAM_SIZE} + ICCM : ORIGIN = __TEXT_REGION_ORIGIN__, LENGTH = __TEXT_REGION_LENGTH__ + DCCM : ORIGIN = __DATA_REGION_ORIGIN__, LENGTH = __DATA_REGION_LENGTH__ } " ;; |