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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.























--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux