History

scripts: objdiff: change the extension of disassembly from .o to .dis

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.

Masahiro Yamada committed 12 years ago

Commit 8b5d0f21 parent 18165ef1 file · +3 −2Browse files

Showing the changes to scripts/objdiff (1 of 1 file). Show all

Unified · Split

scripts/objdiff+3−2
@@ -65,13 +65,14 @@ dorecord() { · 64 unmodified lines
65 65
66 for f in $FILES; do66 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 $dir71 [ ! -d "$dir" ] && mkdir -p $dir
71 72
72 # remove addresses for a more clear diff73 # remove addresses for a more clear diff
73 # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and74 # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and
74 $OBJDUMP -D $f | sed "s/^[[:space:]]\+[0-9a-f]\+//" > $dir/$bn75 $OBJDUMP -D $f | sed "s/^[[:space:]]\+[0-9a-f]\+//" > $dis
75 done76 done
76}77}
77 78