Skip to content

Commit e8a66d5

Browse files
dcpleungcfriedt
authored andcommitted
linker: add a way to add snippets to text section
This adds a way to add to the text section via zephyr_linker_sources(TEXT_SECTIONS <...>). Signed-off-by: Daniel Leung <[email protected]>
1 parent 98168eb commit e8a66d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmake/modules/extensions.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,7 @@ function(zephyr_linker_sources location)
13191319
set(rom_sections_path "${snippet_base}/snippets-rom-sections.ld")
13201320
set(ram_sections_path "${snippet_base}/snippets-ram-sections.ld")
13211321
set(data_sections_path "${snippet_base}/snippets-data-sections.ld")
1322+
set(text_sections_path "${snippet_base}/snippets-text-sections.ld")
13221323
set(rom_start_path "${snippet_base}/snippets-rom-start.ld")
13231324
set(noinit_path "${snippet_base}/snippets-noinit.ld")
13241325
set(rwdata_path "${snippet_base}/snippets-rwdata.ld")
@@ -1339,6 +1340,7 @@ function(zephyr_linker_sources location)
13391340
file(WRITE ${rom_sections_path} "")
13401341
file(WRITE ${ram_sections_path} "")
13411342
file(WRITE ${data_sections_path} "")
1343+
file(WRITE ${text_sections_path} "")
13421344
file(WRITE ${rom_start_path} "")
13431345
file(WRITE ${noinit_path} "")
13441346
file(WRITE ${rwdata_path} "")
@@ -1362,6 +1364,8 @@ function(zephyr_linker_sources location)
13621364
set(snippet_path "${ram_sections_path}")
13631365
elseif("${location}" STREQUAL "DATA_SECTIONS")
13641366
set(snippet_path "${data_sections_path}")
1367+
elseif("${location}" STREQUAL "TEXT_SECTIONS")
1368+
set(snippet_path "${text_sections_path}")
13651369
elseif("${location}" STREQUAL "ROM_START")
13661370
set(snippet_path "${rom_start_path}")
13671371
elseif("${location}" STREQUAL "NOINIT")

0 commit comments

Comments
 (0)