Prior to this commit, the command "scripts/objdiff record path/to/*.o" disassembled the given object into ".tmp_objdiff/path/to/*.o" file. The problem here is that recorded disassemblies are lost if we run "make clean" because it removes all the *.o files. Disassembled code should be dumped into *.dis instead of *.o files.
Showing the changes to scripts/objdiff (1 of 1 file). Show all
Unified · Split
| @@ -65,13 +65,14 @@ dorecord() { · 64 unmodified lines | |||
| 65 | 65 | ||
| 66 | for f in $FILES; do | 66 | for f in $FILES; do |
| 67 | dir=$(get_output_dir $f) | 67 | dir=$(get_output_dir $f) |
| 68 | bn="${f##*/}" | 68 | base=${f##*/} |
| 69 | dis=$dir/${base%.o}.dis | ||
| 69 | 70 | ||
| 70 | [ ! -d "$dir" ] && mkdir -p $dir | 71 | [ ! -d "$dir" ] && mkdir -p $dir |
| 71 | 72 | ||
| 72 | # remove addresses for a more clear diff | 73 | # remove addresses for a more clear diff |
| 73 | # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and | 74 | # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and |
| 74 | $OBJDUMP -D $f | sed "s/^[[:space:]]\+[0-9a-f]\+//" > $dir/$bn | 75 | $OBJDUMP -D $f | sed "s/^[[:space:]]\+[0-9a-f]\+//" > $dis |
| 75 | done | 76 | done |
| 76 | } | 77 | } |
| 77 | 78 | ||