Skip to content

Commit 3de064a

Browse files
Examples: Correct GCC support in examples for Alif DevKit-E8 board
1 parent 6fb7d77 commit 3de064a

8 files changed

Lines changed: 202 additions & 140 deletions

File tree

Alif/DevKit-E8_ETH/Board/DevKit-E8_M55_HP/RTE/Device/AE822FA0E5597LS0_M55_HP/linker_gnu_mram.ld.src

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,12 @@ SECTIONS
6666
.startup.at_mram : ALIGN(2048)
6767
{
6868
KEEP(*(.vectors))
69-
70-
*startup*(.text* .rodata*)
71-
*system*(.text* .rodata*)
72-
*sys_*(.text* .rodata*)
73-
*pm*(.text* .rodata*)
74-
*tgu*(.text* .rodata*)
75-
*mpu*(.text* .rodata*)
76-
*sau_tcm_ns_setup*(.text* .rodata*)
77-
78-
*lv_*(.text* .rodata*)
79-
8069
. = ALIGN(16);
8170
} > MRAM
8271

8372
.copy.table : ALIGN(4)
8473
{
8574
__copy_table_start__ = .;
86-
LONG ( LOADADDR(.tdata.at_dtcm) )
87-
LONG ( ADDR(.tdata.at_dtcm) )
88-
LONG ( SIZEOF(.tdata.at_dtcm)/4 )
8975
LONG ( LOADADDR(.data.at_dtcm) )
9076
LONG ( ADDR(.data.at_dtcm) )
9177
LONG ( SIZEOF(.data.at_dtcm)/4 )
@@ -99,8 +85,6 @@ SECTIONS
9985
.zero.table : ALIGN(4)
10086
{
10187
__zero_table_start__ = .;
102-
LONG (ADDR(.tbss))
103-
LONG (SIZEOF(.tbss)/4)
10488
LONG (ADDR(.bss))
10589
LONG (SIZEOF(.bss)/4)
10690
#if __HAS_BULK_SRAM
@@ -111,15 +95,21 @@ SECTIONS
11195
. = ALIGN(16);
11296
} > MRAM
11397

114-
.code.at_itcm : ALIGN(8)
98+
/* Caution: .got, .tdata and .tbss sections come under
99+
* RELRO section. So keep it adjacent one after another.
100+
*/
101+
.got : ALIGN(8)
115102
{
116-
*(.text*)
117-
*(.itcm*) /* Object targeting ITCM */
103+
*(.got)
104+
*(.got*)
105+
*(.data.rel.ro)
106+
*(.data.rel.ro*)
107+
*(.got.plt)
118108
. = ALIGN(16);
119-
} > ITCM AT > MRAM
109+
} > MRAM
120110

121111
/* Thread Local Storage sections */
122-
.tdata.at_dtcm : ALIGN(16)
112+
.tdata.at_mram : ALIGN(16)
123113
{
124114
/* TLS base = beginning of TLS block */
125115
__tls_base = .;
@@ -129,7 +119,7 @@ SECTIONS
129119
*(.tdata .tdata.* .gnu.linkonce.td.*)
130120
__tdata_end = .;
131121
. = ALIGN(16);
132-
} > DTCM AT > MRAM
122+
} > MRAM
133123

134124
/* Thread-Local Uninitialized Data (.tbss) */
135125
.tbss (NOLOAD) : ALIGN(16)
@@ -139,14 +129,19 @@ SECTIONS
139129
*(.tcommon)
140130
__tbss_end = .;
141131
. = ALIGN(16);
142-
} > DTCM
132+
} > MRAM
133+
134+
.code.at_itcm : ALIGN(8)
135+
{
136+
// Place here any sections that must explicitly reside in ITCM
137+
. = ALIGN(16);
138+
} > ITCM AT > MRAM
143139

144140
.data.at_dtcm : ALIGN(8)
145141
{
146142
*(vtable)
147143
*(.data)
148144
*(.data*)
149-
*(.dtcm*) /* Objects targeting DTCM */
150145
*arm_common_tables*(.data* .rodata*)
151146

152147
KEEP(*(.jcr*))
@@ -179,7 +174,7 @@ SECTIONS
179174

180175
. = ALIGN(8);
181176
__bss_end__ = .;
182-
} > DTCM
177+
} > SRAM0
183178

