John Passaniti

Overlapping Variables Make Me Cry

Discussion created by John Passaniti on Jul 27, 2010
Latest reply on Jul 29, 2010 by Jacques Lalouette

I'm using CodeWarrior 5.9.0 for a HCS08 target.  I'm new to CodeWarrior, so please be gentle.


I have an application which has two interrupt service routines in two different source files.  Both source files have variables used by the ISRs at file scope.  When linked, the linker is apparently determining that these variables can be overlaid (they are appearing in a .common segment instead of .bss).


While I'm delighted that the linker is apparently reviewing the call graph of my application and trying to optimize, it's getting it wrong, and I can't figure out how to simply tell the linker to not try to make this optimization at all.  Maybe later, I'll fine-tune it and delight in the amount of RAM saved.  Right now, I want the linker to not try to be clever.


Thanks for any advice.