@@ -53,6 +53,10 @@ SECTIONS
5353
5454#include < zephyr/linker/rel-sections.ld>
5555
56+ #ifdef CONFIG_LLEXT
57+ #include < zephyr/linker/llext-sections.ld>
58+ #endif
59+
5660 GROUP_START (ROMABLE_REGION)
5761 . = ROM_START; /* for kernel logging */
5862 PLACE_SYMBOL_HERE (__rodata_region_start);
@@ -65,16 +69,27 @@ SECTIONS
6569 SECTION_PROLOGUE (_TEXT_SECTION_NAME,ROM_START,)
6670 {
6771 _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>
6876 *(.text )
6977 *(.text .*)
7078 *(P)
79+ . = ALIGN (4 );
7180 etext = .;
81+ #include < zephyr/linker/kobject-text.ld>
7282 } GROUP_LINK_IN (ROMABLE_REGION)
7383
7484 _image_text_end = .;
7585
7686 #include < zephyr/linker/common-rom.ld>
7787
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+
7893 SECTION_PROLOGUE (.rvectors ,,)
7994 {
8095 _rvectors_start = .;
@@ -105,13 +120,26 @@ SECTIONS
105120 *(.got )
106121 *(.got .plt )
107122 } GROUP_LINK_IN (ROMABLE_REGION)
123+
124+ #include < zephyr/linker/thread-local-storage.ld>
125+ #include < zephyr/linker/cplusplus-rom.ld>
126+
108127 SECTION_PROLOGUE (_RODATA_SECTION_NAME,,)
109128 {
110129 *(.rodata )
111130 *(.rodata .*)
131+ *(.gnu .linkonce .r )
132+ *(.gnu .linkonce .r .*)
112133 *(C_1)
113134 *(C_2)
114135 *(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+
115143 _erodata = .;
116144 } GROUP_LINK_IN (ROMABLE_REGION)
117145 SECTION_PROLOGUE (eh_frame_hdr,,)
@@ -154,6 +182,22 @@ SECTIONS
154182
155183 _image_ram_start = .;
156184
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+
157201 #if CONFIG_SRAM_BASE_ADDRESS == 0
158202 /* RX memory starts at address 0 which can be confused with NULL. To prevent this, block
159203 * the first memory page (16 Bytes).
@@ -164,6 +208,8 @@ SECTIONS
164208 } GROUP_NOLOAD_LINK_IN (RAMABLE_REGION, RAMABLE_REGION)
165209 #endif
166210
211+ #include < zephyr/linker/common-noinit.ld>
212+
167213 SECTION_DATA_PROLOGUE (_DATA_SECTION_NAME,,)
168214 {
169215 _data = .;
@@ -180,6 +226,13 @@ SECTIONS
180226 /* the sections defined in common-ram.ld have to be initialized on
181227 * reset as well, to place them before _edata */
182228#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>
183236
184237 _edata = .;
185238
@@ -196,19 +249,19 @@ SECTIONS
196249
197250 _ebss = . ;
198251
199- #include < zephyr/linker/common-noinit.ld>
200-
201252 _image_ram_end = .;
202253 _end = .;
203254 PROVIDE (__end = _end);
204255
205- GROUP_END (RAMABLE_REGION)
206-
207256/* Located in generated directory. This file is populated by the
208- * zephyr_linker_sources() CMake function.
209- */
257+ * zephyr_linker_sources() Cmake function.
258+ */
210259#include < snippets-sections.ld>
211260
261+ #include < zephyr/linker/ram-end.ld>
262+
263+ GROUP_END (RAMABLE_REGION)
264+
212265#include < zephyr/linker/debug-sections.ld>
213266
214267}
0 commit comments