184179
.nonsecure0_region (NOLOAD) :
185180
{
@@ -221,6 +216,8 @@ SECTIONS
221216

222217
.readonly.at_mram : ALIGN(8)
223218
{
219+
*(.text*)
220+
224221
/* Use wildcards to mop up any read-only not directed to TCM */
225222
KEEP(*(.init))
226223
KEEP(*(.fini))

Alif/DevKit-E8_ETH/Board/DevKit-E8_M55_HP/RTE/Device/AE822FA0E5597LS0_M55_HP/linker_gnu_mram.ld.src.base@2.0.4 renamed to Alif/DevKit-E8_ETH/Board/DevKit-E8_M55_HP/RTE/Device/AE822FA0E5597LS0_M55_HP/linker_gnu_mram.ld.src.base@2.1.0

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ SECTIONS
8383
.copy.table : ALIGN(4)
8484
{
8585
__copy_table_start__ = .;
86-
LONG ( LOADADDR(.tdata.at_dtcm) )
87-
LONG ( ADDR(.tdata.at_dtcm) )
88-
LONG ( SIZEOF(.tdata.at_dtcm)/4 )
8986
LONG ( LOADADDR(.data.at_dtcm) )
9087
LONG ( ADDR(.data.at_dtcm) )
9188
LONG ( SIZEOF(.data.at_dtcm)/4 )
@@ -99,8 +96,6 @@ SECTIONS
9996
.zero.table : ALIGN(4)
10097
{
10198
__zero_table_start__ = .;
102-
LONG (ADDR(.tbss))
103-
LONG (SIZEOF(.tbss)/4)
10499
LONG (ADDR(.bss))
105100
LONG (SIZEOF(.bss)/4)
106101
#if __HAS_BULK_SRAM
@@ -111,14 +106,21 @@ SECTIONS
111106
. = ALIGN(16);
112107
} > MRAM
113108

114-
.code.at_itcm : ALIGN(8)
109+
/* Caution: .got, .tdata and .tbss sections come under
110+
* RELRO section. So keep it adjacent one after another.
111+
*/
112+
.got : ALIGN(8)
115113
{
116-
*(.text*)
114+
*(.got)
115+
*(.got*)
116+
*(.data.rel.ro)
117+
*(.data.rel.ro*)
118+
*(.got.plt)
117119
. = ALIGN(16);
118-
} > ITCM AT > MRAM
120+
} > MRAM
119121

120122
/* Thread Local Storage sections */
121-
.tdata.at_dtcm : ALIGN(16)
123+
.tdata.at_mram : ALIGN(16)
122124
{
123125
/* TLS base = beginning of TLS block */
124126
__tls_base = .;
@@ -128,7 +130,7 @@ SECTIONS
128130
*(.tdata .tdata.* .gnu.linkonce.td.*)
129131
__tdata_end = .;
130132
. = ALIGN(16);
131-
} > DTCM AT > MRAM
133+
} > MRAM
132134

133135
/* Thread-Local Uninitialized Data (.tbss) */
134136
.tbss (NOLOAD) : ALIGN(16)
@@ -138,7 +140,13 @@ SECTIONS
138140
*(.tcommon)
139141
__tbss_end = .;
140142
. = ALIGN(16);
141-
} > DTCM
143+
} > MRAM
144+
145+
.code.at_itcm : ALIGN(8)
146+
{
147+
*(.text*)
148+
. = ALIGN(16);
149+
} > ITCM AT > MRAM
142150

