ld script fix: LINKER_syt_checkpointX_start now are guaranteed to be word-aligned
I found a bug that took me a while to figure out what caused it.
On master, when I compile apps/leds
, symbol LINKER_syt_checkpoint1_start
has an odd address, which causes memory failures when attempting to write words to 16bit fields of checkpoint1
. I don't know why it seems to work on master, but I couldn't have reliable checkpoints on my branch isr.
Here I propose a fix that provides symbols LINKER_syt_checkpointX_start
after the ALIGN
instruction, to ensure that the data will be aligned, instead of using ADDR
function that might point to an odd address.
In addition, I noticed that there are other symbols that are given an address using ADDR
and the same errors could happen again. Do you think we should use . = ALIGN(2); PROVIDE(XXX) = .;
for these symbols as well? Another solution could be to add . = ALIGN(2);
at the end of each section, so that all sections have even size, and given the fact that they start with even addresses, the following sections also start with even addresses.
What do you think?