Skip to content

Commit 0f46359

Browse files
dewitt-garminnashif
authored andcommitted
linker: Add underscore between the init level and priority
Ensure the priority is surrounded by underscores for clarity. This makes sections show up as z_init_PRE_KERNEL_1_0_0_ instead of z_init_PRE_KERNEL_10_0_ Signed-off-by: Josh DeWitt <[email protected]>
1 parent a87f6fe commit 0f46359

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

cmake/linker/iar/config_file_script.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ function(section_to_string)
649649
set(TEMP "${TEMP} { section ${first_index_section_name} },\n")
650650
endif()
651651

652-
# block init_100 with alphabetical order { section .z_init_EARLY?_}
652+
# block init_100 with alphabetical order { section .z_init_EARLY_?_}
653653
set(TEMP "${TEMP}\n block ${name_clean}_${idx}")
654654
if(DEFINED offset AND NOT offset EQUAL 0 )
655655
list(APPEND block_attr "size = ${offset}")

cmake/modules/extensions.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5240,8 +5240,8 @@ endfunction()
52405240
# This is useful content such as struct devices.
52415241
#
52425242
# For example: zephyr_linker_section_obj_level(SECTION init LEVEL PRE_KERNEL_1)
5243-
# will create an input section matching `.z_init_PRE_KERNEL_1?_` and
5244-
# `.z_init_PRE_KERNEL_1??_`.
5243+
# will create an input section matching `.z_init_PRE_KERNEL_1_?_` and
5244+
# `.z_init_PRE_KERNEL_1_??_`.
52455245
#
52465246
# SECTION <section>: Section in which the objects shall be placed
52475247
# LEVEL <level> : Priority level, all input sections matching the level
@@ -5265,13 +5265,13 @@ function(zephyr_linker_section_obj_level)
52655265

52665266
zephyr_linker_section_configure(
52675267
SECTION ${OBJ_SECTION}
5268-
INPUT ".z_${OBJ_SECTION}_${OBJ_LEVEL}?_*"
5268+
INPUT ".z_${OBJ_SECTION}_${OBJ_LEVEL}_?_*"
52695269
SYMBOLS __${OBJ_SECTION}_${OBJ_LEVEL}_start
52705270
KEEP SORT NAME
52715271
)
52725272
zephyr_linker_section_configure(
52735273
SECTION ${OBJ_SECTION}
5274-
INPUT ".z_${OBJ_SECTION}_${OBJ_LEVEL}??_*"
5274+
INPUT ".z_${OBJ_SECTION}_${OBJ_LEVEL}_??_*"
52755275
KEEP SORT NAME
52765276
)
52775277
endfunction()

include/zephyr/init.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ struct init_entry {
108108
* linker scripts to sort them according to the specified
109109
* level/priority/sub-priority.
110110
*/
111-
#define Z_INIT_ENTRY_SECTION(level, prio, sub_prio) \
112-
__attribute__((__section__( \
113-
".z_init_" #level STRINGIFY(prio)"_" STRINGIFY(sub_prio)"_")))
111+
#define Z_INIT_ENTRY_SECTION(level, prio, sub_prio) \
112+
__attribute__(( \
113+
__section__(".z_init_" #level "_" STRINGIFY(prio)"_" STRINGIFY(sub_prio)"_")))
114114

115115
/** @endcond */
116116

include/zephyr/linker/linker-defs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
/* clang-format off */
4848
#define CREATE_OBJ_LEVEL(object, level) \
4949
__##object##_##level##_start = .; \
50-
KEEP(*(SORT(.z_##object##_##level?_*))); \
51-
KEEP(*(SORT(.z_##object##_##level??_*)));
50+
KEEP(*(SORT(.z_##object##_##level##_?_*))); \
51+
KEEP(*(SORT(.z_##object##_##level##_??_*)));
5252
/* clang-format on */
5353

5454
/*

0 commit comments

Comments
 (0)