143151
.data.at_dtcm : ALIGN(8)
144152
{

Alif/DevKit-E8_ETH/Board/DevKit-E8_M55_HP/RTE/Device/AE822FA0E5597LS0_M55_HP/linker_gnu_tcm.ld.src

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,36 +63,34 @@ SECTIONS
6363
{
6464
KEEP(*(.vectors))
6565

66-
*startup*(.text* .rodata*)
67-
*system*(.text* .rodata*)
68-
*sys_*(.text* .rodata*)
69-
*pm*(.text* .rodata*)
70-
*tgu*(.text* .rodata*)
71-
*mpu*(.text* .rodata*)
72-
*sau_tcm_ns_setup*(.text* .rodata*)
66+
*startup*(.text .rodata*)
67+
*system*(.text .rodata*)
68+
*sys_*(.text .rodata*)
69+
*pm*(.text .rodata*)
70+
*tgu*(.text .rodata*)
71+
*mpu*(.text .rodata*)
72+
*sau_tcm_ns_setup*(.text .rodata*)
7373

74-
*lv_*(.text* .rodata*)
74+
*lv_*(.text .rodata*)
7575

7676
} > ITCM
7777

7878
.copy.table : ALIGN(4)
7979
{
8080
__copy_table_start__ = .;
81-
LONG ( LOADADDR(.tdata.at_dtcm) )
82-
LONG ( ADDR(.tdata.at_dtcm) )
83-
LONG ( SIZEOF(.tdata.at_dtcm)/4 )
84-
8581
LONG ( LOADADDR(.data.at_dtcm) )
8682
LONG ( ADDR(.data.at_dtcm) )
8783
LONG ( SIZEOF(.data.at_dtcm)/4 )
84+
85+
LONG ( LOADADDR(.nonsecure0_region_load) )
86+
LONG ( ADDR(.nonsecure0_region_load) )
87+
LONG ( SIZEOF(.nonsecure0_region_load)/4 )
8888
__copy_table_end__ = .;
8989
} > ITCM
9090

9191
.zero.table : ALIGN(4)
9292
{
9393
__zero_table_start__ = .;
94-
LONG (ADDR(.tbss))
95-
LONG (SIZEOF(.tbss)/4)
9694
LONG (ADDR(.bss))
9795
LONG (SIZEOF(.bss)/4)
9896
#if __HAS_BULK_SRAM
@@ -102,14 +100,20 @@ SECTIONS
102100
__zero_table_end__ = .;
103101
} > ITCM
104102

105-
.code.at_itcm : ALIGN(8)
103+
/* Caution: .got, .tdata and .tbss sections come under
104+
* RELRO section. So keep it adjacent one after another.
105+
*/
106+
.got : ALIGN(4)
106107
{
107-
*(.text*)
108-
*(.itcm*) /* Object targeting ITCM */
108+
*(.got)
109+
*(.got*)
110+
*(.data.rel.ro)
111+
*(.data.rel.ro*)
112+
*(.got.plt)
109113
} > ITCM
110114

111115
/* Thread Local Storage (.tdata) */
112-
.tdata.at_dtcm : ALIGN(8)
116+
.tdata.at_itcm : ALIGN(8)
113117
{
114118
/* TLS base = beginning of TLS block */
115119
__tls_base = .;
@@ -118,7 +122,7 @@ SECTIONS
118122
/* Initialized TLS variables */
119123
*(.tdata .tdata.* .gnu.linkonce.td.*)
120124
__tdata_end = .;
121-
} > DTCM AT > ITCM
125+
} > ITCM
122126

123127
/* Thread-Local Uninitialized Data (.tbss) */
124128
.tbss (NOLOAD) : ALIGN(8)
@@ -127,14 +131,18 @@ SECTIONS
127131
/* TLS commons here */
128132
*(.tcommon)
129133
__tbss_end = .;
130-
} > DTCM
134+
} > ITCM
135+
136+
.code.at_itcm : ALIGN(8)
137+
{
138+
*(.text*)
139+
} > ITCM
131140

132141
.data.at_dtcm : ALIGN(8)
133142
{
134143
*(vtable)
135144
*(.data)
136145
*(.data*)
137-
*(.dtcm*) /* Objects targeting DTCM */
138146
*arm_common_tables*(.data* .rodata*)
139147

140148
KEEP(*(.jcr*))
@@ -169,10 +177,14 @@ SECTIONS
169177
__bss_end__ = .;
170178
} > DTCM
171179

