This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Cross-Compiling Help


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]