Issue with .elf file when linker section is not placed according to adress.
Hello,
to store my SW build information I defined in the linker file a section with a fixed address. like this:
/* placing my build information at a named section: */
.BuildInformationSegment 0x0800F000 :
{
KEEP(*(.BuildInformationSection)) /* keep my variable even if not referenced */
}This works and creates the section containing the string in the .bin. and .elf.
even when I misplace this part and dont sort it according to its address.
When I load the .elf into the STM32CubeProgrammer it looks like the .map file (or similar information) is used to generate a different binary which, when flashed leads to an error.
Here in the screenshot (some details removed) a difference between the bin. and the .elf is visible. This difference only occurs in STM32CubeProgrammer as the .bin is directly generated from the .elf via arm-none-eabi-objcopy. It occurs on the spot where the section is visible in the .map file:
0x000000000800bf22 STL_TM_RAM_BckUpBuf_MarchCXStep
.BuildInformationSegment
0x000000000800f000 0x60
*(.BuildInformationSection)
.BuildInformationSection
0x000000000800f000 0x60 ./Core/Src/production_testing.o
.rodata 0x000000000800bfa4 0x11a8
I know how to fix this in my software (place my section on the correct spot in the linker file) but still find it critical that the STM32CubeProgrammer creates a difference between .elf and .bin and therefore can lead to unexpeced behaviour.
I cant share my code or binaries but it should be reproducable with the linker code above placed somewhere else than in the end of the flash.
Best regards
Martin