172-
.nonsecure0_region (NOLOAD) :
180+
.nonsecure0_region_load :
173181
{
174182
. = ALIGN(TGU_BLOCK_SIZE);
175183
__ns_region_0_start = .;
184+
*usbd_config*(.rodata*)
185+
} > DTCM AT > ITCM
186+
.nonsecure0_region_noload (NOLOAD) :
187+
{
176188
* (eth_buf)
177189
* (usb_dma_buf)
178190
* (sd_dma_buf)

Alif/DevKit-E8_ETH/Board/DevKit-E8_M55_HP/RTE/Device/AE822FA0E5597LS0_M55_HP/linker_gnu_tcm.ld.src.base@2.0.4 renamed to Alif/DevKit-E8_ETH/Board/DevKit-E8_M55_HP/RTE/Device/AE822FA0E5597LS0_M55_HP/linker_gnu_tcm.ld.src.base@2.1.0

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,19 @@ SECTIONS
7878
.copy.table : ALIGN(4)
7979
{
8080
__copy_table_start__ = .;
81-
LONG ( LOADADDR(.tdata.at_dtcm) )
82-
LONG ( ADDR(.tdata.at_dtcm) )
83-
LONG ( SIZEOF(.tdata.at_dtcm)/4 )
84-
8581
LONG ( LOADADDR(.data.at_dtcm) )
8682
LONG ( ADDR(.data.at_dtcm) )
8783
LONG ( SIZEOF(.data.at_dtcm)/4 )
84+
85+
LONG ( LOADADDR(.nonsecure0_region_load) )
86+
LONG ( ADDR(.nonsecure0_region_load) )
87+
LONG ( SIZEOF(.nonsecure0_region_load)/4 )
8888
__copy_table_end__ = .;
8989
} > ITCM
9090

9191
.zero.table : ALIGN(4)
9292
{
9393
__zero_table_start__ = .;
94-
LONG (ADDR(.tbss))
95-
LONG (SIZEOF(.tbss)/4)
9694
LONG (ADDR(.bss))
9795
LONG (SIZEOF(.bss)/4)
9896
#if __HAS_BULK_SRAM
@@ -102,13 +100,20 @@ SECTIONS
102100
__zero_table_end__ = .;
103101
} > ITCM
104102

105-
.code.at_itcm : ALIGN(8)
103+
/* Caution: .got, .tdata and .tbss sections come under
104+
* RELRO section. So keep it adjacent one after another.
105+
*/
106+
.got : ALIGN(4)
106107
{
107-
*(.text*)
108+
*(.got)
109+
*(.got*)
110+
*(.data.rel.ro)
111+
*(.data.rel.ro*)
112+
*(.got.plt)
108113
} > ITCM
109114

110115
/* Thread Local Storage (.tdata) */
111-
.tdata.at_dtcm : ALIGN(8)
116+
.tdata.at_itcm : ALIGN(8)
112117
{
113118
/* TLS base = beginning of TLS block */
114119
__tls_base = .;
@@ -117,7 +122,7 @@ SECTIONS
117122
/* Initialized TLS variables */
118123
*(.tdata .tdata.* .gnu.linkonce.td.*)
119124
__tdata_end = .;
120-
} > DTCM AT > ITCM
125+
} > ITCM
121126

122127
/* Thread-Local Uninitialized Data (.tbss) */
123128
.tbss (NOLOAD) : ALIGN(8)
@@ -126,7 +131,12 @@ SECTIONS
126131
/* TLS commons here */
127132
*(.tcommon)
128133
__tbss_end = .;
129-
} > DTCM
134+
} > ITCM
135+
136+
.code.at_itcm : ALIGN(8)
137+
{
138+
*(.text*)
139+
} > ITCM
130140

131141
.data.at_dtcm : ALIGN(8)
132142
{
@@ -167,10 +177,14 @@ SECTIONS
167177
__bss_end__ = .;
168178
} > DTCM
169179

170-
.nonsecure0_region (NOLOAD) :
180+
.nonsecure0_region_load :
171181
{
172182
. = ALIGN(TGU_BLOCK_SIZE);
173183
__ns_region_0_start = .;
184+
*usbd_config*(.rodata*)
185+
} > DTCM AT > ITCM
186+
.nonsecure0_region_noload (NOLOAD) :
187+
{
174188
* (eth_buf)
175189
* (usb_dma_buf)
176190
* (sd_dma_buf)

0 commit comments

Comments
 (0)