All in all this makes cmake linker generator able to work for at least
most of the kernel tests and samples, on cortex m4.
Make the cmake linker generator have a file-structure more similar to
the ld-skeletons.
Add or edit groups, sections and logic to make the generator reflect
what the ld-skeletons do, esp. for kobjects and APP_SMEM, nonint and
some other details are also effected.
Use the new zephyr_linker_include_generated() and
zephyr_linker_include_var() functions to to handle
${DEVICE_API_LINKER_SECTIONS_CMAKE}, the kobject-prebuilt-*.h files and
APP_SMEM partition. Essentially the output from gen_app_partitions.py,
gen_kobject_placeholders.py.
Add ALIGN_WITH_INPUT on sections being put into DATA_REGION. This makes
the init layout work for ld.
This leverages the updates in gen_app_partitions.py to generate its
output as cmake linker generator sections too, and puts them into a
group defined in linker.cmake
Setup generator variables for alignment of APP_SMEM. Note that this does
not yet handle MPU_ALIGN which depends on the size of the section...
Fix broken k_object_assignment iterable section
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
45 lines
1.7 KiB
CMake
45 lines
1.7 KiB
CMake
# The contents of this file is based on include/zephyr/linker/thread-local-storage.ld
|
|
# Please keep in sync
|
|
|
|
if(CONFIG_THREAD_LOCAL_STORAGE)
|
|
zephyr_linker_section(NAME .tdata LMA FLASH NOINPUT)
|
|
zephyr_linker_section_configure(SECTION .tdata INPUT ".tdata")
|
|
zephyr_linker_section_configure(SECTION .tdata INPUT ".tdata.*")
|
|
zephyr_linker_section_configure(SECTION .tdata INPUT ".gnu.linkonce.td.*")
|
|
# GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
|
|
|
zephyr_linker_section(NAME .tbss LMA FLASH NOINPUT)
|
|
zephyr_linker_section_configure(SECTION .tbss INPUT ".tbss")
|
|
zephyr_linker_section_configure(SECTION .tbss INPUT ".tbss.*")
|
|
zephyr_linker_section_configure(SECTION .tbss INPUT ".gnu.linkonce.tb.*")
|
|
zephyr_linker_section_configure(SECTION .tbss INPUT ".tcommon")
|
|
# GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
|
|
|
#
|
|
# These needs to be outside of the tdata/tbss
|
|
# sections or else they would be considered
|
|
# thread-local variables, and the code would use
|
|
# the wrong values.
|
|
#
|
|
# This scheme is not yet handled
|
|
if(CONFIG_XIP)
|
|
# /* The "master copy" of tdata should be only in flash on XIP systems */
|
|
# PROVIDE(__tdata_start = LOADADDR(tdata));
|
|
else()
|
|
# PROVIDE(__tdata_start = ADDR(tdata));
|
|
endif()
|
|
# PROVIDE(__tdata_size = SIZEOF(tdata));
|
|
# PROVIDE(__tdata_end = __tdata_start + __tdata_size);
|
|
# PROVIDE(__tdata_align = ALIGNOF(tdata));
|
|
#
|
|
# PROVIDE(__tbss_start = ADDR(tbss));
|
|
# PROVIDE(__tbss_size = SIZEOF(tbss));
|
|
# PROVIDE(__tbss_end = __tbss_start + __tbss_size);
|
|
# PROVIDE(__tbss_align = ALIGNOF(tbss));
|
|
#
|
|
# PROVIDE(__tls_start = __tdata_start);
|
|
# PROVIDE(__tls_end = __tbss_end);
|
|
# PROVIDE(__tls_size = __tbss_end - __tdata_start);
|
|
|
|
endif()
|