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