This linker error is usually not related to optimizing -Olink -auto_sda . The compiler sees your entire program and tries not to spoil it with auto-creation for more than 64 thousand data. (This may be a linker error, but this is unlikely.)
This error usually occurs because someone who is not as shrewd as the linker already puts more than 64 Kbytes in the SDA partitions before the linker even gets a chance to go for it. You can be an unresponsive person if you did something like
#pragma startsda int small_data[10000];
(itβs possible to split it into several files, in fact, I think you will get the compiler or assembler diagnostics if you try to create more than 64 Kbytes of SDA in one file).
But an unpromising person can also be a compiler if you pass parameters like -sda=4 (which acts as if you select #pragma startsda for each global variable of 4 bytes or everything in the whole file) and you have a ton global variables. The compiler will happily SDAize 10,000 bytes in each of the 20 separate files, and then the linker will complain that you are transferring 200,000 bytes of SDA to it. (The linker is smart enough to rewrite regular links to data in SDA links, but never learned to rewrite things in the opposite direction.)
Finally, even if you think you do not pass -sda= , you may be surprised. Run the driver with the option -# or -v . IIRC, ccintppc secretly passes -sda=4 by default. You can make the driver stop "helping" you; just go -sda=none or -sda=0 , which should override the default driver. You might want to pass this option on each, starting with your coolest code .
source share