init: tweak Zephyr .init* section name conflicting with toolchain

In case of ARC MWDT toolchain and C++ support enabled the Zephyr .init*
section conflicts with .init* sections derived from toolchain libs.

Let's add 'z_' prefix to Zephyr .init* section (and therefore .device
section as they share the same macros) to make Zephyr section name
unique.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
This commit is contained in:
Evgeniy Paltsev 2021-04-23 15:55:53 +03:00 committed by Anas Nashif
commit 2b76f0fee2
4 changed files with 6 additions and 6 deletions

View file

@ -30,10 +30,10 @@
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#endif
/* verify we don't have rogue .init_<something> initlevel sections */
/* verify we don't have rogue .z_init_<something> initlevel sections */
SECTION_PROLOGUE(initlevel_error,,)
{
KEEP(*(SORT(.init_[_A-Z0-9]*)))
KEEP(*(SORT(.z_init_[_A-Z0-9]*)))
}
ASSERT(SIZEOF(initlevel_error) == 0, "Undefined initialization levels used.")

View file

@ -116,8 +116,8 @@
*/
#define CREATE_OBJ_LEVEL(object, level) \
__##object##_##level##_start = .; \
KEEP(*(SORT(.object##_##level[0-9]_*))); \
KEEP(*(SORT(.object##_##level[1-9][0-9]_*)));
KEEP(*(SORT(.z_##object##_##level[0-9]_*))); \
KEEP(*(SORT(.z_##object##_##level[1-9][0-9]_*)));
/*
* link in shell initialization objects for all modules that use shell and