Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEE63C433EF for ; Thu, 13 Jan 2022 06:43:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2093783384; Thu, 13 Jan 2022 07:43:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1642056231; bh=0hzxs/wccVfYNfJl1KMNq5QbYJZ9MoCbZM7s0hFz8mw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XSokoPEi+9xajNAuHruiNFYMW2ynYsL56zIUYb4PwCQd6dxr52sDy3MUJ1eREKE7Z fzbZluieBGaHeXm1ARpztmidDr+uWG0ZCvWEGyE4tGwRZeURcCbzVNA1mlbPb6VwOA 7knzXwHCIuzMlwbw/hwnLxjP3E/79IELvbW291DRSoB1E5c3f2ST9GTndVejx0pmwu W1iCclvUUsOIiGn6tX4PLdOjN5fG0ulmfyzGUxj18rNf14ss12QZ2HMPSq6/fPRLXM AnSF0qKngwBJVVGRngffVogei2aEyTRo/SqlsC1pmtz/WYqmkA4WMylxx24IseOw+2 mHrxhAhRqOWjA== Received: by phobos.denx.de (Postfix, from userid 109) id 09FE08338F; Thu, 13 Jan 2022 07:43:49 +0100 (CET) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [IPv6:2001:67c:2050:1::465:107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B4C8B832EA for ; Thu, 13 Jan 2022 07:43:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:105:465:1:4:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4JZFJL4dSJzQjg4; Thu, 13 Jan 2022 07:43:46 +0100 (CET) Message-ID: <275b45eb-45a9-dd06-bd3e-07ea4774415e@denx.de> Date: Thu, 13 Jan 2022 07:43:42 +0100 MIME-Version: 1.0 Subject: Re: [PATCH u-boot-marvell v2 15/20] tools: kwbimage: Show binary image offset in mkimage -l, in addition to size Content-Language: en-US To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , =?UTF-8?Q?Marek_Beh=c3=ban?= , Chris Packham Cc: u-boot@lists.denx.de References: <20211221155416.8557-1-pali@kernel.org> <20220112172054.5961-1-pali@kernel.org> <20220112172054.5961-16-pali@kernel.org> From: Stefan Roese In-Reply-To: <20220112172054.5961-16-pali@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 1/12/22 18:20, Pali Rohár wrote: > For debugging purposes it is good to know where the binary image would be > loaded and also it is needed to know if printed size is image size or the > size of header together with image. > > Make it unambiguous by showing that printed size is not the size of the > whole header, but only the size of executable code, and print also the > executable offset of this binary image. Load/execute address is the offset > relative to the base address (either 0x40004000 or 0x40000000). > > Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese Thanks, Stefan > --- > tools/kwbimage.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tools/kwbimage.c b/tools/kwbimage.c > index 2de8c371c12a..d1fb67d3db81 100644 > --- a/tools/kwbimage.c > +++ b/tools/kwbimage.c > @@ -1872,9 +1872,12 @@ static void kwbimage_print_header(const void *ptr) > > for_each_opt_hdr_v1 (ohdr, mhdr) { > if (ohdr->headertype == OPT_HDR_V1_BINARY_TYPE) { > - printf("BIN Hdr Size: "); > + printf("BIN Img Size: "); > genimg_print_size(opt_hdr_v1_size(ohdr) - 12 - > 4 * ohdr->data[0]); > + printf("BIN Img Offs: %08x\n", > + (unsigned)((uint8_t *)ohdr - (uint8_t *)mhdr) + > + 8 + 4 * ohdr->data[0]); > } > } > > Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de