aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/objdiff
diff options
context:
space:
mode:
authorStephen Boyd <stephen.boyd@linaro.org>2017-02-16 16:18:20 -0500
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-03-10 21:13:38 -0500
commit65ba6fa439e7c3cbf97de9dce9e7a3390ae2638c (patch)
treec492a23485d863197d9c85094708583cdd56e252 /scripts/objdiff
parentc1ae3cfa0e89fa1a7ecc4c99031f5e9ae99d9201 (diff)
scripts: objdiff: Ignore debug info when comparing
If the kernel is configured to be built with debug symbols, or has bug tables, comparing files may not work if line numbers change. This makes comparing object files with these options harder to do. Let's strip out the debug info and drop the __bug_table here so that we don't see false positives. There may be other things to drop later, and it may be architecture specific, but this works for me with my ARM64 build. Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org> Reviewed-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/objdiff')
-rwxr-xr-xscripts/objdiff5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/objdiff b/scripts/objdiff
index 62e51dae2138..4fb5d6796893 100755
--- a/scripts/objdiff
+++ b/scripts/objdiff
@@ -57,13 +57,15 @@ get_output_dir() {
57do_objdump() { 57do_objdump() {
58 dir=$(get_output_dir $1) 58 dir=$(get_output_dir $1)
59 base=${1##*/} 59 base=${1##*/}
60 stripped=$dir/${base%.o}.stripped
60 dis=$dir/${base%.o}.dis 61 dis=$dir/${base%.o}.dis
61 62
62 [ ! -d "$dir" ] && mkdir -p $dir 63 [ ! -d "$dir" ] && mkdir -p $dir
63 64
64 # remove addresses for a cleaner diff 65 # remove addresses for a cleaner diff
65 # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and 66 # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and
66 $OBJDUMP -D $1 | sed "s/^[[:space:]]\+[0-9a-f]\+//" > $dis 67 $STRIP -g $1 -R __bug_table -R .note -R .comment -o $stripped
68 $OBJDUMP -D $stripped | sed -e "s/^[[:space:]]\+[0-9a-f]\+//" -e "s:^$stripped:$1:" > $dis
67} 69}
68 70
69dorecord() { 71dorecord() {
@@ -73,6 +75,7 @@ dorecord() {
73 75
74 CMT="`git rev-parse --short HEAD`" 76 CMT="`git rev-parse --short HEAD`"
75 77
78 STRIP="${CROSS_COMPILE}strip"
76 OBJDUMP="${CROSS_COMPILE}objdump" 79 OBJDUMP="${CROSS_COMPILE}objdump"
77 80
78 for d in $FILES; do 81 for d in $FILES; do