Add uVisor-specific sections to linker script

Alessandro Angelino 2016-04-06 16:16:04 +01:00 committed by Milosch Meriac
parent 7818102156
commit ec980179bc
1 changed files with 70 additions and 4 deletions

View File

@ -55,8 +55,41 @@ SECTIONS
. = ALIGN(4);
} > FLASH_PROTECTION
/* Ensure that the uVisor .bss is the first section in the public SRAM. */
.uvisor.bss (NOLOAD):
{
. = ALIGN(32);
__uvisor_bss_start = .;
/* uVisor main .bss (protected) */
. = ALIGN(32);
__uvisor_bss_main_start = .;
KEEP(*(.keep.uvisor.bss.main))
. = ALIGN(32);
__uvisor_bss_main_end = .;
/* Secure boxes .bss (protected) */
. = ALIGN(32);
__uvisor_bss_boxes_start = .;
KEEP(*(.keep.uvisor.bss.boxes))
. = ALIGN(32);
__uvisor_bss_boxes_end = .;
. = ALIGN(32);
__uvisor_bss_end = .;
} > RAM
.text :
{
/* uVisor code and data */
/* Note: This is the location of the uVisor binary in flash. Make sure
* this position correspond to the FLASH_OFFSET set in the uVisor
* configuration. */
. = ALIGN(4);
__uvisor_main_start = .;
*(.uvisor.main)
__uvisor_main_end = .;
*(.text*)
KEEP(*(.init))
@ -93,10 +126,10 @@ SECTIONS
} > FLASH
__exidx_end = .;
__etext = .;
.data : AT (__etext)
.data :
{
PROVIDE( __etext = LOADADDR(.data) );
__data_start__ = .;
*(vtable)
*(.data*)
@ -126,7 +159,32 @@ SECTIONS
/* All data end */
__data_end__ = .;
} > RAM
} > RAM AT>FLASH
/* uVisor configuration data */
.uvisor.secure :
{
. = ALIGN(32);
__uvisor_secure_start = .;
/* Secure boxes configuration tables (protected) */
. = ALIGN(32);
__uvisor_cfgtbl_start = .;
KEEP(*(.keep.uvisor.cfgtbl))
. = ALIGN(32);
__uvisor_cfgtbl_end = .;
/* Pointers to the secure boxes configuration tables (protected) */
/* Note: Do not add any further alignment here, as we use this pointer
* table to enumerate boxes. */
__uvisor_cfgtbl_ptr_start = .;
KEEP(*(.keep.uvisor.cfgtbl_ptr_first))
KEEP(*(.keep.uvisor.cfgtbl_ptr))
__uvisor_cfgtbl_ptr_end = .;
. = ALIGN(32);
__uvisor_secure_end = .;
} >FLASH
.bss :
{
@ -160,5 +218,13 @@ SECTIONS
/* Check if data + heap + stack exceeds RAM limit */
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
/* Provide physical memory boundaries for uVisor. */
__uvisor_flash_start = ORIGIN(VECTORS);
__uvisor_flash_offset = ORIGIN(FLASH);
__uvisor_flash_end = ORIGIN(FLASH) + LENGTH(FLASH);
__uvisor_sram_start = ORIGIN(RAM) - 0x200;
__uvisor_sram_offset = ORIGIN(RAM);
__uvisor_sram_end = ORIGIN(RAM) + LENGTH(RAM);
}