Skip to content

Commit 871124a

Browse files
taguniljhedberg
authored andcommitted
linker: arc: support MWDT-specific input section naming scheme
The MWDT linker has a specific input section sorting mechanism, designated as x$y. Some prebuilt ARC libraries actually use it, causing a lot of warnings when the linker decides where to place their symbols. Provide explicit instructions in the linker script instead of making the linker guess. Signed-off-by: Ilya Tagunov <[email protected]>
1 parent bfdab16 commit 871124a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

include/zephyr/arch/arc/v2/linker.ld

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ SECTIONS {
9595
* zephyr_linker_sources() Cmake function.
9696
*/
9797
#include <snippets-rom-start.ld>
98-
*(.text .text.*)
98+
99+
*(.text)
100+
*(.text.*)
101+
*(.text$*)
99102
*(.gnu.linkonce.t.*)
100103

101104
. = ALIGN(4);
@@ -113,7 +116,9 @@ SECTIONS {
113116
#ifdef __MWDT_LINKER_CMD__
114117
SECTION_DATA_PROLOGUE(tdata,,)
115118
{
116-
*(.tls .tls.*);
119+
*(.tls);
120+
*(.tls.*);
121+
*(.tls$*);
117122
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
118123

119124
#ifdef CONFIG_XIP
@@ -134,6 +139,7 @@ SECTIONS {
134139
SECTION_PROLOGUE(_RODATA_SECTION_NAME,,) {
135140
*(".rodata")
136141
*(".rodata.*")
142+
*(".rodata$*")
137143
*(.gnu.linkonce.r.*)
138144

139145
/* Located in generated directory. This file is populated by the
@@ -189,13 +195,16 @@ SECTIONS {
189195
__data_region_start = .;
190196
__data_start = .;
191197
__kernel_ram_start = .;
198+
192199
*(".data")
193200
*(".data.*")
201+
*(".data$*")
194202
*(".kernel.*")
195203

196204
/* This is an MWDT-specific section, created when -Hccm option is enabled */
197205
*(".rodata_in_data")
198206
*(".rodata_in_data.*")
207+
*(".rodata_in_data$*")
199208

200209
/* Located in generated directory. This file is populated by the
201210
* zephyr_linker_sources() Cmake function.
@@ -235,8 +244,10 @@ SECTIONS {
235244
*/
236245
. = ALIGN(4);
237246
__bss_start = .;
247+
238248
*(".bss")
239249
*(".bss.*")
250+
*(".bss$*")
240251
*(COMMON)
241252
*(".kernel_bss.*")
242253

@@ -295,6 +306,7 @@ SECTIONS {
295306
SECTION_PROLOGUE(.arcextmap, 0,) {
296307
*(.arcextmap)
297308
*(.arcextmap.*)
309+
*(.arcextmap$*)
298310
*(.gnu.linkonce.arcextmap.*)
299311
}
300312

0 commit comments

Comments
 (0)