Random compilation/linker errors

We have used DC for 5+ years. We are on 9.62.

As the program has gotten larger, we are now starting to see random program/link bugs. The bugs seem to affect random parts of the code: we will add a new function, and as a side-effect some other code will sudden exhbit a serious/fatal bug, even though we can say for sure that the new code has not been touch in the execution tree at point of failure.

It always takes a very long time to isolate these bugs, and the fix is never code-change, but rather to recompile is a “new way”. For example adding “root” keyword to a function that is affected.

As far as we know adding “root” should not fundamentally change code behaviour, so we suspect linker bugs.

We are compiling for RAM and here is the layout:
//Segment Origin Size
Root Code 00:0000 007840
Root Data 10:cdff 00484c
Xmem Code 0f:e000 046746


As a further substantiation of the linker bug theory, we always see the follwing errorneous function size if the map file. Notice the size of 54016 – it is much too large for the function, and we see this errorneous size “float” around the map file depending on linking (does not follow a specific function)

01:e728 656 rsfsRename \RANCHMASTER_782B6.C 2098
01:e9b8 203 rsfsSize \RANCHMASTER_782B6.C 2152
01:ea83 850 rsfsOpenDir \RANCHMASTER_782B6.C 2174
01:edd5 54016 rsfsReadDir \RANCHMASTER_782B6.C 2234
0f:e0d5 161 rsfsFormatDataFlash \RANCHMASTER_782B6.C 2287
0f:e176 1149 syslog_dump \RANCHMASTER_782B6.C 2326