This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: GNU gcc library function checksum
- From: Nick Clifton <nickc at redhat dot com>
- To: Duncan Purll <duncanpurll at yahoo dot co dot uk>
- Cc: binutils at sourceware dot org
- Date: Tue, 15 Apr 2008 15:37:10 +0100
- Subject: Re: GNU gcc library function checksum
- References: <226462.96842.qm@web28404.mail.ukl.yahoo.com>
Hi Duncan,
For the purposes of identifying changes in object code (library functions received
as object code) I would like to calculate a checksum value of individual object
> files and / or each function within a library (archive). Are there
any options I can
use with objdump to do this
No.
or are there any other tools that will enable me to compute the checksums?
You can compute checksums of entire object files by just extracting them
and passing them to some external program. eg:
#!/bin/bash
LIB=libbfd.a
for A in `ar t $LIB`
do
ar x $LIB $A
echo "checksum: " `md5sum --binary $A`
rm $A
done
There is no simple equivalent for doing the same on a per-function
basis, though, sorry. You would have to write a program to do this.
Cheers
Nick