@@ -53,6 +53,10 @@ SECTIONS
53
53
54
54
#include <zephyr/linker/rel-sections.ld>
55
55
56
+ #ifdef CONFIG_LLEXT
57
+ #include <zephyr/linker/llext-sections.ld>
58
+ #endif
59
+
56
60
GROUP_START(ROMABLE_REGION)
57
61
. = ROM_START; /* for kernel logging */
58
62
PLACE_SYMBOL_HERE(__rodata_region_start);
@@ -65,16 +69,27 @@ SECTIONS
65
69
SECTION_PROLOGUE(_TEXT_SECTION_NAME,ROM_START,)
66
70
{
67
71
_image_text_start = .;
72
+ /* Located in generated directory. This file is populated by the
73
+ * zephyr_linker_sources() Cmake function.
74
+ */
75
+ #include <snippets-rom-start.ld>
68
76
*(.text)
69
77
*(.text.*)
70
78
*(P)
79
+ . = ALIGN (4);
71
80
etext = .;
81
+ #include <zephyr/linker/kobject-text.ld>
72
82
} GROUP_LINK_IN(ROMABLE_REGION)
73
83
74
84
_image_text_end = .;
75
85
76
86
#include <zephyr/linker/common-rom.ld>
77
87
88
+ /* Located in generated directory. This file is populated by calling
89
+ * zephyr_linker_sources(ROM_SECTIONS ...). Useful for grouping iterable RO structs.
90
+ */
91
+ #include <snippets-rom-sections.ld>
92
+
78
93
SECTION_PROLOGUE(.rvectors,,)
79
94
{
80
95
_rvectors_start = .;
@@ -105,13 +120,26 @@ SECTIONS
105
120
*(.got)
106
121
*(.got.plt)
107
122
} GROUP_LINK_IN(ROMABLE_REGION)
123
+
124
+ #include <zephyr/linker/thread-local-storage.ld>
125
+ #include <zephyr/linker/cplusplus-rom.ld>
126
+
108
127
SECTION_PROLOGUE(_RODATA_SECTION_NAME,,)
109
128
{
110
129
*(.rodata)
111
130
*(.rodata.*)
131
+ *(.gnu.linkonce.r)
132
+ *(.gnu.linkonce.r.*)
112
133
*(C_1)
113
134
*(C_2)
114
135
*(C)
136
+
137
+ /* Located in generated directory. This file is populated by the
138
+ * zephyr_linker_sources() Cmake function.
139
+ */
140
+ #include <snippets-rodata.ld>
141
+ #include <zephyr/linker/kobject-rom.ld>
142
+
115
143
_erodata = .;
116
144
} GROUP_LINK_IN(ROMABLE_REGION)
117
145
SECTION_PROLOGUE(eh_frame_hdr,,)
@@ -154,6 +182,22 @@ SECTIONS
154
182
155
183
_image_ram_start = .;
156
184
185
+ #include <app_data_alignment.ld>
186
+
187
+ /* Located in generated directory. This file is populated by the
188
+ * zephyr_linker_sources() Cmake function.
189
+ */
190
+ #include <snippets-ram-sections.ld>
191
+
192
+ #if defined(CONFIG_USERSPACE)
193
+ #define APP_SHARED_ALIGN MPU_MIN_SIZE_ALIGN
194
+ #define SMEM_PARTITION_ALIGN MPU_ALIGN
195
+
196
+ #include <app_smem.ld>
197
+ _app_smem_size = _app_smem_end - _app_smem_start;
198
+ _app_smem_rom_start = LOADADDR (_APP_SMEM_SECTION_NAME);
199
+ #endif /* CONFIG_USERSPACE */
200
+
157
201
#if CONFIG_SRAM_BASE_ADDRESS == 0
158
202
/* RX memory starts at address 0 which can be confused with NULL. To prevent this, block
159
203
* the first memory page (16 Bytes).
@@ -164,6 +208,8 @@ SECTIONS
164
208
} GROUP_NOLOAD_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
165
209
#endif
166
210
211
+ #include <zephyr/linker/common-noinit.ld>
212
+
167
213
SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,)
168
214
{
169
215
_data = .;
@@ -180,6 +226,13 @@ SECTIONS
180
226
/* the sections defined in common-ram.ld have to be initialized on
181
227
* reset as well, to place them before _edata */
182
228
#include <zephyr/linker/common-ram.ld>
229
+ #include <zephyr/linker/kobject-data.ld>
230
+ #include <zephyr/linker/cplusplus-ram.ld>
231
+
232
+ /* Located in generated directory. This file is populated by the
233
+ * zephyr_linker_sources() Cmake function.
234
+ */
235
+ #include <snippets-data-sections.ld>
183
236
184
237
_edata = .;
185
238
@@ -196,19 +249,19 @@ SECTIONS
196
249
197
250
_ebss = . ;
198
251
199
- #include <zephyr/linker/common-noinit.ld>
200
-
201
252
_image_ram_end = .;
202
253
_end = .;
203
254
PROVIDE (__end = _end);
204
255
205
- GROUP_END(RAMABLE_REGION)
206
-
207
256
/* Located in generated directory. This file is populated by the
208
- * zephyr_linker_sources() CMake function.
209
- */
257
+ * zephyr_linker_sources() Cmake function.
258
+ */
210
259
#include <snippets-sections.ld>
211
260
261
+ #include <zephyr/linker/ram-end.ld>
262
+
263
+ GROUP_END(RAMABLE_REGION)
264
+
212
265
#include <zephyr/linker/debug-sections.ld>
213
266
214
267
}
0 commit comments