Skip to content

Commit ac25636

Browse files
committed
linker: Add an extra number to check for sorting levels sections
Now that priorities are automatically computed, and mostly coming from DTS, it can easily go beyond 99. Actually, this arbitrary limit of 99 in level sections has no real meaning anymore (if it ever had any). Signed-off-by: Tomasz Bursztyka <[email protected]>
1 parent 040da09 commit ac25636

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

cmake/modules/extensions.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5172,8 +5172,8 @@ endfunction()
51725172
# This is useful content such as struct devices.
51735173
#
51745174
# For example: zephyr_linker_section_obj_level(SECTION init LEVEL PRE_KERNEL_1)
5175-
# will create an input section matching `.z_init_PRE_KERNEL_1?_` and
5176-
# `.z_init_PRE_KERNEL_1??_`.
5175+
# will create an input section matching `.z_init_PRE_KERNEL_1?_`,
5176+
# `.z_init_PRE_KERNEL_1??_` and `.z_init_PRE_KERNEL_1???_`
51775177
#
51785178
# SECTION <section>: Section in which the objects shall be placed
51795179
# LEVEL <level> : Priority level, all input sections matching the level
@@ -5206,6 +5206,11 @@ function(zephyr_linker_section_obj_level)
52065206
INPUT ".z_${OBJ_SECTION}_${OBJ_LEVEL}??_*"
52075207
KEEP SORT NAME
52085208
)
5209+
zephyr_linker_section_configure(
5210+
SECTION ${OBJ_SECTION}
5211+
INPUT ".z_${OBJ_SECTION}_${OBJ_LEVEL}???_*"
5212+
KEEP SORT NAME
5213+
)
52095214
endfunction()
52105215

52115216
# Usage:

include/zephyr/linker/iterable_sections.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
_CONCAT(_##struct_type, _list_start) = .; \
2222
KEEP(*(SORT(._##struct_type.static.*_?_*))); \
2323
KEEP(*(SORT(._##struct_type.static.*_??_*))); \
24+
KEEP(*(SORT(._##struct_type.static.*_???_*))); \
2425
_CONCAT(_##struct_type, _list_end) = .
2526

2627
#define Z_LINK_ITERABLE_ALIGNED(struct_type, align) \

include/zephyr/linker/linker-defs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
#define CREATE_OBJ_LEVEL(object, level) \
4848
__##object##_##level##_start = .; \
4949
KEEP(*(SORT(.z_##object##_##level?_*))); \
50-
KEEP(*(SORT(.z_##object##_##level??_*)));
50+
KEEP(*(SORT(.z_##object##_##level??_*))); \
51+
KEEP(*(SORT(.z_##object##_##level???_*)));
5152

5253
/*
5354
* link in shell initialization objects for all modules that use shell and

0 commit comments

Comments
 (0)