Denys Vlasenko | adf922e | 2009-10-08 14:35:37 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | filter() { |
| 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 | |
| 9 | test -d "$1" || exit 1 |
| 10 | test -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 | \ |
| 22 | tee LST | \ |
| 23 | ( |
| 24 | IFS='' |
| 25 | while 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" |
| 38 | done |
| 39 | ) |