This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Cross-Compiling Help
- From: Ruppert <dieter_ruppert at siemens dot com>
- To: gcc-help at gcc dot gnu dot org
- Cc: shannon dot kerr at motorola dot com
- Date: Thu, 19 Dec 2002 18:36:08 +0100 (MET)
- Subject: RE: Cross-Compiling Help
- Reply-to: Ruppert <dieter_ruppert at siemens dot com>
Hi,
>
> btw, We have used the "size" utility and it shows that our two binaries have
> the same segment/section sizes. That only proves the sizes are the same and
> not the segment/section contents. If we can show that the segment/section
> contents are the same, does this prove that the binaries are effectively the
> same? Is there a way to compare section/segment content?
I once used the objcopy utility for something similar (it is part
of binutils). I could extract the code section (.text) into a
separate file (using objcopy -j .text ...) and then I simply
used cmp to do the binary comparison. cmp prints the offset of
the differences (if any), and these can be matched against a link mapfile
to locate the objects which cause the difference. With this
information in turn I used objdump on the objects to locate the
differences in machine code.
This, of course, is only feasible for a small number of differences.
---------------------------------------------------------------------
Regards
D.Ruppert
RTS GmbH