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.

Variable object code per compiler run on identical input

I compiled a few C sources several times without any change to the sources or command line and expected to get the same md5 sum again and again.

The md5 sums were not stable, however, for both achive files and single object files, for both compilers I have tried (TI ARM v5.1.1 and C6000 cgt v4.7.10).

Inspection of the files showed one difference per object file. Here is a sample listing:

1A30:  00 00 00 00 00 00 00 30 35 31 31 36 31 30 36 00 2E 74 65 78 74 00 2E 6E 65 61 72 64 61 74 61 00  .......05116106..text..neardata

1A30:  00 00 00 00 00 00 00 30 30 36 36 38 31 30 36 00 2E 74 65 78 74 00 2E 6E 65 61 72 64 61 74 61 00  .......00668106..text..neardata

Is that a bug or a feature?

  • Is this md5 sum computed over every byte in the object file?  If so, that is not a valid comparison.  An object file contains all sorts of meta-data (like time stamps) that is always different from build to build.  Please compare the files with the objdiff utility in the cg_xml package.  The objdiff utility ignores meta-data that does not affect anything on the target system.

    Thanks and regards,

    -George