diff options
author | Claudiu Zissulescu <claziss@gmail.com> | 2023-08-29 11:52:06 +0300 |
---|---|---|
committer | Claudiu Zissulescu <claziss@gmail.com> | 2023-08-31 08:13:53 +0300 |
commit | cd60a3956da29350d2e79bd6458d5cd77a4a18d0 (patch) | |
tree | c89bedd3c352273cefd8210862ad41ffc25b8e75 /ld/scripttempl/elfarcv2.sc | |
parent | 68a2d9bf874643da970fe945a9c60c397f6882ad (diff) | |
download | gdb-cd60a3956da29350d2e79bd6458d5cd77a4a18d0.zip gdb-cd60a3956da29350d2e79bd6458d5cd77a4a18d0.tar.gz gdb-cd60a3956da29350d2e79bd6458d5cd77a4a18d0.tar.bz2 |
arc: Update elfarcv2 script template
Update ARC's elfarcv2 script template with:
- The .ivt section (Interrupt Vector Table) is mapped at the begining
of STARTUP_MEMORY when ivtbase_addr is not defined. Previously, it
was pointing to 0x00.
- MEMORY_FILE is a new emulation paramter and sets the name for the
linker script file which holds the MEMORY commands required by
arcv2elfx emulation.
- Four new linker variables are introduced available when arcv2elf emulation is used:
* __TEXT_REGION_ORIGIN__ Once defined it is setting the text region origin. By default it points to zero.
* __TEXT_REGION_LENGTH__ Once defined it is setting the text region length. By default it is set to 2M.
* __DATA_REGION_ORIGIN__ Once defined it is setting the data region origin. By default it is set to 0x80000000.
* __DATA_REGION_LENGTH__ Once defined it is setting the data region length. By default it is set to 2M.
ld/ChangeLog:
* scripttempl/elfarcv2.sc: Update script template.
Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
Diffstat (limited to 'ld/scripttempl/elfarcv2.sc')
-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__ } " ;; |