AnsweredAssumed Answered

Code size limitation bug in Cosmic compiler 4.3.13

Question asked by oakley.jonathan on Feb 4, 2015
Latest reply on Feb 4, 2015 by oakley.jonathan
Hi folks

We're using the 32k code-limited version of the Cosmic compiler: I've just downloaded the latest version 4.3.13 to ensure the bug exists in this, which it does...

I suddenly had a report that my code had grown beyond the 32k limit, which was a surprise as I'd previously had about 1600 bytes free. After a bit of work, it looks as if the .bss section is being counted towards the limit, as it's about 1600 bytes long, and I can remove the error by making one array a couple of elements shorter. Here's the segment list from the .map file - if I try to grow .bss by 2 bytes the link fails, claiming my program is 32770 bytes:

start 000080c0 end 00008d39 length  3193 segment .const
start 00008e8f end 0000f9f8 length 27497 segment .text
start 0000f9f8 end 0000fa00 length     8 segment .cksum
start 00001000 end 000010e8 length   232 segment .eeprom
start 000010e8 end 000013f4 length   780 segment .log
start 00000000 end 00000000 length     0 segment .bsct
start 00000000 end 0000000a length    10 segment .ubsct
start 00000a:0 end 00000a:3 length     3 segment .bit, initialized
start 00008d4b end 00008d4c length     1 segment .bit, from
start 0000000b end 0000000b length     0 segment .share
start 00000010 end 000000fc length   236 segment .data, initialized
start 00008d4c end 00008e38 length   236 segment .data, from
start 000000fc end 000006f2 length  1526 segment .bss
start 000006f2 end 00000749 length    87 segment .ramfn, initialized
start 00008e38 end 00008e8f length    87 segment .ramfn, from
start 00008080 end 000080c0 length    64 segment .version
start 00000000 end 00001861 length  6241 segment .info.
start 00000000 end 00018d56 length 101718 segment .debug
start 00008000 end 00008080 length   128 segment .const
start 00008d39 end 00008d4b length    18 segment .init
I'll report this direct to Cosmic, but obviously can't expect much/any support for the free version; I just hope they'll regard it as enough of a showstopper to fix it quickly, as it seems to be an effective code size limitation of around 30.5k, depending on your .bss size.

Meanwhile, does anyone have similar experience of this, or a workaround?

Best regards

Jonathan

Outcomes