Richard Aplin

Definitely a linker bug in Coldfire 10.1 INCLUDE - corrupts 0x0a characters!

Discussion created by Richard Aplin on Oct 7, 2011
Latest reply on Oct 7, 2011 by Erich Styger


Hi this is trivially reproduced; 


 Codewarrior 10.1 on Windows


1) set up a project (I'm on coldfire V1+) that compiles and you can debug or can print somehting out of.

2) make a binary file containing for example the four bytes  0x00 , 0x0a , 0x00, 0x0a   

3) Make a folder in your project, put it in there, edit the project directories so the folder is on the "library" path and the linker can find it

4) in your .LCF linker file, add a section at the end of your code to include it , e.g.


__MY_TEST = .;

INCLUDE "testfile.bin"


within the section that ends with

} >> code


5) Compile code

6) In code, or with debugger, look at contents of your "testfile.bin" in memory

7) Enjoy that your 0x0a is silenty turned into 0x0d

8) If it took you hours of debugging to find this, you may lean back and give a little sigh at this point.