1#!/bin/sh
2# compare two object files, in depth.
3
4x=$1
5y=$2
6BOTH="$1 $2"
7
8
9# if they cmp, we're fine.
10if (cmp $BOTH > /dev/null)
11then
12	exit 0
13fi
14
15# otherwise, we must look closer.
16if (doboth $BOTH size)
17then
18	echo Sizes ok.
19else
20	echo Sizes differ:
21	size $BOTH
22#	exit 1
23fi
24
25if (doboth $BOTH objdump +header)
26then
27	echo Headers ok.
28else
29	echo Header differences.
30#	exit 1
31fi
32
33if (doboth $BOTH objdump +text > /dev/null)
34then
35	echo Text ok.
36else
37	echo Text differences.
38#	doboth $BOTH objdump +text
39#	exit 1
40fi
41
42if (doboth $BOTH objdump +data > /dev/null)
43then
44	echo Data ok.
45else
46	echo Data differences.
47#	doboth $BOTH objdump +data
48#	exit 1
49fi
50
51if (doboth $BOTH objdump +symbols > /dev/null)
52then
53	echo Symbols ok.
54else
55	echo -n Symbol differences...
56
57	if (doboth $BOTH dounsortsymbols)
58	then
59		echo but symbols are simply ordered differently.
60#		echo Now what to do about relocs'?'
61#		exit 1
62	else
63		echo and symbols differ in content.
64		exit 1
65	fi
66fi
67
68# of course, if there were symbol diffs, then the reloc symbol indexes
69# will be off.
70
71if (doboth $BOTH objdump -r > /dev/null)
72then
73	echo Reloc ok.
74else
75	echo -n Reloc differences...
76
77	if (doboth $BOTH dounsortreloc)
78	then
79		echo but relocs are simply ordered differently.
80	else
81		echo and relocs differ in content.
82		exit 1
83	fi
84fi
85
86exit
87
88# eof
89