An now for the stupid question of the day: md5sum differences for "/bin/cp"

David Tonhofer, m-plify S.A. d.tonhofer at m-plify.com
Fri Mar 10 15:20:02 UTC 2006


Right, let's scratch this itch!!

I check whether the 'strip' program (which might presumably be applied to
the executables at installation time) would yield executables with
different checksums... no it does not.

Staying with 'cp': a hexdump has the exact same size for two different
copies. A 'hexdump -C' and subsequent 'diff' reveals a lot of differences.

Question: what sections of the ELF file are the differing ones?

A dissassembly using "objdump --disassemble /bin/cp" and subsequent diff
shows no difference (as hoped).

However, two "objdump --full-contents" and a perl program later (to align the
results and check the difference), the truth is revealed:

Section ".gnu.liblist"  differs almost entirely
Section ".gnu.conflict" differs almost entirely
Section ".got"          differs almost entirely
Section ".got.plt"      differs almost entirely

These are the only sections that differ.

Why? These sections are probably set by "prelink". Seems obvious in retrospect.

Let's verify with 'prelink'

On Machine 1:

$ prelink --verify /bin/cp > prelinked_cp
$ echo $?
0
$ md5sum prelinked_cp
78aa4c9712040c29ac2f1d464fffbfac  prelinked_cp

On Machine 2:

$ prelink --verify /bin/cp > prelinked_cp
$ echo $?
0
$ md5sum prelinked_cp
78aa4c9712040c29ac2f1d464fffbfac  prelinked_cp

Voilà, that's it. The non-prelinked /bin/cp yields identical Md5 sums.

Now, I'm still not sure why 'prelink' would create differing binaries, but I can
live with that.


























More information about the redhat-list mailing list