Forum Discussion
Altera_Forum
Honored Contributor
14 years agoThe variable 'OSCPUUsage' is being assumed to be in the 'small data' segment when treated as an 'extern', but the actual definition is 'normal' data.
This might have happened because, for some reason best known to themselves, the default location for 4-byte 'external' data items was changed from 'small' to 'normal' between the gcc3 and gcc4 builds. Possibly the definition and use were compiled with different versions of gcc. Of course, for any performance. you need as much data as possible in the 'small data' segment. The gcc4 compiler build (from Altera) also unconditionally puts any switch statement jump tables into '.code' (instead of '.rodata). This is also rather sub-optimal for systems running with tightly-coupled code and data. (It is, according to the comments, needed for PIC code for shared libraries! no need to foist it on all of us.)