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.

Removing time/date information from executable

Other Parts Discussed in Thread: OMAPL138, TMS320C6748

Hello,

I am compiling a simple source program for the C6748. My aim is to generate exactly the same executable object code each time the source code is compiled. I've noticed that there appears to be some time and date information encoded in the executable, is there some way to prevent that? I have attached the source code I'm using along with a batch file that includes the commands I run to compile and link, and a sample comparison of two executables that I created yesterday. It appears that the time/date information is four bytes long, and appears at an offset of four bytes from the start of the file. If you look in xml.xml, you can see the link_time is exactly the same as the four time/date bytes encoded in the corresponding executable.

Some information which might be helpful:

Tools version: 7.0.3.
Device: TMS320C6748 / OMAPL138 

 

1663.Example.zip

 

  • There is no way to prevent the time stamp from being added to the executable, but you could create your own utility if you wish to say zero out the bytes used for time stamp. There may also be other things in the executable besides the time stamp which could vary from build to build, mostly in the debugging information.

    There is a utility named objdiff which can compare .out files and tell you if they are the same.  The time stamp (as well as the inconsequential debug information) is ignored by this utility when doing this comparison.  Please see this thread for information on where you can download the utility.

  • I figured that might be the case. The debugging information did vary from build to build as well, but using --symdebug:none removes it. The only other thing that appears to vary is the timestamp. Thank you for the suggestion regarding objdiff, but I do not wish to ignore the inconsequential yet variable information in the executable. It is important to my company that the executable be the same each time it is generated.

    Thank you,
    Courtney

  • My company has a similar interest.  I would definitely be interested in having compiler and linker options that would inhibit "varying" information from being placed into the executable.  Based on Courtney's experience with "--symdebug:none", it may be that just one more option for disabling timestamps would do the trick.

    Obviously, objdiff is a valuable tool directly relevant to what I'm interested in, but ultimately a direct byte-for-byte match erases any questions and also works better with our existing infrastructure.

    AartiG's suggestion of a separate utility to strip varying information out of an already-linked executable is also interesting.  If anyone pursues it further, I'd be interested in hearing about it.

    Regards,

    --trock

     

  • I looked into it somewhat. A free hex editing utility, XVI, has the capability to wipe out the timestamp information. It also has scripting capabilities which would allow you to automate the process. Ultimately, this will not be the route I go, as we have an in-house product that can be applied to this process, but I figured I'd share in case you were still interested in the information.