From patchwork Wed Aug 23 01:59:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 110706 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp3479225qge; Tue, 22 Aug 2017 19:00:38 -0700 (PDT) X-Received: by 10.80.135.153 with SMTP id a25mr1622661eda.90.1503453638367; Tue, 22 Aug 2017 19:00:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503453638; cv=none; d=google.com; s=arc-20160816; b=MoIvgxNLsOjX1Eyq3P/H+pDZDoZ9ZLbKNWzSOK0AYt8Dtx31809C4kpnB4UN3VllKQ Exgvm75b63N9ayJSfA3+C78qxaUiMaB931axghEcozuPO503Ku3ujiL4Ku0FNxxn/OSj hSzrkNXIDfvXlgBOLjfbYsmfi2vepSRoH3jQTf09OXJvEs1LREluUQz8huQX3VVB5a5p bWq12ow0mU0UULkRBxKDhx7rdBGLNVsnbgKxawaV61mRLRkyAVCucsVFZg0ekanaH7LW s8B11lUxdOykfFZn2o5D+t3s3sYE63FWb1AhQ1in3OpbM+dE+HIcNNuyDb4NEQLRUPnI nwuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=TDbyFkSZ7/WhM0Vy1nDhyI+6rROC1qxu6g7OE9N2HqI=; b=sFxS/xf9X4uQteYflyPuOn30b6OQ4VWMMeqpjJVGf/PeGjVqFKlmIBx0htFHNWfPMO PNe8VFnx9qVchNByWegq4/YoUVZr9TbDIys6sUcLImx2uxHR9W9nWiRXeewZMjOgtGmw 1miua2ZC8JQpy2psnvVDMIO/4l/mqwUYfzn9qoj1VbHzW7lMyOcwUUpFN0TF48w5jyEr axJGG+fAsd3oH1WORmw0NaWFss9lPfDtlrEZuayjT3sJWkk0x29orWVowz2qoFGd4+OY O87QUWd4qvGwUJiigTUKYay+RiIILCzx+K4gyP/zSWC8bICOUkQ4CAPtpEVrU7mVGfzN iPAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=BIfJUDrW; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id 94si631600edq.89.2017.08.22.19.00.37; Tue, 22 Aug 2017 19:00:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=BIfJUDrW; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 663D7C21EB1; Wed, 23 Aug 2017 02:00:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3BCD3C21E24; Wed, 23 Aug 2017 02:00:30 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EA054C21E24; Wed, 23 Aug 2017 02:00:28 +0000 (UTC) Received: from conuserg-12.nifty.com (conuserg-12.nifty.com [210.131.2.79]) by lists.denx.de (Postfix) with ESMTPS id 8A105C21C57 for ; Wed, 23 Aug 2017 02:00:27 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id v7N1xu2G011046; Wed, 23 Aug 2017 10:59:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com v7N1xu2G011046 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1503453597; bh=NpGI+LbMSrESdMyoXVt3e0d8dUE1cm94A63OBLVJz0c=; h=From:To:Cc:Subject:Date:From; b=BIfJUDrWis0Vaqfwn+84hLEjaIz5p1Y9lolybrlhKivIf01Dh2JdAp7GbVCWFzkbh 31Znjn78c18KwMToxD/8T3BSDPV5+bNq4fTVy2docbaLLyeWZC2eZkLascysiQ9mEE aUjlpAo/Ujlg+6A+vWxYnh44Fw0hBuZwGty0E+O/ZRy8oXw+T74k0/8Sqmo0DhvXNI 0oDuFL77SpVcmyDutTxRI3C2MQS1S1eQ21TE5BTFK0RNkfO9fGmlOfNUy3ABEWEE6j s+LIr1cMxmpLOMnMnVXeHUMUiKXlo1QYAy8eJkW5WsGMT2QojoU1EnaOptHN+oXGm+ c2Sq+0+ROXVJA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 23 Aug 2017 10:59:31 +0900 Message-Id: <1503453571-24705-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Cc: Stephen Boyd , Jason Cooper Subject: [U-Boot] [PATCH] scripts: objdiff: Ignore debug info when comparing X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Stephen Boyd 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 Reviewed-by: Jason Cooper Signed-off-by: Masahiro Yamada --- scripts/objdiff | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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