Skip to content

Commit 65ba6fa

Browse files
bebarinomasahir0y
authored andcommitted
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 <[email protected]> Reviewed-by: Jason Cooper <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent c1ae3cf commit 65ba6fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: scripts/objdiff

+4-1
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ get_output_dir() {
5757
do_objdump() {
5858
dir=$(get_output_dir $1)
5959
base=${1##*/}
60+
stripped=$dir/${base%.o}.stripped
6061
dis=$dir/${base%.o}.dis
6162

6263
[ ! -d "$dir" ] && mkdir -p $dir
6364

6465
# remove addresses for a cleaner diff
6566
# 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
6769
}
6870

6971
dorecord() {
@@ -73,6 +75,7 @@ dorecord() {
7375

7476
CMT="`git rev-parse --short HEAD`"
7577

78+
STRIP="${CROSS_COMPILE}strip"
7679
OBJDUMP="${CROSS_COMPILE}objdump"
7780

7881
for d in $FILES; do

0 commit comments

Comments
 (0)