Hi,
in Embedded Studio V5 the size attribute defined the minimum size of a section.
If you would have placed less than 0x1000 bytes into this section, it would have been expanded.
See line 6 of the generated linker script:
Code
__my_non_init_load_start__ = ALIGN(__non_init_end__ , 4);
.my_non_init ALIGN(__non_init_end__ , 4) (NOLOAD) : AT(ALIGN(__non_init_end__ , 4))
{
__my_non_init_start__ = .;
*(.my_non_init .my_non_init.*)
. = ALIGN(MAX(__my_non_init_start__ + 0x1000 , .), 4);
}
__my_non_init_end__ = __my_non_init_start__ + SIZEOF(.my_non_init);
__my_non_init_size__ = SIZEOF(.my_non_init);
__my_non_init_load_end__ = __my_non_init_end__;
. = ASSERT(__my_non_init_start__ == __my_non_init_end__ || (__my_non_init_end__ - __RAM1_segment_start__) <= __RAM1_segment_size__ , "error: .my_non_init is too large to fit in RAM1 memory segment");
Display More
Embedded Studio V6.32 adds an additional assert to also make the attribute the maximum size of a section:
Code
. = ASSERT(__my_non_init_size__ <= 0x1000 , "error: .my_non_init is larger than specified size");
If that is the behavior you would expect, you could upgrade to the latest version of Embedded Studio, or change your project to use a custom linker script which includes the additional assert.
- Johannes