I am using the Ceedling framework for unit testing my firmware. This has qorked quite well. But now I wanted to use the section variables to decouple my code a bit more. And I could not compile them on windows, using gcc. The problem is that I can't use a linker script on windows, so I can't create the __start_section_name symbols.
But it turns out that gcc (or rather, ld) already makes those symbols, but only when the section name does not start with a dot ('.'). I tested this by removing the dot from nrf_section.h, into:
#elif defined(__GNUC__)
#define NRF_SECTION_ITEM_REGISTER(section_name, section_var) \
section_var __attribute__ ((section(STRINGIFY(section_name)))) __attribute__((used))
that seems to work. The linker script can now also be simplified, the __start and __end symbols are now no longer needed in there, as ld handles that for us.
Is there a reason for the leading dot that I am missing? Can I safely remove it? If so, are there plans to add that change to a future SDK?
Thanks,
Michiel