linker: tweak section naming to feet all linkers
MWDT toolchain adds additional suffix to sections name in case of ffunction-sections / fdata-sections are enabled. As proposed by Andy Ross let's pick a single set of rules and syntax that work. Suggested-by: Andy Ross <andy@plausible.org> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
This commit is contained in:
parent
6b8f92be08
commit
0a7b65ef5e
6 changed files with 14 additions and 14 deletions
|
@ -14,7 +14,7 @@ SECTION_PROLOGUE(_NOINIT_SECTION_NAME,(NOLOAD),)
|
|||
*(".noinit.*")
|
||||
#ifdef CONFIG_USERSPACE
|
||||
z_user_stacks_start = .;
|
||||
*(.user_stacks)
|
||||
*(.user_stacks*)
|
||||
z_user_stacks_end = .;
|
||||
#endif /* CONFIG_USERSPACE */
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
SECTION_PROLOGUE(app_shmem_regions,,)
|
||||
{
|
||||
__app_shmem_regions_start = .;
|
||||
KEEP(*(SORT(".app_regions.*")));
|
||||
KEEP(*(SORT(.app_regions.*)));
|
||||
__app_shmem_regions_end = .;
|
||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||
|
||||
|
|
|
@ -34,13 +34,13 @@
|
|||
#ifndef LINKER_PASS2
|
||||
SECTION_PROLOGUE(.intList,,)
|
||||
{
|
||||
KEEP(*(.irq_info))
|
||||
KEEP(*(.intList))
|
||||
KEEP(*(.irq_info*))
|
||||
KEEP(*(.intList*))
|
||||
} GROUP_LINK_IN(IDT_LIST)
|
||||
#else
|
||||
/DISCARD/ :
|
||||
{
|
||||
KEEP(*(.irq_info))
|
||||
KEEP(*(.intList))
|
||||
KEEP(*(.irq_info*))
|
||||
KEEP(*(.intList*))
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#ifdef _LINKER
|
||||
#define Z_LINK_ITERABLE(struct_type) \
|
||||
_CONCAT(_##struct_type, _list_start) = .; \
|
||||
KEEP(*(SORT_BY_NAME(._##struct_type##.static.*))); \
|
||||
KEEP(*(SORT_BY_NAME(._##struct_type.static.*))); \
|
||||
_CONCAT(_##struct_type, _list_end) = .
|
||||
|
||||
/* Define an output section which will set up an iterable area
|
||||
|
@ -74,8 +74,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(.object##_##level[0-9]*))); \
|
||||
KEEP(*(SORT(.object##_##level[1-9][0-9]*)));
|
||||
|
||||
/*
|
||||
* link in shell initialization objects for all modules that use shell and
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
#define _UNDEFINED_SECTION_NAME undefined
|
||||
|
||||
/* Interrupts */
|
||||
#define _IRQ_VECTOR_TABLE_SECTION_NAME .gnu.linkonce.irq_vector_table
|
||||
#define _SW_ISR_TABLE_SECTION_NAME .gnu.linkonce.sw_isr_table
|
||||
#define _IRQ_VECTOR_TABLE_SECTION_NAME .gnu.linkonce.irq_vector_table*
|
||||
#define _SW_ISR_TABLE_SECTION_NAME .gnu.linkonce.sw_isr_table*
|
||||
|
||||
/* Architecture-specific sections */
|
||||
#if defined(CONFIG_ARM)
|
||||
|
|
|
@ -52,7 +52,7 @@ data_template = """
|
|||
/* Auto generated code do not modify */
|
||||
SMEM_PARTITION_ALIGN(z_data_smem_{0}_bss_end - z_data_smem_{0}_part_start);
|
||||
z_data_smem_{0}_part_start = .;
|
||||
KEEP(*(data_smem_{0}_data))
|
||||
KEEP(*(data_smem_{0}_data*))
|
||||
"""
|
||||
|
||||
library_data_template = """
|
||||
|
@ -61,7 +61,7 @@ library_data_template = """
|
|||
|
||||
bss_template = """
|
||||
z_data_smem_{0}_bss_start = .;
|
||||
KEEP(*(data_smem_{0}_bss))
|
||||
KEEP(*(data_smem_{0}_bss*))
|
||||
"""
|
||||
|
||||
library_bss_template = """
|
||||
|
@ -92,7 +92,7 @@ size_cal_string = """
|
|||
z_data_smem_{0}_bss_size = z_data_smem_{0}_bss_end - z_data_smem_{0}_bss_start;
|
||||
"""
|
||||
|
||||
section_regex = re.compile(r'data_smem_([A-Za-z0-9_]*)_(data|bss)')
|
||||
section_regex = re.compile(r'data_smem_([A-Za-z0-9_]*)_(data|bss)*')
|
||||
|
||||
elf_part_size_regex = re.compile(r'z_data_smem_(.*)_part_size')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue