25
5
If I were to compile a program into a single binary, make a checksum, and then recompile it on the same machine with the same compiler and compiler settings and checksum the recompiled program, would the checksum fail?
If so, why is this? If not, would having a different CPU result in a non-identical binary?
8It depends on the compiler. Some of them embed time stamps, so the answer is "no" for those. – ta.speot.is – 2013-09-01T00:54:05.920
Actually it depends on the executable format, not the compiler. Some executable formats like Windows’ PE format include a timestamp which is touched to the compile time and date, while other formats like Linux’ ELF format do not. Either way, this question hinges on the definition of “identical binary”. The image itself will/should be bitwise identical if the same source file is compiled with the same compiler and libraries and switches and everything, but the header and other metadata can vary.
– Synetech – 2013-12-27T05:13:19.947