Hi to all,
I'm using _CHECKSUM_ADD_WORD method to verify program content.
It works nice unless the addresses/sizes of the segments are odd number.
I have to check and modify segments sizes(with additional NOPs) evertime I compile the application with some new codes.
I start feeling tired to do this.
Code:
/* _Checksum_CheckAreaWordAdd: word summation checksum of an aera */_CheckSum2ByteType _Checksum_CheckAreaWordAdd(_CHECKSUM_ConstMemBytePtr start, unsigned int len) { _CheckSum2ByteType checkVal=0; const _CheckSum2ByteType*...; while (len > 0) { <-- problem is here, when len is odd, it is always being bigger than 0 checkVal = (_CheckSum2ByteType)(checkVal + (*ptr)); ptr++; len-= sizeof(*ptr); <-- "len -= 2" } return checkVal;}
I tried to patch the function above in checksum.c. I couldn't succeed because the calculated checkVal value nerver match with linker's.
Please save me from this irritating process.
Thank you,
BP.