This has been asked before for VC++ but I am interested in the answer for Solaris.
I'm compiling and linking the following trivial C code:
#include <stdio.h>
int main() {
printf("Hello world!\n");
return 0;
}
using the command:
cc -o hello1 hello.c
and doing this a couple of times to get executables hello2 and hello3. This is being done on the same machine with the same compiler and in the same directory just at different times.
The sizes of the executables are the same but diff reports the binaries as differing and cmp -l goes crazy with a long list of differing locations.
Anyone know what cc is embedding in the executables to make them differ? Timestamps?
Edit: Stripping the executables as Chris suggested below makes diff report the two executables as identical.
If you use "od -c" on the two binaries, and then use a side-by-side diff program, you can get an idea what the differences are. In the past when I have investigated the Sun compilers, it's usually a date string. You can also try stripping the executable to see if that removes the ELF section that has the difference in it.