cmake: linker generator replace % with @ for symbol referencing

Fixes: #41435

The use of %<symbol>% works well in Linux and MacOS but when passed
to the linker script generator in Windows the %<symbol>% is processed
by the windows shell causing the value to disappear and thus an empty
value inside the generated ld linker script or scatter file.

This is fixed by using the @ character instead of the % character.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2022-01-05 11:02:37 +01:00 committed by Carles Cufí
commit a03e7df9f5
4 changed files with 10 additions and 10 deletions

View file

@ -144,9 +144,9 @@ if(NOT CONFIG_USERSPACE)
zephyr_linker_section_configure(SECTION .noinit INPUT ".kernel_noinit.*")
endif()
zephyr_linker_symbol(SYMBOL __kernel_ram_start EXPR "(%__bss_start%)")
zephyr_linker_symbol(SYMBOL __kernel_ram_start EXPR "(@__bss_start@)")
zephyr_linker_symbol(SYMBOL __kernel_ram_end EXPR "(${RAM_ADDR} + ${RAM_SIZE})")
zephyr_linker_symbol(SYMBOL __kernel_ram_size EXPR "(%__kernel_ram_end% - %__bss_start%)")
zephyr_linker_symbol(SYMBOL __kernel_ram_size EXPR "(@__kernel_ram_end@ - @__bss_start@)")
zephyr_linker_symbol(SYMBOL _image_ram_start EXPR "(${RAM_ADDR})" SUBALIGN 32) # ToDo calculate 32 correctly
zephyr_linker_symbol(SYMBOL ARM_LIB_STACKHEAP EXPR "(${RAM_ADDR} + ${RAM_SIZE})" SIZE -0x1000)