summaryrefslogtreecommitdiff
path: root/tools/kwbimage.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-01-12 20:20:49 +0300
committerStefan Roese <sr@denx.de>2022-01-14 13:39:16 +0300
commitc934c9a66622c5a9054dc38765190c5c182caefb (patch)
treed40d7477ebb3f1479c9c3595d50fd962c775a5c9 /tools/kwbimage.c
parentfdcae2615639454f6c2b7c787de49e74e8746d07 (diff)
downloadu-boot-c934c9a66622c5a9054dc38765190c5c182caefb.tar.xz
tools: kwbimage: Show binary image offset in mkimage -l, in addition to size
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 <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'tools/kwbimage.c')
-rw-r--r--tools/kwbimage.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index 2de8c371c1..d1fb67d3db 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]);
}
}