diff options
author | Stephen Boyd <stephen.boyd@linaro.org> | 2017-08-23 10:59:31 +0900 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-08-26 14:56:14 -0400 |
commit | 527d86558eb45edd1543e38d77cd1e1f09936ec1 (patch) | |
tree | aa7a22056863cbf9b64084f2d0633d5b41daca53 | |
parent | e43f74ac0bfe2f137981bf196ae0bca387ba7860 (diff) | |
download | u-boot-527d86558eb45edd1543e38d77cd1e1f09936ec1.tar.gz u-boot-527d86558eb45edd1543e38d77cd1e1f09936ec1.tar.bz2 u-boot-527d86558eb45edd1543e38d77cd1e1f09936ec1.zip |
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.
[ Import Linux commit: 65ba6fa439e7c3cbf97de9dce9e7a3390ae2638c ]
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>
-rwxr-xr-x | scripts/objdiff | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/objdiff b/scripts/objdiff index 62e51dae21..4fb5d67968 100755 --- a/scripts/objdiff +++ b/scripts/objdiff @@ -57,13 +57,15 @@ get_output_dir() { do_objdump() { dir=$(get_output_dir $1) base=${1##*/} + stripped=$dir/${base%.o}.stripped dis=$dir/${base%.o}.dis [ ! -d "$dir" ] && mkdir -p $dir # remove addresses for a cleaner diff # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and - $OBJDUMP -D $1 | sed "s/^[[:space:]]\+[0-9a-f]\+//" > $dis + $STRIP -g $1 -R __bug_table -R .note -R .comment -o $stripped + $OBJDUMP -D $stripped | sed -e "s/^[[:space:]]\+[0-9a-f]\+//" -e "s:^$stripped:$1:" > $dis } dorecord() { @@ -73,6 +75,7 @@ dorecord() { CMT="`git rev-parse --short HEAD`" + STRIP="${CROSS_COMPILE}strip" OBJDUMP="${CROSS_COMPILE}objdump" for d in $FILES; do |