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