From patchwork Thu Feb 16 21:18:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 94108 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2699486obz; Thu, 16 Feb 2017 13:18:27 -0800 (PST) X-Received: by 10.84.233.206 with SMTP id m14mr6069647pln.153.1487279907192; Thu, 16 Feb 2017 13:18:27 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c137si8034487pga.301.2017.02.16.13.18.26; Thu, 16 Feb 2017 13:18:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933661AbdBPVSZ (ORCPT + 25 others); Thu, 16 Feb 2017 16:18:25 -0500 Received: from mail-pf0-f176.google.com ([209.85.192.176]:35542 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933107AbdBPVSX (ORCPT ); Thu, 16 Feb 2017 16:18:23 -0500 Received: by mail-pf0-f176.google.com with SMTP id 80so283822pfy.2 for ; Thu, 16 Feb 2017 13:18:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=CiIvfYOAJV45Nz9iH7Vu4mlzSASkHR89f1rlDTITJP0=; b=FqT5iqqbt4BP3d7ZFRxAmDUzLdgW8It4li38q52dcwTX9iYZGeiO63C797nkgpZDlX nVVo796ev42dmBrcRrAdL9vur2h38s/mh/6jscBxNp4ypT+lvUOWJn9EbCs1DuQLdmC8 9VIO50qypVeF1v29fR3J7vok5FpSYL+UVKUcQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CiIvfYOAJV45Nz9iH7Vu4mlzSASkHR89f1rlDTITJP0=; b=J3Km4z3nrQU8LkQEU8gvxGkF4A1nlqNs5NvpR7aK7S6ZYzp+7ST3W4Qp+dOfIW7OYe NjXWEspDyIF6eNLM7twXb+DoGiOzXUfpVR3cCB4WaBMplG8Aa2AoYbv30GQmn+5PS0uu ard9y9jkQIhXYtQbfID+5S958Fn26xIuR+VkdNgEUaFtNtBGX7Udu72Blbev7IsM/J+1 VQfMP4VteBnnEnnJTUsfUUkbXTP5wvPvO79cP65hlnU7jqfObwEV6nvBZnTKWwEJSYhF aPrnkj0tUR6YlAPLBmsNbEP/ToUUw4u7yzEURpJsbD+7Engc/9BLInLZqTCnU9yjdG9/ uyxA== X-Gm-Message-State: AMke39nUAEAvZtGk6H5TI79e3TSDLIBZpeX9AZxLYoUWoyjg/gfJh9D5eRBq3MkWqvqn/1RL X-Received: by 10.84.191.129 with SMTP id a1mr6119307pld.62.1487279902819; Thu, 16 Feb 2017 13:18:22 -0800 (PST) Received: from localhost.localdomain (ip68-101-172-78.sd.sd.cox.net. [68.101.172.78]) by smtp.gmail.com with ESMTPSA id b83sm15364426pfe.12.2017.02.16.13.18.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Feb 2017 13:18:21 -0800 (PST) From: Stephen Boyd To: Michal Marek Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Masahiro Yamada , Jason Cooper Subject: [PATCH] scripts: objdiff: Ignore debug info when comparing Date: Thu, 16 Feb 2017 13:18:20 -0800 Message-Id: <20170216211820.4337-1-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Cc: Masahiro Yamada Cc: Jason Cooper Signed-off-by: Stephen Boyd --- scripts/objdiff | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.10.0.297.gf6727b0 Reviewed-by: Jason Cooper Reviewed-by: Masahiro Yamada 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() { 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