I am trying to compile an embedded C code, but small data area overflow occurs. I know what does it mean, but I don't know how to solve it. Can anyone make a suggestion?
So, the problem is there is r13 register that is the base pointer of the sda, and it is 16 bits long. It is signed so it points to the middle of the sda, and it can be used as an offset to get the given variable value.
If a variable is told to be put to the sda by #pragma ghs startsda then it will be addressed by sda_base+r13, if the variable is at an address that cannot be addressed by this base+register offset, then sda overflow is reported.
How can I find what caused the overflow? If I don't have the map file yet I don't know the variable addresses.