From c176c9d6ec4dae21c65af370d02ba7d9871ceaba Mon Sep 17 00:00:00 2001 From: Nikolay Agishev Date: Wed, 30 Aug 2023 17:38:30 +0300 Subject: [PATCH] scripts: build: Fix check_init_priorities for ARCMWDT compatibility ARCMWDT linker generates extended section names ( ex.: .rela.z_init_POST_KERNEL40_0_.__init_k_sys_work_q_init). Default stript is unable to parse such format. Thats why normalization for extended names was added. It cuts extra part of name. Signed-off-by: Nikolay Agishev --- scripts/build/check_init_priorities.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/build/check_init_priorities.py b/scripts/build/check_init_priorities.py index 4036d8984b5e31f..86848ac817599d6 100755 --- a/scripts/build/check_init_priorities.py +++ b/scripts/build/check_init_priorities.py @@ -160,6 +160,11 @@ def _find_defined_devices(self): if not section.name.startswith(_INIT_SECTION_PREFIX): continue + """Normalize section name""" + sect_name_num_segments = len(section.name.split(".")) + if sect_name_num_segments > 3: + section.name = section.name.rsplit(".", sect_name_num_segments - 3)[0] + prio = Priority(section.name) for rel in section.iter_relocations():