While developing code for STM32 MCU, I'm placing some structures into custom memory section:
struct MyStruct structName;
__attribute__((__section__("my_section"))) __attribute__((__used__)) const struct MyStruct *const mystruct1 = &x
Linker generated additional symbols, __start_my_section_
and __stop_my_section_
.
After compilation while debugging MCU, I see that __start_my_section_
contains a valid value, e.g. 0x20000468 but __stop_my_section_
is incorrect, equal to 0.
In the .map file, the __stop_my_section_
also contains a valid value:
0x20000470 __stop_my_section_ = .
What's wrong? I haven't added anything to linker script, linker automatically created that section and placed in bss.