提交 ab2a125b 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #774 from armink/fix_rti_link_for_iar

[BSP] Fix component initialization functions link order for IAR Linker
...@@ -29,6 +29,7 @@ define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; ...@@ -29,6 +29,7 @@ define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
define block RTT_INIT_FUNC with fixed order { readonly section .rti_fn* };
initialize by copy { readwrite }; initialize by copy { readwrite };
do not initialize { section .noinit }; do not initialize { section .noinit };
...@@ -38,7 +39,7 @@ keep { section .rti_fn* }; ...@@ -38,7 +39,7 @@ keep { section .rti_fn* };
place at address mem :__ICFEDIT_intvec_start__ {readonly section .intvec}; place at address mem :__ICFEDIT_intvec_start__ {readonly section .intvec};
place in ROM_region { readonly }; place in ROM_region { readonly, block RTT_INIT_FUNC };
place in RAM_region { readwrite, place in RAM_region { readwrite,
block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK, block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK,
block UND_STACK, block ABT_STACK, block HEAP }; block UND_STACK, block ABT_STACK, block HEAP };
...@@ -20,6 +20,7 @@ define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFED ...@@ -20,6 +20,7 @@ define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFED
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
define block RTT_INIT_FUNC with fixed order { readonly section .rti_fn* };
initialize by copy { readwrite }; initialize by copy { readwrite };
do not initialize { section .noinit }; do not initialize { section .noinit };
...@@ -29,5 +30,5 @@ keep { section VSymTab }; ...@@ -29,5 +30,5 @@ keep { section VSymTab };
keep { section .rti_fn* }; keep { section .rti_fn* };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly }; place in ROM_region { readonly, block RTT_INIT_FUNC };
place in RAM_region { readwrite, block CSTACK, last block HEAP }; place in RAM_region { readwrite, block CSTACK, last block HEAP };
...@@ -20,6 +20,7 @@ define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFED ...@@ -20,6 +20,7 @@ define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFED
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
define block RTT_INIT_FUNC with fixed order { readonly section .rti_fn* };
initialize by copy { readwrite }; initialize by copy { readwrite };
do not initialize { section .noinit }; do not initialize { section .noinit };
...@@ -29,5 +30,5 @@ keep { section VSymTab }; ...@@ -29,5 +30,5 @@ keep { section VSymTab };
keep { section .rti_fn* }; keep { section .rti_fn* };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly }; place in ROM_region { readonly, block RTT_INIT_FUNC };
place in RAM_region { readwrite, block CSTACK, last block HEAP}; place in RAM_region { readwrite, block CSTACK, last block HEAP};
...@@ -20,6 +20,7 @@ define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFED ...@@ -20,6 +20,7 @@ define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFED
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
define block RTT_INIT_FUNC with fixed order { readonly section .rti_fn* };
initialize by copy { readwrite }; initialize by copy { readwrite };
//initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
...@@ -29,6 +30,6 @@ keep { section FSymTab }; ...@@ -29,6 +30,6 @@ keep { section FSymTab };
keep { section VSymTab }; keep { section VSymTab };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly }; place in ROM_region { readonly, block RTT_INIT_FUNC };
place in RAM_region { readwrite, place in RAM_region { readwrite,
block CSTACK, block HEAP }; block CSTACK, block HEAP };
\ No newline at end of file
...@@ -23,6 +23,7 @@ define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFED ...@@ -23,6 +23,7 @@ define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFED
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
define block RTT_INIT_FUNC with fixed order { readonly section .rti_fn* };
initialize by copy { readwrite }; initialize by copy { readwrite };
do not initialize { section .noinit }; do not initialize { section .noinit };
...@@ -32,5 +33,5 @@ keep { section VSymTab }; ...@@ -32,5 +33,5 @@ keep { section VSymTab };
keep { section .rti_fn* }; keep { section .rti_fn* };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly }; place in ROM_region { readonly, block RTT_INIT_FUNC };
place in RAM_region { readwrite, block CSTACK, last block HEAP}; place in RAM_region { readwrite, block CSTACK, last block HEAP};
...@@ -20,13 +20,14 @@ define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __IC ...@@ -20,13 +20,14 @@ define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __IC
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
define block RTT_INIT_FUNC with fixed order { readonly section .rti_fn* };
initialize by copy { readwrite }; initialize by copy { readwrite };
do not initialize { section .noinit }; do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly }; place in ROM_region { readonly, block RTT_INIT_FUNC };
place in RAM_region { readwrite, block CSTACK, block HEAP }; place in RAM_region { readwrite, block CSTACK, block HEAP };
keep { section FSymTab }; keep { section FSymTab };
keep { section VSymTab }; keep { section VSymTab };
......
...@@ -20,13 +20,14 @@ define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __IC ...@@ -20,13 +20,14 @@ define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __IC
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
define block RTT_INIT_FUNC with fixed order { readonly section .rti_fn* };
initialize by copy { readwrite }; initialize by copy { readwrite };
do not initialize { section .noinit }; do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly }; place in ROM_region { readonly, block RTT_INIT_FUNC };
place in RAM_region { readwrite, block CSTACK, block HEAP }; place in RAM_region { readwrite, block CSTACK, block HEAP };
keep { section FSymTab }; keep { section FSymTab };
keep { section VSymTab }; keep { section VSymTab };
......
...@@ -44,11 +44,16 @@ define region SRAM = mem:[from 0x20000000 to 0x2003ffff]; ...@@ -44,11 +44,16 @@ define region SRAM = mem:[from 0x20000000 to 0x2003ffff];
// //
define block HEAP with alignment = 8, size = 0x00000000 { }; define block HEAP with alignment = 8, size = 0x00000000 { };
//
// Define a block for RT-Thread components initialization
//
define block RTT_INIT_FUNC with fixed order { readonly section .rti_fn* };
// //
// Indicate that the read/write values should be initialized by copying from // Indicate that the read/write values should be initialized by copying from
// flash. // flash.
// //
initialize by copy { readwrite }; initialize by copy { readwrite , RTT_INIT_FUNC };
// //
// Indicate that the noinit values should be left alone. This includes the // Indicate that the noinit values should be left alone. This includes the
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册