mirror of https://github.com/ARMmbed/mbed-os.git
Add uVisor-specific sections to linker script
parent
7818102156
commit
ec980179bc
|
@ -55,8 +55,41 @@ SECTIONS
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
} > FLASH_PROTECTION
|
} > 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 :
|
.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*)
|
*(.text*)
|
||||||
|
|
||||||
KEEP(*(.init))
|
KEEP(*(.init))
|
||||||
|
@ -93,10 +126,10 @@ SECTIONS
|
||||||
} > FLASH
|
} > FLASH
|
||||||
__exidx_end = .;
|
__exidx_end = .;
|
||||||
|
|
||||||
__etext = .;
|
.data :
|
||||||
|
|
||||||
.data : AT (__etext)
|
|
||||||
{
|
{
|
||||||
|
PROVIDE( __etext = LOADADDR(.data) );
|
||||||
|
|
||||||
__data_start__ = .;
|
__data_start__ = .;
|
||||||
*(vtable)
|
*(vtable)
|
||||||
*(.data*)
|
*(.data*)
|
||||||
|
@ -126,7 +159,32 @@ SECTIONS
|
||||||
/* All data end */
|
/* All data end */
|
||||||
__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 :
|
.bss :
|
||||||
{
|
{
|
||||||
|
@ -160,5 +218,13 @@ SECTIONS
|
||||||
|
|
||||||
/* Check if data + heap + stack exceeds RAM limit */
|
/* Check if data + heap + stack exceeds RAM limit */
|
||||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue