[fpc-devel] Where to set proper alignment default of const strings?

Michael Ring mail at michael-ring.org
Wed Nov 28 17:49:57 CET 2018


Hi,

I am debugging an issue that I see on mipsel embedded target (and 
perhaps also on arm-embedded for corteX-m0, I had crashes in the same 
rtl routine a while ago)

because RAM is small on embedded devices I use:

{$WRITEABLECONST OFF}

which means that const are read from flash and not from ram.

problem is now that const strings are sometimes not 32-bit aligned and 
this causes an unaligned access exception on pic32mx because date from 
flash must be read 32-bit aligned.

I thought that I had seen the correct place to configure this alignment 
in the past but my google/grep foo is weak at the moment, I cannot find 
something in the fpc sourcecode that rings a bell.

{$CODEALIGN CONSTMIN=4}

also does not work, I recompiled and in my case the const is still 
improperly alligned.


Thanks in advance,


Michael






More information about the fpc-devel mailing list