How to compare 2 executable?

mvo@monkfish.nosc.mil (Minh Vo)
Tue, 10 Jan 1995 16:38:47 GMT

          From comp.compilers

Related articles
How to compare 2 executable? mvo@monkfish.nosc.mil (1995-01-10)
Re: How to compare 2 executable? danhicks@aol.com (1995-01-26)
| List of all articles for this month |

Newsgroups: comp.compilers
From: mvo@monkfish.nosc.mil (Minh Vo)
Keywords: question, linker, comment
Organization: NCCOSC RDT&E Division, San Diego, CA
Date: Tue, 10 Jan 1995 16:38:47 GMT

Hello,


I'm trying to find a technique to verify if two executables with different
time stamp are compiled from the same source code. What I did as a test
was to write a small program, then compile that same piece of code at 2
different times on an HP 755 machine running hp-ux. I got 2 executables
with the same number of bytes, but different checksum. I even converted
them into hex, and did a byte-to-byte comparision (using "cmp"), there are
a few bytes difference there (bytes 211st, 212nd, and some other). If
the same test was used on SunOS, the check sums are the same. My guess is
that the executables on the HP have the time stamp inserted somehow.


Is there anyone out there know a technique to verify if two executables
are compiled from the same source code? Or better yet, if someone can
point me to a document that layout the structure of an executable file
on hp-ux. I looked at the file /usr/include/a.out.h, but it doesn't
tell me the exact sequence of all the fields of the header of the file.


I'm interested in finding out what the bytes 211st and 212nd are.
Thanks for any help.


Minh Vo.
[COFF and I think ELF executables do indeed have time stamps. See the GCC
makefiles for some hacks to strip out the timestamps and compare them. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.