AnsweredAssumed Answered

S32K144: ld file, user-defined section caused bin file size larger

Question asked by 伟伟 刘 on Apr 10, 2019
Latest reply on Apr 14, 2019 by 伟伟 刘

Hi, all,

 

I add a new section 'nvram_section' which data validity was checked by userself below .bss section.

when I defined a variable such as < __attribute__((section(".nvram"))) char test >, the target bin file size is larger than < char test > defined.
The increased part size is about 40kB and was filled with zero, but both of hex file size is almost equal.

1. what the root cause of this phenomenon
2. how to add a user-defined section for data validity checked by userself rather than variable filled with specific value like in .data section or variable filled with zero in .bss section.
/* Uninitialized data section. */
.bss :
{
/* This is used by the startup in order to initialize the .bss section. */
. = ALIGN(4);
__BSS_START = .;
__bss_start__ = .;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
__bss_end__ = .;
__BSS_END = .;
} > m_data_2

/* data checked by user. */
.nvram_section :
{
. = ALIGN(4);
__NVRAM_START = .;
__start__ = .;
*(.nvram)
. = ALIGN(4);
__nvram_end__ = .;
__NVRAM_END = .;
} > m_data_2
.heap :
{
. = ALIGN(8);
__end__ = .;
PROVIDE(end = .);
PROVIDE(_end = .);
PROVIDE(__end = .);
__HeapBase = .;
. += HEAP_SIZE;
__HeapLimit = .;
__heap_limit = .;
} > m_data_2

 

Regards,

Liu

Outcomes