This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Different Binary if compiled in trunk or in branch

Hi,

I'm working with the CCS v4. As source administration tool we are using subversion.

For a while I compiled code from the trunk and the branch. The code in the branch and the trunk were exactly the same. But when I make a diff from the builded binaries there was a big difference.

Can you explain me were this difference come from? Is there a workaround?

Thank you,

Matt

  • Hi Matt,

    In my opinion there MUST be differences somewhere in your code. If you have the same code it will end in the same out files. Do you have different compiler/linker settings i.e. optimization enabled in one of the projects? Is the linker command file the same for both projects? Are you using different compiler versions?

    Best regards

    Andreas

  • Hi Matt

    adding to the details that Andreas mentioned above, you can findout the difference also by doing a diff on the MAP file outputs - MAP file will show which compiler/assmebler/linker tools were used when the out/COFF file is built and shows where each section/function are located at in the memory.

    This might give an idea of what could be different.

     

    Best Regards
    Santosh

  • In

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/156549.aspx#567733

    I was told that out files cannot be compared byte wise. Comparing HEX files should be ok.

    Regards, Johannes

  • Johannes,

    you cannot compare two COFF files, correct. But you can compare the MAP files.

    The Map file is normally placed in the same directory as your OUT/COFF file is. If there is no MAP file generated, you can configure CCS project settings to generate a map file for the COFF file. The MAP file has lots of useful details on sections allocation.

    Best Regards

    Santosh

  • There should no difference in my code or project settings. The project in the trunk I copied to the branch and build there again. And then I saw the difference.

    I guess that the linker put the object files different togheter (see figure out of spru514 page 84). The only thing that will change with a copy I think are the path names.

  • Matt,

    is it the same version of codegen tools that you are using to build both the projects?

    Can you also post what kind of differences you are seeing and why you think it is an issue. It would be helpful if you can attach both the MAP files.

    Best Regards

    Santosh

  • Matt,

    Are you comparing the *.out or *.obj files?  Those files have symbols stored in them for debugging/linking purposes, which would be why you would see differences on every compile.  The object files include symbolic names, file paths, time stamps, etc.

    One way to check to make sure the binary is identical is to generate a hex image.  The hex image will include only the data that will be programmed to the device and shouldn't change on every compile.  CCS can be configured to generate a hex file on compile by adjusting your project settings:

    If you are curious as to what kind of information is stored, run the Linux/Cygwin 'strings' utility on the object files to see all the symbols, file paths, and other debug information stored in the object files.

    Regards,
    Harrison

  • Hi,

    I found the problem. I compared the wrong file types, see below.

    From one part of my project I have made a library. I copied the library project from the trunk folder to branches. After that I compiled the copied library project again. Now I compared the original and new compiled lib-files. This lib files have a difference. I have to study it but I guess this difference are file paths and time stamps.

    I made a further experiment I included this libraries into a normal CCS project. In this project I activated the HEX-conversion (see "Harrisons" post above). I compiled this project twice one time with library from trunk and one time with library from branch. After that I compared the two hex-files. And I can't see any difference.

    Thank you for all your help.

    Regards,

    Matt