blob: a6ec5e6025d6bff3eb12c94074d67b9ecb210662 [file] [log] [blame]
Denys Vlasenkoadf922e2009-10-08 14:35:37 +02001#!/bin/sh
2
3filter() {
4 # sed removes " address: " prefixes which mess up diff
5 sed $'s/^\\(\t*\\)[ ]*[0-9a-f][0-9a-f]*:[ \t]*/\\1/' \
6 | sed 's/__GI_//g'
7}
8
9test -d "$1" || exit 1
10test -d "$2" || exit 1
11
12{
13 (
14 cd "$1" || exit 1
15 find -name '*.o' -o -name '*.os' # -o -name '*.so'
16 )
17 (
18 cd "$2" || exit 1
19 find -name '*.o' -o -name '*.os' # -o -name '*.so'
20 )
21} | sed 's:^\./::' | sort | uniq | \
22tee LST | \
23(
24IFS=''
25while read -r oname; do
26 if ! test -f "$1/$oname"; then
27 echo "Only $2/$oname"
28 continue
29 fi
30 if ! test -f "$2/$oname"; then
31 echo "Only $1/$oname"
32 continue
33 fi
34 diff -q -- "$1/$oname" "$2/$oname" >/dev/null && continue
35 (cd "$1"; objdump -dr "$oname" | filter >"$oname.disasm")
36 (cd "$2"; objdump -dr "$oname" | filter >"$oname.disasm")
37 diff -u "$1/$oname.disasm" "$2/$oname.disasm"
38done
39)